summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCCTRLoops.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-07-17 05:35:44 +0000
committerHal Finkel <hfinkel@anl.gov>2013-07-17 05:35:44 +0000
commit8d7435e9b1319c6e748a06c0b41a4c3de82ec750 (patch)
tree02f3b4e3f736f64d2ce801d86d09997d8c7ee951 /lib/Target/PowerPC/PPCCTRLoops.cpp
parent09df10df0d6f327049a7f315f175ab77044e6aaa (diff)
downloadllvm-8d7435e9b1319c6e748a06c0b41a4c3de82ec750.tar.gz
llvm-8d7435e9b1319c6e748a06c0b41a4c3de82ec750.tar.bz2
llvm-8d7435e9b1319c6e748a06c0b41a4c3de82ec750.tar.xz
PPC: Add CTR-register clobber to builtin setjmp
Because the builtin longjmp implementation uses a CTR-based indirect jump, when the control flow arrives at the builtin setjmp call, the CTR register has necessarily been clobbered. Correspondingly, this adds CTR to the list of implicit definitions of the builtin setjmp pseudo instruction. We don't need to add CTR to the implicit definitions of builtin longjmp because, even though it does clobber the CTR register, the control flow cannot return to inside the loop unless there is also a builtin setjmp call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCCTRLoops.cpp')
-rw-r--r--lib/Target/PowerPC/PPCCTRLoops.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCCTRLoops.cpp b/lib/Target/PowerPC/PPCCTRLoops.cpp
index 30181a027a..4e30c53764 100644
--- a/lib/Target/PowerPC/PPCCTRLoops.cpp
+++ b/lib/Target/PowerPC/PPCCTRLoops.cpp
@@ -233,6 +233,13 @@ bool PPCCTRLoops::mightUseCTR(const Triple &TT, BasicBlock *BB) {
#endif
case Intrinsic::longjmp:
+
+ // Exclude eh_sjlj_setjmp; we don't need to exclude eh_sjlj_longjmp
+ // because, although it does clobber the counter register, the
+ // control can't then return to inside the loop unless there is also
+ // an eh_sjlj_setjmp.
+ case Intrinsic::eh_sjlj_setjmp:
+
case Intrinsic::memcpy:
case Intrinsic::memmove:
case Intrinsic::memset: