This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by tstellar on Oct 25 2018, 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

Event Timeline

tstellar created this revision.Oct 25 2018, 4:20 PM
bnieuwenhuizen added inline comments.
lib/Transforms/InstCombine/InstCombineCalls.cpp
3452

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

tstellar updated this revision to Diff 171221.Oct 25 2018, 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.Oct 25 2018, 4:37 PM
tstellar edited the summary of this revision. (Show Details)
arsenm accepted this revision.Oct 25 2018, 7:48 PM

LGTM besides formatting

lib/Transforms/InstCombine/InstCombineCalls.cpp
3454

Extra space before (

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