[llvm] f92d970 - [llvm][SanitizerCoverage] Remove no-op 'ptr addrspace(0)' to 'ptr addrspace(0)' pointercast (NFC)

Youngsuk Kim via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 09:59:18 PST 2023


Author: Youngsuk Kim
Date: 2023-12-11T11:56:49-06:00
New Revision: f92d970c8cc27747478abb7df66bb8b6701cea49

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

LOG: [llvm][SanitizerCoverage] Remove no-op 'ptr addrspace(0)' to 'ptr addrspace(0)' pointercast (NFC)

Opaque ptr cleanup effort.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 90668766351912..fe672a4377a1f4 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -329,8 +329,7 @@ ModuleSanitizerCoverage::CreateSecStartEnd(Module &M, const char *Section,
 
   // Account for the fact that on windows-msvc __start_* symbols actually
   // point to a uint64_t before the start of the array.
-  auto SecStartI8Ptr = IRB.CreatePointerCast(SecStart, PtrTy);
-  auto GEP = IRB.CreateGEP(Int8Ty, SecStartI8Ptr,
+  auto GEP = IRB.CreateGEP(Int8Ty, SecStart,
                            ConstantInt::get(IntptrTy, sizeof(uint64_t)));
   return std::make_pair(GEP, SecEnd);
 }
@@ -838,8 +837,7 @@ void ModuleSanitizerCoverage::InjectTraceForSwitch(
           *CurModule, ArrayOfInt64Ty, false, GlobalVariable::InternalLinkage,
           ConstantArray::get(ArrayOfInt64Ty, Initializers),
           "__sancov_gen_cov_switch_values");
-      IRB.CreateCall(SanCovTraceSwitchFunction,
-                     {Cond, IRB.CreatePointerCast(GV, PtrTy)});
+      IRB.CreateCall(SanCovTraceSwitchFunction, {Cond, GV});
     }
   }
 }


        


More information about the llvm-commits mailing list