[llvm] 855be5f - [ShadowStackGCLowering] Remove unnecessary zero-index GEP

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 13 06:34:11 PST 2026


Author: Nikita Popov
Date: 2026-02-13T15:34:01+01:00
New Revision: 855be5f2fbb57ba66a0d5a14e8d87b0eab523b60

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

LOG: [ShadowStackGCLowering] Remove unnecessary zero-index GEP

This is a no-op.

Added: 
    

Modified: 
    llvm/lib/CodeGen/ShadowStackGCLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/ShadowStackGCLowering.cpp b/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
index 6097468626e0a..000d6d842c6be 100644
--- a/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
+++ b/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
@@ -187,14 +187,9 @@ Constant *ShadowStackGCLoweringImpl::GetFrameMap(Function &F) {
   //        to be a ModulePass (which means it cannot be in the 'llc' pipeline
   //        (which uses a FunctionPassManager (which segfaults (not asserts) if
   //        provided a ModulePass))).
-  Constant *GV = new GlobalVariable(*F.getParent(), FrameMap->getType(), true,
+  return new GlobalVariable(*F.getParent(), FrameMap->getType(), true,
                                     GlobalVariable::InternalLinkage, FrameMap,
                                     "__gc_" + F.getName());
-
-  Constant *GEPIndices[2] = {
-      ConstantInt::get(Type::getInt32Ty(F.getContext()), 0),
-      ConstantInt::get(Type::getInt32Ty(F.getContext()), 0)};
-  return ConstantExpr::getGetElementPtr(FrameMap->getType(), GV, GEPIndices);
 }
 
 Type *ShadowStackGCLoweringImpl::GetConcreteStackEntryType(Function &F) {


        


More information about the llvm-commits mailing list