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)
commit40f76d583030084c557354ec4905dab45cb5cefe
tree149238ad8bdeeb9536efb8a0f4c80ec3f528f987
parenta07f720a1bde78ae2ff0fdc1fa73e8484c5938dd
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.

llvm-svn: 186488
llvm/lib/Target/PowerPC/PPCCTRLoops.cpp
llvm/lib/Target/PowerPC/PPCInstr64Bit.td
llvm/lib/Target/PowerPC/PPCInstrInfo.td
llvm/test/CodeGen/PowerPC/sj-ctr-loop.ll [new file with mode: 0644]