<div dir="ltr">guys,<div><br></div><div>1)i made a mistake in my post.</div><div>the said TF node was created when Selected() was called in ADDC node.<br></div><div><br></div><div><br></div><div>2) the source code under test</div>
<div><br></div><div>short a,b;</div><div>void test()</div><div>{</div><div>a+=b;</div><div>}</div><div><br></div><div>3)the DAG after ADDC was seleced:</div><div><div>Select node:</div><div>0x4977a20: ch,glue = <<Unknown Machine Node #65419>> 0x4972bd0, 0x49731d0, 0x4976c20, 0x49730d0<Mem:LD1[@a](align=2)></div>
<div>Result node:</div><div>0x4977a20: ch,glue = <<Unknown Machine Node #65419>> 0x4972bd0, 0x49731d0, 0x4976c20, 0x49730d0<Mem:LD1[@a](align=2)></div><div>Result DAG:</div><div>SelectionDAG has 21 nodes:</div>
<div> 0x49606f0: ch = EntryToken [ORD=1] [ID=0]</div><div><br></div><div> 0x4972cd0: i8 = undef [ORD=1] [ID=2]</div><div><br></div><div> 0x49735d0: i8 = Constant<1> [ID=3]</div><div><br></div><div> 0x4977920: i8 = TargetGlobalAddress<i16* @b> 0 [ID=4]</div>
<div><br></div><div> 0x4972fd0: i8 = SPISD::GLOBAL_TRANSFER 0x4977920 [ID=6]</div><div><br></div><div> 0x49606f0: <multiple use></div><div> 0x4972fd0: <multiple use></div><div> 0x4972cd0: <multiple use></div>
<div> 0x4976c20: i8,ch = load 0x49606f0, 0x4972fd0, 0x4972cd0<LD1[@b](align=2)> [ID=8]</div><div><br></div><div> 0x49606f0: <multiple use></div><div> 0x4972fd0: <multiple use></div><div> 0x49735d0: <multiple use></div>
<div> 0x4976d20: i8 = add 0x4972fd0, 0x49735d0 [ID=9]</div><div><br></div><div> 0x4972cd0: <multiple use></div><div> 0x4976e20: i8,ch = load 0x49606f0, 0x4976d20, 0x4972cd0<LD1[@b+1]> [ID=12]</div><div>
<br></div><div> 0x49606f0: <multiple use></div><div> 0x4972ed0: i8 = TargetGlobalAddress<i16* @a> 0 [ID=5]</div><div><br></div><div> 0x4977020: i8 = SPISD::GLOBAL_TRANSFER 0x4972ed0 [ID=7]</div>
<div><br></div><div> 0x49735d0: <multiple use></div><div> 0x49736d0: i8 = add 0x4977020, 0x49735d0 [ID=11]</div><div><br></div><div> 0x4972cd0: <multiple use></div><div> 0x49737d0: i8,ch = load 0x49606f0, 0x49736d0, 0x4972cd0<LD1[@a+1]> [ID=14]</div>
<div><br></div><div> 0x4972bd0: <multiple use></div><div> 0x49731d0: i32 = TargetGlobalAddress<i16* @a> 0</div><div><br></div><div> 0x4976c20: <multiple use></div><div> 0x49606f0: <multiple use></div>
<div> 0x49737d0: <multiple use></div><div> 0x4976c20: <multiple use></div><div> 0x4976e20: <multiple use></div><div> 0x49730d0: ch = TokenFactor 0x49606f0, 0x49737d0:1, 0x4976c20:1, 0x4976e20:1</div>
<div><br></div><div> 0x4977a20: ch,glue = addcmr 0x4972bd0, 0x49731d0, 0x4976c20, 0x49730d0<Mem:LD1[@a](align=2)></div><div><br></div><div> 0x4972bd0: i8 = Register %noreg</div><div><br></div><div> 0x4976f20: i32 = TargetGlobalAddress<i16* @a> + 1</div>
<div><br></div><div> 0x4977a20: <multiple use></div><div> 0x4972bd0: <multiple use></div><div> 0x4976f20: <multiple use></div><div> 0x49737d0: <multiple use></div><div> 0x4976e20: <multiple use></div>
<div> 0x4977a20: <multiple use></div><div> 0x4977820: i8,glue = adde 0x49737d0, 0x4976e20, 0x4977a20:1 [ID=16]</div><div><br></div><div> 0x4972bd0: <multiple use></div><div> 0x4976f20: <multiple use></div>
<div> 0x4977a20: <multiple use></div><div> 0x49738d0: ch = MOVmr 0x4972bd0, 0x4976f20, 0x4977820, 0x4972bd0, 0x4976f20, 0x4977a20</div><div><br></div><div> 0x4977c80: ch = TokenFactor 0x4977a20, 0x49738d0</div>
<div><br></div><div> 0x49733d0: ch = RET 0x4977c80</div><div><br></div><div>======</div><div>the said TF Node was at 0x49730d0.</div><div>it was ADDC's last operand,input chain.</div><div><br></div><div>4)the DAG after ADDE was seleced:</div>
<div><div>Select node:</div><div>0x4977820: i8,ch,glue = <<Unknown Machine Node #65516>> 0x49737d0, 0x4972bd0, 0x4972dd0, 0x49606f0, 0x4977a20:1<Mem:LD1[@b+1]></div><div>Result node:</div><div>0x4977820: i8,ch,glue = <<Unknown Machine Node #65516>> 0x49737d0, 0x4972bd0, 0x4972dd0, 0x49606f0, 0x4977a20:1<Mem:LD1[@b+1]></div>
<div>Result DAG:</div><div>SelectionDAG has 20 nodes:</div><div> 0x49606f0: ch = EntryToken [ORD=1] [ID=0]</div><div><br></div><div> 0x4972cd0: i8 = undef [ORD=1] [ID=2]</div><div><br></div><div> 0x49606f0: <multiple use></div>
<div> 0x4977920: i8 = TargetGlobalAddress<i16* @b> 0 [ID=4]</div><div><br></div><div> 0x4972fd0: i8 = SPISD::GLOBAL_TRANSFER 0x4977920 [ID=6]</div><div><br></div><div> 0x4972cd0: <multiple use></div>
<div> 0x4976c20: i8,ch = load 0x49606f0, 0x4972fd0, 0x4972cd0<LD1[@b](align=2)> [ID=8]</div><div><br></div><div> 0x49606f0: <multiple use></div><div> 0x4972ed0: i8 = TargetGlobalAddress<i16* @a> 0 [ID=5]</div>
<div><br></div><div> 0x4977020: i8 = SPISD::GLOBAL_TRANSFER 0x4972ed0 [ID=7]</div><div><br></div><div> 0x49735d0: i8 = Constant<1> [ID=3]</div><div><br></div><div> 0x49736d0: i8 = add 0x4977020, 0x49735d0 [ID=11]</div>
<div><br></div><div> 0x4972cd0: <multiple use></div><div> 0x49737d0: i8,ch = load 0x49606f0, 0x49736d0, 0x4972cd0<LD1[@a+1]> [ID=14]</div><div><br></div><div> 0x49737d0: <multiple use></div><div> 0x4972bd0: <multiple use></div>
<div> 0x4972dd0: i32 = TargetGlobalAddress<i16* @b> + 1</div><div><br></div><div> 0x49606f0: <multiple use></div><div> 0x4977a20: <multiple use></div><div> 0x4977820: i8,ch,glue = ADDerm 0x49737d0, 0x4972bd0, 0x4972dd0, 0x49606f0, 0x4977a20:1<Mem:LD1[@b+1]></div>
<div><br></div><div> 0x4972bd0: <multiple use></div><div> 0x49731d0: i32 = TargetGlobalAddress<i16* @a> 0</div><div><br></div><div> 0x4976c20: <multiple use></div><div> 0x49606f0: <multiple use></div>
<div> 0x49737d0: <multiple use></div><div> 0x4976c20: <multiple use></div><div> 0x4977820: <multiple use></div><div> 0x49730d0: ch = TokenFactor 0x49606f0, 0x49737d0:1, 0x4976c20:1, 0x4977820:1</div>
<div><br></div><div> 0x4977a20: ch,glue = addcmr 0x4972bd0, 0x49731d0, 0x4976c20, 0x49730d0<Mem:LD1[@a](align=2)></div><div><br></div><div> 0x4972bd0: i8 = Register %noreg</div><div><br></div><div> 0x4976f20: i32 = TargetGlobalAddress<i16* @a> + 1</div>
<div><br></div><div> 0x4977a20: <multiple use></div><div> 0x4972bd0: <multiple use></div><div> 0x4976f20: <multiple use></div><div> 0x4977820: <multiple use></div><div> 0x4972bd0: <multiple use></div>
<div> 0x4976f20: <multiple use></div><div> 0x4977a20: <multiple use></div><div> 0x49738d0: ch = MOVmr 0x4972bd0, 0x4976f20, 0x4977820, 0x4972bd0, 0x4976f20, 0x4977a20</div><div><br></div><div>
0x4977c80: ch = TokenFactor 0x4977a20, 0x49738d0</div><div><br></div><div> 0x49733d0: ch = RET 0x4977c80</div><div><br></div></div><div> </div><div>5)the change happened to the said TF node </div><div> from: 0x49730d0: ch = TokenFactor 0x49606f0, 0x49737d0:1, 0x4976c20:1, 0x4976e20:1<br>
</div><div> to: 0x49730d0: ch = TokenFactor 0x49606f0, 0x49737d0:1, 0x4976c20:1, 0x4977820:1</div></div><div><br></div><div>6)ADDE node.<br></div><div><br></div><div> 0x4977820: i8,ch,glue = ADDerm 0x49737d0, 0x4972bd0, 0x4972dd0, 0x49606f0, 0x4977a20:1<Mem:LD1[@b+1]><br>
</div><div><br></div><div>0x4977820 became the last operand of the said TF Node after ADDE was selected.<br></div><div>7) the loop</div><div><br></div><div> 0x4977a20: ch,glue = addcmr 0x4972bd0, 0x49731d0, 0x4976c20, 0x49730d0<Mem:LD1[@a](align=2)><br>
</div><div> 0x49730d0: ch = TokenFactor 0x49606f0, 0x49737d0:1, 0x4976c20:1, 0x4977820:1<br></div><div> 0x4977820: i8,ch,glue = ADDerm 0x49737d0, 0x4972bd0, 0x4972dd0, 0x49606f0, 0x4977a20:1<Mem:LD1[@b+1]><br></div>
<div><br></div><div><br></div><div><br></div><div>Cheers.</div><div><br></div><div>hilbert</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 26, 2014 at 3:17 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Hilbert,<br>
<br>
> let Constraints="$dst=$op0",mayStore=1,<br>
<br>
Are you sure you mean "mayStore" here and not "mayLoad"?<br>
<div class=""><br>
> very bad, all uses of input chain was replaced with ADDErm Node.<br>
<br>
</div>Since your ADDErm is also a load, it is going to need an input chain<br>
of some kind (and hence OPFL_Chain) so that's not surprising on its<br>
own.<br>
<div class=""><br>
> so the created token factor node depends on the ADDErm node after the<br>
> replacement.<br>
<br>
</div>I don't suppose you could post the output of "-view-isel-dags" &<br>
"-view-sched-dags"? I've got some ideas on how to reproduce what<br>
you're seeing, but I need the exact DAGs to have much chance.<br>
<br>
It sounds like it *might* be a bug in HandleMergeInputChains, if it<br>
doesn't take glue into account somehow.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>