mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Disallow i64 div/rem in PPC32 counter loops
On PPC32, [su]div,rem on i64 types are transformed into runtime library function calls. As a result, they are not allowed in counter-based loops (the counter-loops verification pass caught this error; this change fixes PR16169). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183581 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -338,6 +338,13 @@ bool PPCCTRLoops::mightUseCTR(const Triple &TT, BasicBlock *BB) {
|
||||
CI->getDestTy()->getScalarType()->isIntegerTy(64))
|
||||
))
|
||||
return true;
|
||||
} else if (TT.isArch32Bit() &&
|
||||
J->getType()->getScalarType()->isIntegerTy(64) &&
|
||||
(J->getOpcode() == Instruction::UDiv ||
|
||||
J->getOpcode() == Instruction::SDiv ||
|
||||
J->getOpcode() == Instruction::URem ||
|
||||
J->getOpcode() == Instruction::SRem)) {
|
||||
return true;
|
||||
} else if (isa<IndirectBrInst>(J) || isa<InvokeInst>(J)) {
|
||||
// On PowerPC, indirect jumps use the counter register.
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user