aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-07-01 19:34:59 +0000
committerHal Finkel <hfinkel@anl.gov>2013-07-01 19:34:59 +0000
commit25e4a0d41826266b210dd5348052492977a0c587 (patch)
tree35a55c898b5a86cbcf156314a1be1347ab1770ca /llvm/lib/Target/PowerPC/PPCCTRLoops.cpp
parent8625fd8cad18731d042dad5f22ad926ed9f99b66 (diff)
downloadllvm-25e4a0d41826266b210dd5348052492977a0c587.zip
llvm-25e4a0d41826266b210dd5348052492977a0c587.tar.gz
llvm-25e4a0d41826266b210dd5348052492977a0c587.tar.bz2
Don't form PPC CTR loops for over-sized exit counts
Although you can't generate this from C on PPC64, if you have a loop using a 64-bit counter on PPC32 then you can't form a CTR-based loop for it. This had been cauing the PPCCTRLoops pass to assert. Thanks to Joerg Sonnenberger for providing a test case! llvm-svn: 185361
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCCTRLoops.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCCTRLoops.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp
index 08247c2..bfc9495 100644
--- a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp
+++ b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp
@@ -415,6 +415,9 @@ bool PPCCTRLoops::convertToCTRLoop(Loop *L) {
} else if (!SE->isLoopInvariant(EC, L))
continue;
+ if (SE->getTypeSizeInBits(EC->getType()) > (TT.isArch64Bit() ? 64 : 32))
+ continue;
+
// We now have a loop-invariant count of loop iterations (which is not the
// constant zero) for which we know that this loop will not exit via this
// exisiting block.