Summary
find more efficient way to bulk-init locally allocated data
Metadata
- Id: 1551cc693ff2527a57a60f3d7f54e18cc7b2cfae
- Trac id: 436
- Type: task
- Reporter: felix
- Owner: felix
- Cc:
- Status: closed
- Component: compiler
- Estimated difficulty:
- Resolution: wontfix
- Priority: minor
- Milestone:
- Version: 4.6.x
- Changetime: 2010-12-10 09:41:02 UTC
- Created: 2010-11-30 16:04:32 UTC
- Keywords: code generation
Description
For example, `letrec` creates code like this:
C_word t1517;
C_word t1518;
C_word t1519;
C_word ab[2291],*a=ab;
C_check_for_interrupt;
if(!C_stack_probe(&a)){
C_save_and_reclaim((void*)tr2,(void*)f_37706,2,t0,t1);}
t2=C_SCHEME_UNDEFINED;
t3=(*a=C_VECTOR_TYPE|1,a[1]=t2,tmp=(C_word)a,a+=2,tmp);
t4=C_SCHEME_UNDEFINED;
t5=(*a=C_VECTOR_TYPE|1,a[1]=t4,tmp=(C_word)a,a+=2,tmp);
t6=C_SCHEME_UNDEFINED;
t7=(*a=C_VECTOR_TYPE|1,a[1]=t6,tmp=(C_word)a,a+=2,tmp);
t8=C_SCHEME_UNDEFINED;
t9=(*a=C_VECTOR_TYPE|1,a[1]=t8,tmp=(C_word)a,a+=2,tmp);
t10=C_SCHEME_UNDEFINED;
t11=(*a=C_VECTOR_TYPE|1,a[1]=t10,tmp=(C_word)a,a+=2,tmp);
t12=C_SCHEME_UNDEFINED;
t13=(*a=C_VECTOR_TYPE|1,a[1]=t12,tmp=(C_word)a,a+=2,tmp);
t14=C_SCHEME_UNDEFINED;
t15=(*a=C_VECTOR_TYPE|1,a[1]=t14,tmp=(C_word)a,a+=2,tmp);
t16=C_SCHEME_UNDEFINED;
t17=(*a=C_VECTOR_TYPE|1,a[1]=t16,tmp=(C_word)a,a+=2,tmp);
t18=C_SCHEME_UNDEFINED;
One could use local array initializers or so to reduce the amount of code generated.
Changes and comments
[2010-12-10 09:41:02 UTC] felix changed status from new to closed
[2010-12-10 09:41:02 UTC] felix set resolution to wontfix
[2010-12-10 09:41:02 UTC] felix wrote:
Since the compiler has to create the local data anyway, I can't see much improvement by using any other construct.