https://bugs.llvm.org/show_bug.cgi?id=44602

            Bug ID: 44602
           Summary: [Attributor] Failure to propagate alignment through
                    PHI when may have null incoming value
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Global Analyses
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

https://godbolt.org/z/jryz4D

define void @square(i1 %c, i32* align 32 %dst) #0 {
    br i1 %c, label %truebb, label %falsebb
truebb:
    br label %end
falsebb:
    br label %end
end:
    %ptr = phi i32* [ %dst, %truebb ], [ null, %falsebb ]
    store i32 0, i32* %ptr
    ret void
}

attributes #0 = { "null-pointer-is-valid"="true" }


Regardless of whether or not null is legal address,
we should annotate that store with `align 32`,
because `%ptr` can either take the value of `i32* align 32 %dst`,
or `null`. Because `null` is *always* aligned - no bits are set.

I might take a stab at this..

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to