PPC: Add CTR-register clobber to builtin setjmp
authorHal Finkel <hfinkel@anl.gov>
Wed, 17 Jul 2013 05:35:44 +0000 (05:35 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 17 Jul 2013 05:35:44 +0000 (05:35 +0000)
commit8d7435e9b1319c6e748a06c0b41a4c3de82ec750
tree02f3b4e3f736f64d2ce801d86d09997d8c7ee951
parent09df10df0d6f327049a7f315f175ab77044e6aaa
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
lib/Target/PowerPC/PPCCTRLoops.cpp
lib/Target/PowerPC/PPCInstr64Bit.td
lib/Target/PowerPC/PPCInstrInfo.td
test/CodeGen/PowerPC/sj-ctr-loop.ll [new file with mode: 0644]