As a followup for D48007.
Since we already handle x << (bitwidth - y) >> (bitwidth - y) pattern,
which does not have ub for both the edge cases (y == 0, y == bitwidth),
i think also handling a pattern that is ub for y == bitwidth should be fine.
Paths
| Differential D48010
[AMDGPU] Recognize x & ((1 << y) - 1) pattern. ClosedPublic Authored by lebedev.ri on Jun 11 2018, 4:47 AM.
Details Summary As a followup for D48007. Since we already handle x << (bitwidth - y) >> (bitwidth - y) pattern,
Diff Detail
Event TimelineHerald added subscribers: t-tye, tpr, dstuttard and 4 others. · View Herald TranscriptJun 11 2018, 4:47 AM lebedev.ri added a parent revision: D48007: [AMDGPU] Recognize x & (-1 >> (32 - y)) pattern..Jun 11 2018, 4:47 AM lebedev.ri mentioned this in D48012: [AMDGPU] Recognize x & ~(-1 << y) pattern..Jun 11 2018, 4:51 AM This revision is now accepted and ready to land.Jun 11 2018, 7:46 AM Closed by commit rL334816: [AMDGPU] Recognize x & ((1 << y) - 1) pattern. (authored by lebedevri). · Explain WhyJun 15 2018, 3:01 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 151478 llvm/trunk/lib/Target/AMDGPU/AMDGPUInstructions.td
llvm/trunk/test/CodeGen/AMDGPU/extract-lowbits.ll
|