Issue 63896
Summary Failure to optimize based on umax implication
Labels llvm:optimizations, missed-optimization
Assignees
Reporter nikic
    https://alive2.llvm.org/ce/z/o_8ch3
```llvm
define i1 @src(i8 %x, i8 %y) {
  %max = call i8 @llvm.umax.i8(i8 %x, i8 1)
 %cmp = icmp ugt i8 %y, %max
  br i1 %cmp, label %if, label %end

if:
  %cmp2 = icmp ugt i8 %y, %x
  ret i1 %cmp2

end:
  ret i1 false
}

define i1 @tgt(i8 %x, i8 %y) {
  %max = call i8 @llvm.umax.i8(i8 %x, i8 1)
  %cmp = icmp ugt i8 %y, %max
  br i1 %cmp, label %if, label %end

if:
  ret i1 true

end:
  ret i1 false
}

declare i8 @llvm.umax.i8(i8, i8)
```

This might be either for ConstraintElimination or InstCombine.

For the case where `icmp ugt i8 %y, 1` is used, CVP/LVI could also handle this.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to