[llvm-branch-commits] [llvm] [AtomicExpand] Add bitcasts when expanding load atomic vector (PR #148900)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Oct 31 22:52:29 PDT 2025


================
@@ -483,7 +483,12 @@ LoadInst *AtomicExpandImpl::convertAtomicLoadToIntegerType(LoadInst *LI) {
   NewLI->setAtomic(LI->getOrdering(), LI->getSyncScopeID());
   LLVM_DEBUG(dbgs() << "Replaced " << *LI << " with " << *NewLI << "\n");
 
-  Value *NewVal = Builder.CreateBitCast(NewLI, LI->getType());
+  Value *NewVal =
+      LI->getType()->isPointerTy() ||
+              (LI->getType()->isVectorTy() &&
+               cast<VectorType>(LI->getType())->getElementType()->isPointerTy())
----------------
arsenm wrote:

```suggestion
      LI->getType()->isPtrOrPtrVectorTy()
```

https://github.com/llvm/llvm-project/pull/148900


More information about the llvm-branch-commits mailing list