diff options
author | Evan Cheng <evan.cheng@apple.com> | 2012-07-17 18:54:11 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2012-07-17 18:54:11 +0000 |
commit | e6a3b03ee05332a96f61c39759658bbab7bd6783 (patch) | |
tree | cb6f2a64b62afaeb1227162fe7728f70b784277e /llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | |
parent | 831c1e081965ab860076d305e7a484b235b9a90e (diff) | |
download | llvm-e6a3b03ee05332a96f61c39759658bbab7bd6783.zip llvm-e6a3b03ee05332a96f61c39759658bbab7bd6783.tar.gz llvm-e6a3b03ee05332a96f61c39759658bbab7bd6783.tar.bz2 |
Back out r160101 and instead implement a dag combine to recover from instcombine transformation.
llvm-svn: 160387
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index 0a62242..125c74a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -40,13 +40,6 @@ static bool ShrinkDemandedConstant(Instruction *I, unsigned OpNo, // This instruction is producing bits that are not demanded. Shrink the RHS. Demanded &= OpC->getValue(); - if (I->getOpcode() == Instruction::Add) { - // However, if the instruction is an add then the constant may be negated - // when the opcode is changed to sub. Check if the transformation is really - // shrinking the constant. - if (Demanded.abs().getActiveBits() > OpC->getValue().abs().getActiveBits()) - return false; - } I->setOperand(OpNo, ConstantInt::get(OpC->getType(), Demanded)); return true; } |