diff options
author | Michael Gottesman <mgottesman@apple.com> | 2013-08-20 08:56:26 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2013-08-20 08:56:26 +0000 |
commit | d4f478899e6229648f94c4aa70256986cdc6ee18 (patch) | |
tree | 0179001f855f75bb351501284773c1be70d30dc8 /lib | |
parent | b99272a521ecffe8d021306713bd51fafc85721e (diff) | |
download | external_llvm-d4f478899e6229648f94c4aa70256986cdc6ee18.zip external_llvm-d4f478899e6229648f94c4aa70256986cdc6ee18.tar.gz external_llvm-d4f478899e6229648f94c4aa70256986cdc6ee18.tar.bz2 |
[stackprotector] Small Bit of computation hoisting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188771 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/StackProtector.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp index 2cd2219..86ca53d 100644 --- a/lib/CodeGen/StackProtector.cpp +++ b/lib/CodeGen/StackProtector.cpp @@ -387,7 +387,8 @@ static bool CreatePrologue(Function *F, Module *M, ReturnInst *RI, /// 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::InsertStackProtectors() { 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; |