This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Out of range shifts might be undef
ClosedPublic

Authored by olista01 on Mar 9 2017, 5:56 AM.

Details

Summary

If it is possible for the RHS of a shift operation to be greater than or equal to the bit-width, then the result might be undef, and we can't report any known bits.

In some cases, this was allowing a transformation in instcombine which widened an undef value from i1 to i32, increasing the range of values that a function could return.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 created this revision.Mar 9 2017, 5:56 AM
jmolloy accepted this revision.Mar 14 2017, 2:40 AM

Took a bit of staring to convince myself it was right, but LGTM.

This revision is now accepted and ready to land.Mar 14 2017, 2:40 AM
This revision was automatically updated to reflect the committed changes.