summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-03-10 16:26:37 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-03-10 16:26:37 +0000
commit1632fe1f77b114799d2aa00ff2c097d9be47708a (patch)
tree211779f98319abc0f06e4887feddc08811b62934 /llvm/lib/Target/ARM/ARMAsmPrinter.cpp
parent396e02a6e309cb3270ec2cd16173ce4feef11511 (diff)
downloadbcm5719-llvm-1632fe1f77b114799d2aa00ff2c097d9be47708a.tar.gz
bcm5719-llvm-1632fe1f77b114799d2aa00ff2c097d9be47708a.zip
ARM: follow up improvements for SVN r263118
The initial change was insufficiently complete for always getting the semantics of __builtin_longjmp correct. The builtin is translated into a `tInt_eh_sjlj_longjmp` DAG node. This node set R7 as clobbered. However, the code would then follow up with a clobber of R11. I had failed to notice the imp-def,kill on R7 in the isel. Unfortunately, it seems that it is not possible to conditionalise the Defs list via an !if. Instead, construct a new parallel WIN node and prefer that when targeting windows. This ensures that we now both correctly model the __builtin_longjmp as well as construct the frame in a more ABI conformant manner. llvm-svn: 263123
Diffstat (limited to 'llvm/lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMAsmPrinter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 2629da9570f..8b011d60964 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -1852,13 +1852,13 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
.addReg(0));
return;
}
- case ARM::tInt_eh_sjlj_longjmp: {
+ case ARM::tInt_eh_sjlj_longjmp:
+ case ARM::tInt_WIN_eh_sjlj_longjmp: {
// ldr $scratch, [$src, #8]
// mov sp, $scratch
// ldr $scratch, [$src, #4]
// ldr r7, [$src]
// bx $scratch
- const Triple &TT = TM.getTargetTriple();
unsigned SrcReg = MI->getOperand(0).getReg();
unsigned ScratchReg = MI->getOperand(1).getReg();
@@ -1888,7 +1888,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
.addReg(0));
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tLDRi)
- .addReg(TT.isOSWindows() ? ARM::R11 : ARM::R7)
+ .addReg(Opc == ARM::tInt_WIN_eh_sjlj_longjmp ? ARM::R11 : ARM::R7)
.addReg(SrcReg)
.addImm(0)
// Predicate.
OpenPOWER on IntegriCloud