Displaying 3 results from an estimated 3 matches for "ceil32".
Did you mean:
ceil
2017 Jun 19
4
LLVM behavior different depending on function symbol name
...nounwind
define internal fastcc float @ceil(float) unnamed_addr #3 !dbg !644 {
Entry:
%x = alloca float, align 4
store float %0, float* %x
call void @llvm.dbg.declare(metadata float* %x, metadata !649, metadata
!494), !dbg !651
%1 = load float, float* %x, !dbg !652
%2 = call fastcc float @ceil32(float %1) #8, !dbg !656
ret float %2, !dbg !657
}
Test case:
test "math.ceil" {
assert(ceil(f32(0.0)) == ceil32(0.0));
assert(ceil(f64(0.0)) == ceil64(0.0));
}
When I compile with optimizations on, this test case fails. The optimized
code for the test case ends up being a ca...
2017 Jun 19
2
LLVM behavior different depending on function symbol name
...#3 !dbg !644 {
>> Entry:
>> %x = alloca float, align 4
>> store float %0, float* %x
>> call void @llvm.dbg.declare(metadata float* %x, metadata !649, metadata
>> !494), !dbg !651
>> %1 = load float, float* %x, !dbg !652
>> %2 = call fastcc float @ceil32(float %1) #8, !dbg !656
>> ret float %2, !dbg !657
>> }
>>
>> Test case:
>>
>> test "math.ceil" {
>> assert(ceil(f32(0.0)) == ceil32(0.0));
>> assert(ceil(f64(0.0)) == ceil64(0.0));
>> }
>>
>>
>> When I comp...
2017 Jun 19
2
LLVM behavior different depending on function symbol name
using `opt --print-after-all -O3` I see that EarlyCSE is interpreting the
call to `ceil` and constant fold:
*** IR Dump After Early CSE ***
; Function Attrs: nobuiltin nounwind
define i1 @do_test() #2 {
Entry:
%0 = call fastcc float @ceil(float 0.000000e+00) #6
%1 = call fastcc float @ceil32(float 0.000000e+00) #6
%2 = fcmp fast oeq float 0.000000e+00, %1
ret i1 %2
}
So just running `opt -early-cse -debug` seems enough:
EarlyCSE Simplify: %0 = call fastcc float @ceil(float 0.000000e+00) #6
to: float 0.000000e+00
I suspect it is not correct from EarlyCSE to do that.
--
Mehdi...