[llvm-bugs] [Bug 44602] New: [Attributor] Failure to propagate alignment through PHI when may have null incoming value

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 21 03:02:52 PST 2020


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: unassignedbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200121/67967adb/attachment-0001.html>


More information about the llvm-bugs mailing list