Skip to content

Align attribute doesn't imply dereferenceability #90446

Description

@nunoplopes

InstCombine does the following propagation of align(32) in the function argument to the load.
However these align have different semantics. Align in load/store imply dereferenceability of the size rounded up to the alignment (per LangRef). Align in a function argument does not.

define i32 @foo2(ptr align(32) %a) {
  %#0 = load i32, ptr %a, align 4
  ret i32 %#0
}
=>
define i32 @foo2(ptr align(32) %a) {
  %#0 = load i32, ptr align(32) %a, align 32
  ret i32 %#0
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target

Example:
ptr align(32) %a = pointer(non-local, block_id=1, offset=0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions