[llvm] [DAGCombiner] Freeze maybe poison operands when folding select to logic (PR #84924)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 03:57:13 PDT 2024


================
@@ -23,11 +23,12 @@ define i32 @a() {
 ; CHECK-NEXT:    li 5, 0
 ; CHECK-NEXT:    mr 30, 3
 ; CHECK-NEXT:    addic 6, 4, 6
-; CHECK-NEXT:    addze 5, 5
 ; CHECK-NEXT:    rlwinm 6, 6, 0, 28, 26
-; CHECK-NEXT:    andi. 5, 5, 1
+; CHECK-NEXT:    addze 5, 5
 ; CHECK-NEXT:    cmplw 1, 6, 4
-; CHECK-NEXT:    crorc 20, 1, 4
+; CHECK-NEXT:    andi. 5, 5, 1
+; CHECK-NEXT:    crnot 20, 4
+; CHECK-NEXT:    cror 20, 1, 20
----------------
chenzheng1030 wrote:

```
  t43: i32,ch = load<(dereferenceable load (s32) from @a.b)> t10, t63, undef:i32
  t44: i32,glue = addc t43, Constant:i32<6>
            t46: i32 = and t44, Constant:i32<-17>
          t48: i1 = setcc t46, t43, setuge:ch
        t54: i1 = freeze t48    ;;This freeze breaks the instruction selection pattern for or(setcc) in PPC td files.
      t55: i1 = or t58, t54
```

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


More information about the llvm-commits mailing list