3.5 snapshot (which around 60% of them did).. r203025, r203050, r203054, r203281, r203581, r203719, r203818, r204155, r204304, r205067, r205630, r205738, r207990, r208501. ok matthew@
30 lines
1.3 KiB
Plaintext
30 lines
1.3 KiB
Plaintext
$OpenBSD: patch-lib_Target_PowerPC_PPCCTRLoops_cpp,v 1.1 2014/07/10 22:46:37 brad Exp $
|
|
|
|
r208501
|
|
On PPC32, 128-bit shifts might be runtime calls
|
|
|
|
The counter-loops formation pass needs to know what operations might be
|
|
function calls (because they can't appear in counter-based loops). On PPC32,
|
|
128-bit shifts might be runtime calls (even though you can't use __int128 on
|
|
PPC32, it seems that SROA might form them).
|
|
|
|
Fixes PR19709.
|
|
|
|
--- lib/Target/PowerPC/PPCCTRLoops.cpp.orig Sun Mar 2 21:57:39 2014
|
|
+++ lib/Target/PowerPC/PPCCTRLoops.cpp Sat Jun 14 04:38:11 2014
|
|
@@ -370,6 +370,14 @@ bool PPCCTRLoops::mightUseCTR(const Triple &TT, BasicB
|
|
J->getOpcode() == Instruction::URem ||
|
|
J->getOpcode() == Instruction::SRem)) {
|
|
return true;
|
|
+ } else if (TT.isArch32Bit() &&
|
|
+ isLargeIntegerTy(false, J->getType()->getScalarType()) &&
|
|
+ (J->getOpcode() == Instruction::Shl ||
|
|
+ J->getOpcode() == Instruction::AShr ||
|
|
+ J->getOpcode() == Instruction::LShr)) {
|
|
+ // Only on PPC32, for 128-bit integers (specifically not 64-bit
|
|
+ // integers), these might be runtime calls.
|
|
+ return true;
|
|
} else if (isa<IndirectBrInst>(J) || isa<InvokeInst>(J)) {
|
|
// On PowerPC, indirect jumps use the counter register.
|
|
return true;
|