Author: Nathan Gauër
Date: 2026-01-26T12:03:17Z
New Revision: ab8e905bd7ec63bc3269352415e85180e3c5a988

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

LOG: [NFC][HLSL] Remove useless GEP (#177584)

This code was adding a GEP which was constant folded anyway. Removed it.

Added: 
    

Modified: 
    clang/lib/CodeGen/CGHLSLRuntime.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp 
b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index e796bbb5855c8..cff2824d29dc5 100644
--- a/clang/lib/CodeGen/CGHLSLRuntime.cpp
+++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp
@@ -1113,9 +1113,7 @@ static void initializeBuffer(CodeGenModule &CGM, 
llvm::GlobalVariable *GV,
       /*ReturnType=*/HandleTy, IntrID, Args, nullptr,
       Twine(GV->getName()).concat("_h"));
 
-  llvm::Value *HandleRef = Builder.CreateStructGEP(GV->getValueType(), GV, 0);
-  Builder.CreateAlignedStore(CreateHandle, HandleRef,
-                             HandleRef->getPointerAlignment(DL));
+  Builder.CreateAlignedStore(CreateHandle, GV, GV->getPointerAlignment(DL));
   Builder.CreateRetVoid();
 
   CGM.AddCXXGlobalInit(InitResFunc);


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to