[llvm] f9b2cbf - InstCombine: Drop some typed pointer handling

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 13:55:21 PDT 2023


Author: Matt Arsenault
Date: 2023-07-31T16:55:16-04:00
New Revision: f9b2cbfffa68bc26a0255625bd4fe76c2abe9061

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

LOG: InstCombine: Drop some typed pointer handling

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 7be077162c15ef..c69098299c91a5 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -601,13 +601,11 @@ static StoreInst *combineStoreToNewValue(InstCombinerImpl &IC, StoreInst &SI,
          "can't fold an atomic store of requested type");
 
   Value *Ptr = SI.getPointerOperand();
-  unsigned AS = SI.getPointerAddressSpace();
   SmallVector<std::pair<unsigned, MDNode *>, 8> MD;
   SI.getAllMetadata(MD);
 
-  StoreInst *NewStore = IC.Builder.CreateAlignedStore(
-      V, IC.Builder.CreateBitCast(Ptr, V->getType()->getPointerTo(AS)),
-      SI.getAlign(), SI.isVolatile());
+  StoreInst *NewStore =
+      IC.Builder.CreateAlignedStore(V, Ptr, SI.getAlign(), SI.isVolatile());
   NewStore->setAtomic(SI.getOrdering(), SI.getSyncScopeID());
   for (const auto &MDPair : MD) {
     unsigned ID = MDPair.first;


        


More information about the llvm-commits mailing list