mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[InstSimplify] add tests for FP with undef operand; NFC
Are any of these correct? llvm-svn: 326241
This commit is contained in:
parent
dead908059
commit
5a4c6b79aa
@ -17,24 +17,6 @@ define float @frem_constant_fold() {
|
||||
ret float %f
|
||||
}
|
||||
|
||||
define double @fdiv_of_undef(double %X) {
|
||||
; CHECK-LABEL: @fdiv_of_undef(
|
||||
; CHECK-NEXT: ret double undef
|
||||
;
|
||||
; undef / X -> undef
|
||||
%r = fdiv double undef, %X
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @fdiv_by_undef(double %X) {
|
||||
; CHECK-LABEL: @fdiv_by_undef(
|
||||
; CHECK-NEXT: ret double undef
|
||||
;
|
||||
; X / undef -> undef
|
||||
%r = fdiv double %X, undef
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define double @fmul_fdiv_common_operand(double %x, double %y) {
|
||||
; CHECK-LABEL: @fmul_fdiv_common_operand(
|
||||
; CHECK-NEXT: ret double %x
|
||||
|
89
test/Transforms/InstSimplify/fp-undef.ll
Normal file
89
test/Transforms/InstSimplify/fp-undef.ll
Normal file
@ -0,0 +1,89 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -instsimplify -S | FileCheck %s
|
||||
|
||||
define float @fadd_undef_op0(float %x) {
|
||||
; CHECK-LABEL: @fadd_undef_op0(
|
||||
; CHECK-NEXT: [[R:%.*]] = fadd float undef, [[X:%.*]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%r = fadd float undef, %x
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fadd_undef_op1(float %x) {
|
||||
; CHECK-LABEL: @fadd_undef_op1(
|
||||
; CHECK-NEXT: [[R:%.*]] = fadd float [[X:%.*]], undef
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%r = fadd float %x, undef
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fsub_undef_op0(float %x) {
|
||||
; CHECK-LABEL: @fsub_undef_op0(
|
||||
; CHECK-NEXT: [[R:%.*]] = fsub float undef, [[X:%.*]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%r = fsub float undef, %x
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fsub_undef_op1(float %x) {
|
||||
; CHECK-LABEL: @fsub_undef_op1(
|
||||
; CHECK-NEXT: [[R:%.*]] = fsub float [[X:%.*]], undef
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%r = fsub float %x, undef
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fmul_undef_op0(float %x) {
|
||||
; CHECK-LABEL: @fmul_undef_op0(
|
||||
; CHECK-NEXT: [[R:%.*]] = fmul float undef, [[X:%.*]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%r = fmul float undef, %x
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fmul_undef_op1(float %x) {
|
||||
; CHECK-LABEL: @fmul_undef_op1(
|
||||
; CHECK-NEXT: [[R:%.*]] = fmul float [[X:%.*]], undef
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%r = fmul float %x, undef
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fdiv_undef_op0(float %x) {
|
||||
; CHECK-LABEL: @fdiv_undef_op0(
|
||||
; CHECK-NEXT: ret float undef
|
||||
;
|
||||
%r = fdiv float undef, %x
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @fdiv_undef_op1(float %x) {
|
||||
; CHECK-LABEL: @fdiv_undef_op1(
|
||||
; CHECK-NEXT: ret float undef
|
||||
;
|
||||
%r = fdiv float %x, undef
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @frem_undef_op0(float %x) {
|
||||
; CHECK-LABEL: @frem_undef_op0(
|
||||
; CHECK-NEXT: ret float undef
|
||||
;
|
||||
%r = frem float undef, %x
|
||||
ret float %r
|
||||
}
|
||||
|
||||
define float @frem_undef_op1(float %x) {
|
||||
; CHECK-LABEL: @frem_undef_op1(
|
||||
; CHECK-NEXT: ret float undef
|
||||
;
|
||||
%r = frem float %x, undef
|
||||
ret float %r
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user