[llvm] r188771 - [stackprotector] Small Bit of computation hoisting.

Michael Gottesman mgottesman at apple.com
Tue Aug 20 01:56:26 PDT 2013


Author: mgottesman
Date: Tue Aug 20 03:56:26 2013
New Revision: 188771

URL: http://llvm.org/viewvc/llvm-project?rev=188771&view=rev
Log:
[stackprotector] Small Bit of computation hoisting.

Modified:
    llvm/trunk/lib/CodeGen/StackProtector.cpp

Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=188771&r1=188770&r2=188771&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StackProtector.cpp (original)
+++ llvm/trunk/lib/CodeGen/StackProtector.cpp Tue Aug 20 03:56:26 2013
@@ -387,7 +387,8 @@ static bool CreatePrologue(Function *F,
 ///    value. It calls __stack_chk_fail if they differ.
 bool StackProtector::InsertStackProtectors() {
   bool HasPrologue = false;
-  bool SupportsSelectionDAGSP = false;
+  bool SupportsSelectionDAGSP =
+    EnableSelectionDAGSP && !TM->Options.EnableFastISel;
   AllocaInst *AI = 0;           // Place on stack that stores the stack guard.
   Value *StackGuardVar = 0;     // The stack guard variable.
 
@@ -398,12 +399,11 @@ bool StackProtector::InsertStackProtecto
 
     if (!HasPrologue) {
       HasPrologue = true;
-      SupportsSelectionDAGSP = CreatePrologue(F, M, RI, TLI, Trip, AI,
-                                              StackGuardVar);
+      SupportsSelectionDAGSP &= CreatePrologue(F, M, RI, TLI, Trip, AI,
+                                               StackGuardVar);
     }
 
-    if (EnableSelectionDAGSP && !TM->Options.EnableFastISel &&
-        SupportsSelectionDAGSP) {
+    if (SupportsSelectionDAGSP) {
       // Since we have a potential tail call, insert the special stack check
       // intrinsic.
       Instruction *InsertionPt = 0;





More information about the llvm-commits mailing list