diff options
| author | Hal Finkel <hfinkel@anl.gov> | 2013-07-01 19:34:59 +0000 |
|---|---|---|
| committer | Hal Finkel <hfinkel@anl.gov> | 2013-07-01 19:34:59 +0000 |
| commit | 25e4a0d41826266b210dd5348052492977a0c587 (patch) | |
| tree | 35a55c898b5a86cbcf156314a1be1347ab1770ca /llvm/lib/Target | |
| parent | 8625fd8cad18731d042dad5f22ad926ed9f99b66 (diff) | |
| download | bcm5719-llvm-25e4a0d41826266b210dd5348052492977a0c587.tar.gz bcm5719-llvm-25e4a0d41826266b210dd5348052492977a0c587.zip | |
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')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp index 08247c289f3..bfc949521be 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. |

