InstCombine: Avoid introducing poison values when lowering llvm.amdgcn.[us]bfe
ClosedPublic

Authored by tstellar on Thu, Oct 25, 4:20 PM.

Details

Summary

When the 3rd argument to these intrinsics is zero, lowering them
to shift instructions produces poison values, since we end up with
shift amounts equal to the number of bits in the shifted value. This
means we can only lower these intrinsics if we can prove that the
3rd argument is not zero.

Diff Detail

Repository
rL LLVM
tstellar created this revision.Thu, Oct 25, 4:20 PM
bnieuwenhuizen added inline comments.
lib/Transforms/InstCombine/InstCombineCalls.cpp
3452 ↗(On Diff #171216)

Small nit in this comment and the commit title/message: posion -> poison?

tstellar updated this revision to Diff 171221.Thu, Oct 25, 4:37 PM

Fix spelling.

tstellar retitled this revision from InstCombine: Avoid introducing posion values when lowering llvm.amdgcn.[us]bfe to InstCombine: Avoid introducing poison values when lowering llvm.amdgcn.[us]bfe.Thu, Oct 25, 4:37 PM
tstellar edited the summary of this revision. (Show Details)
arsenm accepted this revision.Thu, Oct 25, 7:48 PM

LGTM besides formatting

lib/Transforms/InstCombine/InstCombineCalls.cpp
3454 ↗(On Diff #171221)

Extra space before (

This revision is now accepted and ready to land.Thu, Oct 25, 7:48 PM
This revision was automatically updated to reflect the committed changes.