This adds more poison folding optimizations to InstSimplify. Since all binary operators propagate poison, these are fine. Also, the precondition of `select cond, undef, x` -> `x` is relaxed to allow the case when `x` is undef. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D104661
19 lines
394 B
LLVM
19 lines
394 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -instsimplify -S | FileCheck %s
|
|
|
|
define i1 @poison(float %x) {
|
|
; CHECK-LABEL: @poison(
|
|
; CHECK-NEXT: ret i1 poison
|
|
;
|
|
%v = fcmp oeq float %x, poison
|
|
ret i1 %v
|
|
}
|
|
|
|
define i1 @poison2(float %x) {
|
|
; CHECK-LABEL: @poison2(
|
|
; CHECK-NEXT: ret i1 poison
|
|
;
|
|
%v = fcmp ueq float %x, poison
|
|
ret i1 %v
|
|
}
|