OLD | NEW |
1 ; RUN: opt < %s -instcombine -S | FileCheck %s | 1 ; RUN: opt < %s -instcombine -S | FileCheck %s |
2 | 2 |
3 ;; Target triple for gep raising case below. | 3 ;; Target triple for gep raising case below. |
4 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
2:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" | 4 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
2:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" |
5 target triple = "i686-apple-darwin8" | 5 target triple = "i686-apple-darwin8" |
6 | 6 |
7 define float @test1(float %A, float %B, i1 %C) { | 7 define float @test1(float %A, float %B, i1 %C) { |
8 EntryBlock: | 8 EntryBlock: |
9 ;; A*(1 - uitofp i1 C) -> select C, 0, A | 9 ;; A*(1 - uitofp i1 C) -> select C, 0, A |
10 %cf = uitofp i1 %C to float | 10 %cf = uitofp i1 %C to float |
(...skipping 20 matching lines...) Expand all Loading... |
31 %cf = uitofp i1 %C to float | 31 %cf = uitofp i1 %C to float |
32 %mc = fsub float 1.000000e+00, %cf | 32 %mc = fsub float 1.000000e+00, %cf |
33 %p1 = fmul fast float %A, %mc | 33 %p1 = fmul fast float %A, %mc |
34 %p2 = fmul fast float %B, %cf | 34 %p2 = fmul fast float %B, %cf |
35 %s1 = fadd fast float %p1, %p2 | 35 %s1 = fadd fast float %p1, %p2 |
36 ret float %s1 | 36 ret float %s1 |
37 ; CHECK: @test3 | 37 ; CHECK: @test3 |
38 ; CHECK: select i1 %C, float %B, float %A | 38 ; CHECK: select i1 %C, float %B, float %A |
39 } | 39 } |
40 | 40 |
41 ; PR15952 | |
42 define float @test4(float %A, float %B, i32 %C) { | |
43 %cf = uitofp i32 %C to float | |
44 %mc = fsub float 1.000000e+00, %cf | |
45 %p1 = fmul fast float %A, %mc | |
46 ret float %p1 | |
47 ; CHECK: @test4 | |
48 ; CHECK: uitofp | |
49 } | |
50 | |
51 define float @test5(float %A, float %B, i32 %C) { | |
52 %cf = uitofp i32 %C to float | |
53 %p2 = fmul fast float %B, %cf | |
54 ret float %p2 | |
55 ; CHECK: @test5 | |
56 ; CHECK: uitofp | |
57 } | |
58 | |
OLD | NEW |