mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Use more efficient test for one value in a ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34859 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1048,7 +1048,7 @@ void LoopUnswitch::SimplifyCode(std::vector<Instruction*> &Worklist) {
|
||||
cast<BinaryOperator>(I)->swapOperands();
|
||||
if (ConstantInt *CB = dyn_cast<ConstantInt>(I->getOperand(1)))
|
||||
if (CB->getType() == Type::Int1Ty) {
|
||||
if (CB->getZExtValue()) // X & 1 -> X
|
||||
if (CB->isOne()) // X & 1 -> X
|
||||
ReplaceUsesOfWith(I, I->getOperand(0), Worklist);
|
||||
else // X & 0 -> 0
|
||||
ReplaceUsesOfWith(I, I->getOperand(1), Worklist);
|
||||
@@ -1061,7 +1061,7 @@ void LoopUnswitch::SimplifyCode(std::vector<Instruction*> &Worklist) {
|
||||
cast<BinaryOperator>(I)->swapOperands();
|
||||
if (ConstantInt *CB = dyn_cast<ConstantInt>(I->getOperand(1)))
|
||||
if (CB->getType() == Type::Int1Ty) {
|
||||
if (CB->getZExtValue()) // X | 1 -> 1
|
||||
if (CB->isOne()) // X | 1 -> 1
|
||||
ReplaceUsesOfWith(I, I->getOperand(1), Worklist);
|
||||
else // X | 0 -> X
|
||||
ReplaceUsesOfWith(I, I->getOperand(0), Worklist);
|
||||
|
||||
Reference in New Issue
Block a user