Teach computeKnownBits to use align attribute on return values and align metadata on loads. This fixes the following bug: https://llvm.org/bugs/show_bug.cgi?id=25068
Details
Diff Detail
Event Timeline
LGTM w/comments addressed and one part separated into a follow on change as noted inline.
| lib/Analysis/ValueTracking.cpp | ||
|---|---|---|
| 1412 | The changes to this function LGTM w/appropriate test cases. | |
| 2981 | I'm not sure the GlobalVariable code is equivalent to the other case. I would prefer you separate the refactoring to use getAlignment into a separate patch. It seems slightly higher risk. (My concern comes from the difference between BaseAlign and Align. I haven't looked at these carefully and I'm worried that your getAlignment is computing Align not BaseAlign.) | |
| test/Transforms/InstCombine/assume-redundant.ll | ||
| 52 | Please add versions of this test for both load w/metadata and allocas. | |
The changes to this function LGTM w/appropriate test cases.