[llvm] [LAA] refactor sortPtrAccesses (NFC) (PR #92256)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 04:05:07 PDT 2024


================
@@ -1646,22 +1646,19 @@ bool llvm::sortPtrAccesses(ArrayRef<Value *> VL, Type *ElemTy,
 
     // Check if the pointer with the same offset is found.
     int64_t Offset = *Diff;
-    auto Res = Offsets.emplace(Offset, Cnt);
-    if (!Res.second)
+    auto [It, IsInserted] = Offsets.emplace(Offset, Cnt++);
----------------
artagnon wrote:

I didn't know that STLExtras had an `llvm::enumerate()`. Otherwise, the std version is only available in C++23. Fixed now.

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


More information about the llvm-commits mailing list