mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Fix Reassociate/shifttest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21839 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
19bb2283e6
commit
641f02f10f
@ -556,6 +556,13 @@ static void PrintOps(unsigned Opcode, const std::vector<ValueEntry> &Ops,
|
||||
/// reassociating them as we go.
|
||||
void Reassociate::ReassociateBB(BasicBlock *BB) {
|
||||
for (BasicBlock::iterator BI = BB->begin(); BI != BB->end(); ++BI) {
|
||||
if (BI->getOpcode() == Instruction::Shl &&
|
||||
isa<ConstantInt>(BI->getOperand(1)))
|
||||
if (Instruction *NI = ConvertShiftToMul(BI)) {
|
||||
MadeChange = true;
|
||||
BI = NI;
|
||||
}
|
||||
|
||||
// Reject cases where it is pointless to do this.
|
||||
if (!isa<BinaryOperator>(BI) || BI->getType()->isFloatingPoint())
|
||||
continue; // Floating point ops are not associative.
|
||||
@ -579,12 +586,6 @@ void Reassociate::ReassociateBB(BasicBlock *BB) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (BI->getOpcode() == Instruction::Shl &&
|
||||
isa<ConstantInt>(BI->getOperand(1)))
|
||||
if (Instruction *NI = ConvertShiftToMul(BI)) {
|
||||
MadeChange = true;
|
||||
BI = NI;
|
||||
}
|
||||
|
||||
// If this instruction is a commutative binary operator, process it.
|
||||
if (!BI->isAssociative()) continue;
|
||||
|
Loading…
Reference in New Issue
Block a user