[llvm] [AtomicExpandPass] Improve atomic expand error messages (PR #188380)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 02:33:14 PDT 2026


================
@@ -1934,7 +1975,10 @@ void AtomicExpandImpl::expandAtomicRMWToLibcall(AtomicRMWInst *I) {
           NewLoaded = Builder.CreateExtractValue(Pair, 0, "newloaded");
 
           // ...and then expand the CAS into a libcall.
-          expandAtomicCASToLibcall(Pair);
+          expandAtomicCASToLibcall(Pair,
+                                   Twine("atomicrmw ") +
+                                       I->getOperationName(I->getOperation()),
+                                   MetadataSrc);
----------------
antoniofrighetto wrote:

Nit: operator+ already gives you a temporary Twine which binds to `const Twine &`.
```suggestion
          expandAtomicCASToLibcall(
              Pair,
              "atomicrmw " + AtomicRMWInst::getOperationName(I->getOperation()),
              MetadataSrc);
```

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


More information about the llvm-commits mailing list