diff options
author | Petar Jovanovic <petar.jovanovic@imgtec.com> | 2016-03-17 17:11:33 +0000 |
---|---|---|
committer | Petar Jovanovic <petar.jovanovic@imgtec.com> | 2016-03-17 17:11:33 +0000 |
commit | 0b44f240331b47f3c0f2984ff0ad441ff1ab8414 (patch) | |
tree | a08a962a4ec33c6f83dd17e1393fa40986fb5050 /llvm/lib/Target/PowerPC | |
parent | 05f7e6ae0de1f7916cc51c76249d52d6826dcf2d (diff) | |
download | bcm5719-llvm-0b44f240331b47f3c0f2984ff0ad441ff1ab8414.tar.gz bcm5719-llvm-0b44f240331b47f3c0f2984ff0ad441ff1ab8414.zip |
[PowerPC] Disable CTR loops optimization for soft float operations
This patch prevents CTR loops optimization when using soft float operations
inside loop body. Soft float operations use function calls, but function
calls are not allowed inside CTR optimized loops.
Patch by Aleksandar Beserminji.
Differential Revision: http://reviews.llvm.org/D17600
llvm-svn: 263727
Diffstat (limited to 'llvm/lib/Target/PowerPC')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp index b6ac4d54d4c..b0a3e93c486 100644 --- a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp +++ b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp @@ -422,6 +422,25 @@ bool PPCCTRLoops::mightUseCTR(const Triple &TT, BasicBlock *BB) { if (SI->getNumCases() + 1 >= (unsigned)TLI->getMinimumJumpTableEntries()) return true; } + + if (TM->getSubtargetImpl(*BB->getParent())->getTargetLowering()->useSoftFloat()) { + switch(J->getOpcode()) { + case Instruction::FAdd: + case Instruction::FSub: + case Instruction::FMul: + case Instruction::FDiv: + case Instruction::FRem: + case Instruction::FPTrunc: + case Instruction::FPExt: + case Instruction::FPToUI: + case Instruction::FPToSI: + case Instruction::UIToFP: + case Instruction::SIToFP: + case Instruction::FCmp: + return true; + } + } + for (Value *Operand : J->operands()) if (memAddrUsesCTR(TM, Operand)) return true; |