1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
4 declare float @llvm.amdgcn.fmul.legacy(float, float)
6 define void @test(ptr %p) {
8 ; CHECK-NEXT: store volatile float 6.000000e+00, ptr [[P:%.*]]
9 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
10 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
11 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
12 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
13 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
14 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
15 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
16 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
17 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
18 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
19 ; CHECK-NEXT: ret void
21 %a = call float @llvm.amdgcn.fmul.legacy(float +2.0, float +3.0)
22 store volatile float %a, ptr %p
23 %b = call float @llvm.amdgcn.fmul.legacy(float +2.0, float +0.0)
24 store volatile float %b, ptr %p
25 %c = call float @llvm.amdgcn.fmul.legacy(float +2.0, float -0.0)
26 store volatile float %c, ptr %p
27 %d = call float @llvm.amdgcn.fmul.legacy(float +0.0, float +0.0)
28 store volatile float %d, ptr %p
29 %e = call float @llvm.amdgcn.fmul.legacy(float +0.0, float -0.0)
30 store volatile float %e, ptr %p
31 %f = call float @llvm.amdgcn.fmul.legacy(float -0.0, float +0.0)
32 store volatile float %f, ptr %p
33 %g = call float @llvm.amdgcn.fmul.legacy(float -0.0, float -0.0)
34 store volatile float %g, ptr %p
35 %h = call float @llvm.amdgcn.fmul.legacy(float +0.0, float 0x7ff0000000000000) ; +inf
36 store volatile float %h, ptr %p
37 %i = call float @llvm.amdgcn.fmul.legacy(float 0xfff0000000000000, float +0.0) ; -inf
38 store volatile float %i, ptr %p
39 %j = call float @llvm.amdgcn.fmul.legacy(float 0x7ff0001000000000, float -0.0) ; +nan
40 store volatile float %j, ptr %p
41 %k = call float @llvm.amdgcn.fmul.legacy(float -0.0, float 0xfff0000100000000) ; -nan
42 store volatile float %k, ptr %p