[llvm] [IR] allow vector atomicrmw xchg (PR #208510)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 9 10:48:12 PDT 2026
================
@@ -4661,20 +4661,20 @@ void Verifier::visitAtomicRMWInst(AtomicRMWInst &RMWI) {
"atomicrmw instructions cannot be unordered.", &RMWI);
auto Op = RMWI.getOperation();
Type *ElTy = RMWI.getOperand(1)->getType();
- Type *ScalarTy = ElTy;
if (RMWI.isElementwise()) {
auto *VecTy = dyn_cast<FixedVectorType>(ElTy);
Check(VecTy, "atomicrmw elementwise operand must have fixed vector type!",
&RMWI, ElTy);
- if (VecTy)
- ScalarTy = VecTy->getElementType();
}
if (Op == AtomicRMWInst::Xchg) {
- Check(ScalarTy->isIntegerTy() || ScalarTy->isFloatingPointTy() ||
- ScalarTy->isPointerTy(),
+ Check((ElTy->isIntOrIntVectorTy() || ElTy->isFPOrFPVectorTy() ||
+ ElTy->isPtrOrPtrVectorTy()) &&
+ !isa<ScalableVectorType>(ElTy),
----------------
antoniofrighetto wrote:
```suggestion
isa<FixedVectorType>(ElTy),
```
https://github.com/llvm/llvm-project/pull/208510
More information about the llvm-commits
mailing list