[llvm] [InstCombine] Allow simplifying FP selects of cmpxchg instructions. (PR #181977)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 18 06:59:06 PST 2026


================
@@ -2773,6 +2783,17 @@ static Value *foldSelectCmpXchg(SelectInst &SI) {
     return dyn_cast<AtomicCmpXchgInst>(Extract->getAggregateOperand());
   };
 
+  // Check if the compare value of a cmpxchg matches another value.
+  auto isCompareSameAsValue = [](Value *C, Value *V) {
----------------
antoniofrighetto wrote:

Nit on naming:
```suggestion
  auto isCompareSameAsValue = [](Value *CmpVal, Value *SelVal) {
```

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


More information about the llvm-commits mailing list