diff options
author | Eric Christopher <echristo@gmail.com> | 2015-09-08 22:14:58 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2015-09-08 22:14:58 +0000 |
commit | 71f6e2f5686fca3a2ed0858ed6a01db663352b43 (patch) | |
tree | d42e2635091093ef2ef0f7be162e39fde3065dc8 /llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | |
parent | b5be2ffae55520b48cb1ee58277c4e380565cb89 (diff) | |
download | bcm5719-llvm-71f6e2f5686fca3a2ed0858ed6a01db663352b43.tar.gz bcm5719-llvm-71f6e2f5686fca3a2ed0858ed6a01db663352b43.zip |
Fix the PPC CTR Loop pass to look for calls to the intrinsics that
read CTR and count them as reading the CTR.
llvm-svn: 247083
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCCTRLoops.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp index 376d5ab1087..d43aa1a87b0 100644 --- a/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp +++ b/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp @@ -239,6 +239,11 @@ bool PPCCTRLoops::mightUseCTR(const Triple &TT, BasicBlock *BB) { if (F->getIntrinsicID() != Intrinsic::not_intrinsic) { switch (F->getIntrinsicID()) { default: continue; + // If we have a call to ppc_is_decremented_ctr_nonzero, or ppc_mtctr + // we're definitely using CTR. + case Intrinsic::ppc_is_decremented_ctr_nonzero: + case Intrinsic::ppc_mtctr: + return true; // VisualStudio defines setjmp as _setjmp #if defined(_MSC_VER) && defined(setjmp) && \ @@ -426,6 +431,7 @@ bool PPCCTRLoops::convertToCTRLoop(Loop *L) { // Process nested loops first. for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I) { MadeChange |= convertToCTRLoop(*I); + DEBUG(dbgs() << "Nested loop converted\n"); } // If a nested loop has been converted, then we can't convert this loop. |