Hello.
I am reading the code about DAG to DAG Instruction selection when I meet some problems. I am confused about the using of ch, glue.
when will they be used? And what are they used for?
when a sdnode doesn’t have an actual result, it would have an MVT::Other typed result. But how to decide which sdnode is the user of this result?
for example, I have the DAG before instruction selection step, the corresponding graph is in attachment:
SelectionDAG has 19 nodes:
t0: ch = EntryToken
t5: ch = store<ST4[%1]> t0, Constant:i32<11>, FrameIndex:i32<0>, undef:i32
t8: ch = store<Volatile ST4[%2]> t5, Constant:i32<12>, FrameIndex:i32<1>, undef:i32
t9: i32,ch = load<LD4[%1]> t8, FrameIndex:i32<0>, undef:i32
t12: i32,ch = load<Volatile LD4[%2]> t9:1, FrameIndex:i32<1>, undef:i32
t14: ch = store<ST4[%1]> t12:1, t22, FrameIndex:i32<0>, undef:i32
t17: ch,glue = CopyToReg t14, Register:i32 %V0, t22
t11: i32 = add t9, Constant:i32<1>
t20: glue = Cpu0ISD::DivRem t11, t12
t22: i32,ch,glue = CopyFromReg t0, Register:i32 %HI, t20
t18: ch = Cpu0ISD::Ret t17, Register:i32 %V0, t17:1
The .ll code is as below: