[PATCH] D84620: [StackProtector] Speed up RequiresStackProtector

Nadav Rotem via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 10:14:16 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGdf880b77302d: [StackProtector] Speed up RequiresStackProtector (authored by nadav).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84620/new/

https://reviews.llvm.org/D84620

Files:
  llvm/lib/CodeGen/StackProtector.cpp


Index: llvm/lib/CodeGen/StackProtector.cpp
===================================================================
--- llvm/lib/CodeGen/StackProtector.cpp
+++ llvm/lib/CodeGen/StackProtector.cpp
@@ -251,10 +251,9 @@
 static const CallInst *findStackProtectorIntrinsic(Function &F) {
   for (const BasicBlock &BB : F)
     for (const Instruction &I : BB)
-      if (const CallInst *CI = dyn_cast<CallInst>(&I))
-        if (CI->getCalledFunction() ==
-            Intrinsic::getDeclaration(F.getParent(), Intrinsic::stackprotector))
-          return CI;
+      if (const auto *II = dyn_cast<IntrinsicInst>(&I))
+        if (II->getIntrinsicID() == Intrinsic::stackprotector)
+          return II;
   return nullptr;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84620.280964.patch
Type: text/x-patch
Size: 717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200727/824fad43/attachment.bin>


More information about the llvm-commits mailing list