[PATCH] D19358: [PowerPC] [SSP] Fix stack guard load for 32-bit.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 10:41:57 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL267017: [PowerPC] [SSP] Fix stack guard load for 32-bit. (authored by koriakin).

Changed prior to commit:
  http://reviews.llvm.org/D19358?vs=54483&id=54535#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19358

Files:
  llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
  llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll

Index: llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll
===================================================================
--- llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll
+++ llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll
@@ -5,7 +5,7 @@
 
 ; DARWIN32: __stack_chk_guard
 ; DARWIN64: __stack_chk_guard
-; LINUX32: ld {{[0-9]+}}, -28680(2)
+; LINUX32: lwz {{[0-9]+}}, -28680(2)
 ; LINUX64: ld {{[0-9]+}}, -28688(13)
 
 ; DARWIN32: __stack_chk_fail
Index: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
@@ -1864,7 +1864,7 @@
            "Only Linux target is expected to contain LOAD_STACK_GUARD");
     const int64_t Offset = Subtarget.isPPC64() ? -0x7010 : -0x7008;
     const unsigned Reg = Subtarget.isPPC64() ? PPC::X13 : PPC::R2;
-    MI->setDesc(get(PPC::LD));
+    MI->setDesc(get(Subtarget.isPPC64() ? PPC::LD : PPC::LWZ));
     MachineInstrBuilder(*MI->getParent()->getParent(), MI)
         .addImm(Offset)
         .addReg(Reg);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19358.54535.patch
Type: text/x-patch
Size: 1123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160421/98f6a79f/attachment.bin>


More information about the llvm-commits mailing list