[llvm] LLVMContext: add getSyncScopeName() to lookup individual scope name (PR #109484)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 03:20:29 PDT 2024
================
@@ -16142,11 +16142,8 @@ static bool atomicIgnoresDenormalModeOrFPModeIsFTZ(const AtomicRMWInst *RMW) {
static OptimizationRemark emitAtomicRMWLegalRemark(const AtomicRMWInst *RMW) {
LLVMContext &Ctx = RMW->getContext();
- SmallVector<StringRef> SSNs;
- Ctx.getSyncScopeNames(SSNs);
- StringRef MemScope = SSNs[RMW->getSyncScopeID()].empty()
- ? "system"
- : SSNs[RMW->getSyncScopeID()];
+ StringRef SS = Ctx.getSyncScopeName(RMW->getSyncScopeID()).value_or("");
+ StringRef MemScope = SS.empty() ? StringRef("system") : SS;
----------------
arsenm wrote:
```suggestion
StringRef MemScopeName = Ctx.getSyncScopeName(RMW->getSyncScopeID()).value_or("system");
```
https://github.com/llvm/llvm-project/pull/109484
More information about the llvm-commits
mailing list