Issue 131824
Summary InstCombine misses freeze of i1 select fold which appears in X86ISelLowering
Labels llvm:instcombine, missed-optimization
Assignees
Reporter arsenm
    ```

define i1 @src(i8 range(i8 0, 2) noundef %i, i8 range(i8 0, 2) noundef %i1) {
bb:
 %loadedv.i.i2.i = trunc nuw i8 %i to i1
  %loadedv.i1.i.i = trunc nuw i8 %i1 to i1
  %i2 = select i1 %loadedv.i.i2.i, i1 %loadedv.i1.i.i, i1 false
 %cond.fr13 = freeze i1 %i2
  ret i1 %cond.fr13
}

define i1 @tgt(i8 range(i8 0, 2) noundef %i, i8 range(i8 0, 2) noundef %i1) {
bb:
  %i21 = and i8 %i1, %i
  %i2 = trunc nuw i8 %i21 to i1
  ret i1 %i2
}

```

https://alive2.llvm.org/ce/z/HRpvwJ

I noticed this while looking at random IR samples in X86ISelLowering.cpp's output. 
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to