[llvm] 7af5b68 - [DFSan] Directly create gep inbounds for arg origin tls (NFCI)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 07:01:44 PDT 2024


Author: Nikita Popov
Date: 2024-05-29T16:01:37+02:00
New Revision: 7af5b68a03bb7f5090a96b3f9f9a34f0e196e466

URL: https://github.com/llvm/llvm-project/commit/7af5b68a03bb7f5090a96b3f9f9a34f0e196e466
DIFF: https://github.com/llvm/llvm-project/commit/7af5b68a03bb7f5090a96b3f9f9a34f0e196e466.diff

LOG: [DFSan] Directly create gep inbounds for arg origin tls (NFCI)

Calling code explicitly checks that ArgNo is inbounds. NFCI
because constant expression creation already infers it, this just
makes it explicit.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
index 20d11e0ab55f2..f0b0917a25938 100644
--- a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
@@ -1804,8 +1804,8 @@ Value *DFSanFunction::getRetvalTLS(Type *T, IRBuilder<> &IRB) {
 Value *DFSanFunction::getRetvalOriginTLS() { return DFS.RetvalOriginTLS; }
 
 Value *DFSanFunction::getArgOriginTLS(unsigned ArgNo, IRBuilder<> &IRB) {
-  return IRB.CreateConstGEP2_64(DFS.ArgOriginTLSTy, DFS.ArgOriginTLS, 0, ArgNo,
-                                "_dfsarg_o");
+  return IRB.CreateConstInBoundsGEP2_64(DFS.ArgOriginTLSTy, DFS.ArgOriginTLS, 0,
+                                        ArgNo, "_dfsarg_o");
 }
 
 Value *DFSanFunction::getOrigin(Value *V) {


        


More information about the llvm-commits mailing list