[PATCH] D91762: [dfsan] Remove deadcode from DFSanFunction::get*TLS*()

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 21:38:55 PST 2020


stephan.yichao.zhao updated this revision to Diff 306304.
stephan.yichao.zhao added a comment.

update


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91762

Files:
  llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp


Index: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
@@ -362,8 +362,6 @@
   ConstantInt *ShadowPtrMul;
   Constant *ArgTLS;
   Constant *RetvalTLS;
-  FunctionType *GetArgTLSTy;
-  FunctionType *GetRetvalTLSTy;
   Constant *GetArgTLS;
   Constant *GetRetvalTLS;
   Constant *ExternalShadowMask;
@@ -1060,22 +1058,15 @@
 Value *DFSanFunction::getArgTLSPtr() {
   if (ArgTLSPtr)
     return ArgTLSPtr;
-  if (DFS.ArgTLS)
-    return ArgTLSPtr = DFS.ArgTLS;
-
-  IRBuilder<> IRB(&F->getEntryBlock().front());
-  return ArgTLSPtr = IRB.CreateCall(DFS.GetArgTLSTy, DFS.GetArgTLS, {});
+  assert(DFS.ArgTLS);
+  return ArgTLSPtr = DFS.ArgTLS;
 }
 
 Value *DFSanFunction::getRetvalTLS() {
   if (RetvalTLSPtr)
     return RetvalTLSPtr;
-  if (DFS.RetvalTLS)
-    return RetvalTLSPtr = DFS.RetvalTLS;
-
-  IRBuilder<> IRB(&F->getEntryBlock().front());
-  return RetvalTLSPtr =
-             IRB.CreateCall(DFS.GetRetvalTLSTy, DFS.GetRetvalTLS, {});
+  assert(DFS.RetvalTLS);
+  return RetvalTLSPtr = DFS.RetvalTLS;
 }
 
 Value *DFSanFunction::getArgTLS(unsigned Idx, Instruction *Pos) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91762.306304.patch
Type: text/x-patch
Size: 1283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201119/d2ab413c/attachment.bin>


More information about the llvm-commits mailing list