2018-03-08 23:46:38 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
2010-01-17 08:21:21 +08:00
|
|
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
|
|
|
|
|
|
|
; PR4374
|
2018-03-08 23:46:38 +08:00
|
|
|
|
2010-01-17 08:21:21 +08:00
|
|
|
define float @test1(float %a, float %b) nounwind {
|
2018-03-08 23:46:38 +08:00
|
|
|
; CHECK-LABEL: @test1(
|
|
|
|
; CHECK-NEXT: [[T1:%.*]] = fsub float [[A:%.*]], [[B:%.*]]
|
|
|
|
; CHECK-NEXT: [[T2:%.*]] = fsub float -0.000000e+00, [[T1]]
|
|
|
|
; CHECK-NEXT: ret float [[T2]]
|
|
|
|
;
|
2010-01-17 08:21:21 +08:00
|
|
|
%t1 = fsub float %a, %b
|
|
|
|
%t2 = fsub float -0.000000e+00, %t1
|
|
|
|
ret float %t2
|
|
|
|
}
|
|
|
|
|
|
|
|
; <rdar://problem/7530098>
|
2018-03-08 23:46:38 +08:00
|
|
|
|
2010-01-17 08:21:21 +08:00
|
|
|
define double @test2(double %x, double %y) nounwind {
|
2018-03-08 23:46:38 +08:00
|
|
|
; CHECK-LABEL: @test2(
|
|
|
|
; CHECK-NEXT: [[T1:%.*]] = fadd double [[X:%.*]], [[Y:%.*]]
|
|
|
|
; CHECK-NEXT: [[T2:%.*]] = fsub double [[X]], [[T1]]
|
|
|
|
; CHECK-NEXT: ret double [[T2]]
|
|
|
|
;
|
2010-01-17 08:21:21 +08:00
|
|
|
%t1 = fadd double %x, %y
|
|
|
|
%t2 = fsub double %x, %t1
|
|
|
|
ret double %t2
|
|
|
|
}
|
2017-04-25 01:24:37 +08:00
|
|
|
|