diff options
author | Craig Topper <craig.topper@intel.com> | 2017-08-28 18:44:28 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-08-28 18:44:28 +0000 |
commit | 3763f0e00dada36382c219e4d1b140cd0501b8cc (patch) | |
tree | 87b0c9b9232fb0431263659be37a0a4a38d3341c /llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | |
parent | 2164a271a333d4e822c95b977002d68f81c8c636 (diff) | |
download | llvm-3763f0e00dada36382c219e4d1b140cd0501b8cc.zip llvm-3763f0e00dada36382c219e4d1b140cd0501b8cc.tar.gz llvm-3763f0e00dada36382c219e4d1b140cd0501b8cc.tar.bz2 |
[InstCombine] Call hasNoSignedWrap instead of hasNoUnsignedWrap to get the NSW flag when handling Add in SimplifyDemandedUseBits.
This is a typo from r311789.
This should fix PR34349.
llvm-svn: 311902
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index 39d1dfe..cda2ce6 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -426,7 +426,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, return I->getOperand(1); // Otherwise just compute the known bits of the result. - bool NSW = cast<OverflowingBinaryOperator>(I)->hasNoUnsignedWrap(); + bool NSW = cast<OverflowingBinaryOperator>(I)->hasNoSignedWrap(); Known = KnownBits::computeForAddSub(I->getOpcode() == Instruction::Add, NSW, LHSKnown, RHSKnown); break; |