Displaying 6 results from an estimated 6 matches for "forinc".
2009 Jan 08
2
[LLVMdev] Loop elimination with floating point counter.
...floating point counter using
LLVM, but the following loop wasn't optimized by opt.
void
func() {
float i;
for (i = 0.0f; i < 1000.0f; i += 1.2f) {
}
}
$ clang -emit-llvm-bc floop.c
$ opt -std-compile-opts floop.bc | llvm-dis
define void @func(...) nounwind {
entry:
br label %forinc
forinc: ; preds = %forinc, %entry
%i.0.reg2mem.0 = phi float [ 0.000000e+00, %entry ], [ %add, %forinc
] ; <float> [#uses=1]
%add = add float %i.0.reg2mem.0, 0x3FF3333340000000 ; <float> [#uses=2]
%cmp = fcmp olt float %add, 1.000000e+03 ; <i1> [#uses=1]
br i1 %cmp, label...
2009 Jan 08
0
[LLVMdev] Loop elimination with floating point counter.
...}
> }
FWIW, LLVM optimizer can eliminate this loop if i is incremented by 1.0f
Pl. file a bugzilla report.
Thanks,
-
Devang
>
>
> $ clang -emit-llvm-bc floop.c
> $ opt -std-compile-opts floop.bc | llvm-dis
>
> define void @func(...) nounwind {
> entry:
> br label %forinc
>
> forinc: ; preds = %forinc, %entry
> %i.0.reg2mem.0 = phi float [ 0.000000e+00, %entry ], [ %add, %forinc
> ] ; <float> [#uses=1]
> %add = add float %i.0.reg2mem.0, 0x3FF3333340000000 ; <float>
> [#uses=2]
> %cmp = fcmp olt float %add, 1.000000e+03 ; <...
2009 Jan 08
2
[LLVMdev] Loop elimination with floating point counter.
...i is incremented by 1.0f
>
> Pl. file a bugzilla report.
> Thanks,
> -
> Devang
>>
>>
>> $ clang -emit-llvm-bc floop.c
>> $ opt -std-compile-opts floop.bc | llvm-dis
>>
>> define void @func(...) nounwind {
>> entry:
>> br label %forinc
>>
>> forinc: ; preds = %forinc, %entry
>> %i.0.reg2mem.0 = phi float [ 0.000000e+00, %entry ], [ %add, %forinc
>> ] ; <float> [#uses=1]
>> %add = add float %i.0.reg2mem.0, 0x3FF3333340000000 ; <float>
>> [#us...
2009 Jan 08
0
[LLVMdev] Loop elimination with floating point counter.
...e a bugzilla report.
>> Thanks,
>> -
>> Devang
>>>
>>>
>>> $ clang -emit-llvm-bc floop.c
>>> $ opt -std-compile-opts floop.bc | llvm-dis
>>>
>>> define void @func(...) nounwind {
>>> entry:
>>> br label %forinc
>>>
>>> forinc: ; preds = %forinc, %entry
>>> %i.0.reg2mem.0 = phi float [ 0.000000e+00, %entry ], [ %add,
>>> %forinc
>>> ] ; <float> [#uses=1]
>>> %add = add float %i.0.reg2mem.0,
>>> 0x3FF3333340...
2008 Mar 31
5
[LLVMdev] Additional Optimization I'm Missing?
...OS_start
store double 1.000000e+00, double* %OS_timestep
store double 3.000000e-01, double* %birth_rate
store double 3.000000e+01, double* %population
%OS_start1 = load double* %OS_start ; <double> [#uses=1]
store double %OS_start1, double* %time
br label %forcond
forcond: ; preds = %forinc, %entry
%time2 = load double* %time ; <double> [#uses=1]
%OS_end3 = load double* %OS_end ; <double> [#uses=1]
%forcond4 = fcmp olt double %time2, %OS_end3 ; <i1> [#uses=1]
br i1 %forcond4, label %forbody, label %forafter
forbody: ; preds = %forcond
%birth_rate5 = load do...
2008 Jul 21
6
[LLVMdev] LICM/store-aliasing of global loads
...duling issues and is
difficult to do in general due to some additional semantics in our
frontend.
Thanks!
Stefanus
=== Example ===
@b = external constant float*
@a = external constant float*
define void @test(i32 %count) {
entry:
br label %forcond
forcond: ; preds = %forinc, %entry
%i.0 = phi i32 [ 0, %entry ], [ %inc, %forinc ] ;
<i32> [#uses=4]
%cmp = icmp ult i32 %i.0, %count ; <i1> [#uses=1]
br i1 %cmp, label %forbody, label %afterfor
forbody: ; preds = %forcond
%tmp3 = load float...