This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: DF_DU_CHAIN | DF_UD_CHAIN flags in new-ra


Hi,

I have been investigating the def-use chain inconsistency. The def-use
chains are built from the Reaching Use Information. I have certain doubts
about Reaching Use information seeing its dumps form the lreg file.
For example, consider the following Reaching use info generated for a basic
block (generated for new-regalloc).

Reaching uses:
...

bb 0 in         0, 33, 35, 39, 51
bb 0 gen        0
bb 0 kill       2, 4, 7, 9, 14, 15, 17, 19, 20, 22, 27, 29, 34, 42, 44, 50,
54, 58, 61, 64, 65, 66, 68, 69, 70, 71
bb 0 out        2, 4, 7, 9, 14, 15, 17, 19, 20, 22, 27, 29, 33, 34, 35, 39,
42, 44, 50, 51, 54, 58, 61, 64, 65, 68, 69, 71

How can we interpret this information.
o For bb 0 which is the entry point and has no predecessor blocks, how do we
say that there is an "in" set?
o As we understand, 

(i set in "out" chain ~ out(i) )
	out(i) => ( in(i) && !kill(i) )
		    || ( gen(i) && !kill(i) )
		    || ( !in(i) && !gen(i) && kill(i))
		    || ( in(i) && gen(i) && kill(i) )   

 Is this interpretation correct?
		
 If we go by this interpretation, we can verify all the values in "out"
chain (except for 70 appearing in kill and not in use).

 Please note that "out" chain is used to construct def-use chain. 

 Any Comments ?

Thanks,
Mukta 

>
>>> d1	def r161
>>> u11	use r161
>>> u12	use r161
>>> 	...
>>> d2	def r161
>>> u21	use r161
>>
>>> In this case, use-def chain for r161 will be consisting of 
>>{d1,d2}. In case
>>
>>The _reg_-def chain will contain both defs.  But the def-use 
>>chains will
>>look like:
>>  [d1] --> {u11,u12}
>>  [d2] --> {u21}
>
>Definitely so.
>
>>So df_ref_unlink is only called on those chains, where the 
>>use-def chain
>>of u12 pointed to a def.  I.e. if the use-def chain of u12 contains d,
>>then the def-use chain of d has to contain u12.  And this is the
>>consistency what the abort is testing.
>
>OK, the abort seems to check this consistency, and in fact it 
>looks like the def-use chains are actually inconsistent.
>i.e as pointed out..
>>if the use-def chain of u12 contains d, then the def-use 
>chain of d has to contain u12
>
>This is not happening.
>Pls see the attached .lreg file for the def-use/use-def chain 
>dump in this case. (Pls refer <-- HERE ponters in the lreg file)
>I am also attaching the advdomestic.i file which was compiled 
>with -ml -m4 -fnew-ra -O2. (compiled for target sh-elf)
>
>>
>>Somehow this invariant was mixed up.  Try to find what use is 
>>trying to be
>>deleted, and why it is tried to be deleted from a def-use chain which
>>didn't contain it.
>
>Snapshot of dump form .lreg file -
>
>Use-def chains:    (Shouldn't this be def-use instead??)
>...
>d4 bb 0 luid 5 insn 21 reg 161 { u14 u19 u29 u44 u58 u64 } <-- 
>(u29 is modified, previous use-def ref has to be updated)
>d47 bb 8 luid 1 insn 129 reg 161 { u66 }  <-- Is this correct??
>...
>
>Def-use chains:       (Use-def??)
>...
>u14 bb 3 luid 1 insn 52 reg 161 { d4 d47 } 
>u19 bb 3 luid 3 insn 55 reg 161 { d4 d47 }
>u29 bb 4 luid 3 insn 80 reg 161 { d4 d47 }
>u44 bb 5 luid 6 insn 96 reg 161 { d4 d47 }
>u58 bb 6 luid 2 insn 109 reg 161 { d4 d47 }
>u64 bb 8 luid 1 insn 129 reg 161 { d4 d47 }
>u66 bb 8 luid 2 insn 25 reg 161 { d47 }
>
>Thanks and Best Regards,
>Mukta
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]