1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[InstCombine] add fneg variation of shuffle-binop fold; NFC

If the fsub in this pattern was replaced by an actual fneg
instruction, we would need to add a fold to recognize that
because fneg would not be a binop.

llvm-svn: 343041
This commit is contained in:
Sanjay Patel 2018-09-25 22:48:58 +00:00
parent 1e204ff173
commit 4db9800f13

View File

@ -913,6 +913,17 @@ define <2 x float> @fsub_splat_constant1(<2 x float> %x) {
ret <2 x float> %r ret <2 x float> %r
} }
define <2 x float> @fneg(<2 x float> %x) {
; CHECK-LABEL: @fneg(
; CHECK-NEXT: [[TMP1:%.*]] = fsub <2 x float> <float -0.000000e+00, float undef>, [[X:%.*]]
; CHECK-NEXT: [[R:%.*]] = shufflevector <2 x float> [[TMP1]], <2 x float> undef, <2 x i32> zeroinitializer
; CHECK-NEXT: ret <2 x float> [[R]]
;
%splat = shufflevector <2 x float> %x, <2 x float> undef, <2 x i32> zeroinitializer
%r = fsub <2 x float> <float -0.0, float -0.0>, %splat
ret <2 x float> %r
}
define <2 x float> @fmul_splat_constant(<2 x float> %x) { define <2 x float> @fmul_splat_constant(<2 x float> %x) {
; CHECK-LABEL: @fmul_splat_constant( ; CHECK-LABEL: @fmul_splat_constant(
; CHECK-NEXT: [[TMP1:%.*]] = fmul <2 x float> [[X:%.*]], <float 4.200000e+01, float undef> ; CHECK-NEXT: [[TMP1:%.*]] = fmul <2 x float> [[X:%.*]], <float 4.200000e+01, float undef>