aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2024-04-24 18:40:34 +0200
committerMatt Arsenault <arsenm2@gmail.com>2024-04-24 19:09:34 +0200
commita45eb628779562fac72366f594fbcdc5607b4f8d (patch)
treee8445f058cedefad994960528d0b72e0a530bb45 /llvm/lib
parent8350d9c23d76fb95f42674a1563cbe8c32582dd5 (diff)
downloadllvm-a45eb628779562fac72366f594fbcdc5607b4f8d.tar.gz
llvm-a45eb628779562fac72366f594fbcdc5607b4f8d.tar.bz2
llvm-a45eb628779562fac72366f594fbcdc5607b4f8d.zip
AtomicExpand: Fix dropping a syncscope when bitcasting atomicrmw
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AtomicExpandPass.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp
index 1d80b64896da..f3b8097396e2 100644
--- a/llvm/lib/CodeGen/AtomicExpandPass.cpp
+++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp
@@ -434,8 +434,9 @@ AtomicExpandImpl::convertAtomicXchgToIntegerType(AtomicRMWInst *RMWI) {
? Builder.CreatePtrToInt(Val, NewTy)
: Builder.CreateBitCast(Val, NewTy);
- auto *NewRMWI = Builder.CreateAtomicRMW(
- AtomicRMWInst::Xchg, Addr, NewVal, RMWI->getAlign(), RMWI->getOrdering());
+ auto *NewRMWI = Builder.CreateAtomicRMW(AtomicRMWInst::Xchg, Addr, NewVal,
+ RMWI->getAlign(), RMWI->getOrdering(),
+ RMWI->getSyncScopeID());
NewRMWI->setVolatile(RMWI->isVolatile());
LLVM_DEBUG(dbgs() << "Replaced " << *RMWI << " with " << *NewRMWI << "\n");