Skip to content
Commit 42b83a5e authored by David Majnemer's avatar David Majnemer
Browse files

InstCombine: Don't unconditionally preserve 'nsw' when shrinking constants

Consider:
  %add = add nsw i32 %a, -16777216
  %and = and i32 %add, 255

Regardless of whether or not we demand the sign bit of %add, we cannot
replace -16777216 with 2130706432 without also removing 'nsw' from the
instruction.

This fixes PR20377.

llvm-svn: 216261
parent 987f1864
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment