Hello all,
I’ve been working on writing a backend, I was testing zext, and during the first run of combining llc does the following thing:
=== zext
Creating new node: t3: i16 = truncate t2
Creating new node: t5: ch = CopyToReg t0, Register:i32 %vreg1, t2
Creating new node: t6: i32 = zero_extend t3
Creating new node: t9: ch = MyArchISD::RET_FLAG t8, Register:i32 %R0, t8:1
Initial selection DAG: BB#0 ‘zext:entry’
SelectionDAG has 10 nodes:
t0: ch = EntryToken
t2: i32,ch = CopyFromReg t0, Register:i32 %vreg0
t5: ch = CopyToReg t0, Register:i32 %vreg1, t2
t3: i16 = truncate t2
t6: i32 = zero_extend t3
t8: ch,glue = CopyToReg t5, Register:i32 %R0, t6
t9: ch =MyArchISD::RET_FLAG t8, Register:i32 %R0, t8:1
Combining: t9: ch =MyArchISD::RET_FLAG t8, Register:i32 %R0, t8:1
Combining: t8: ch,glue = CopyToReg t5, Register:i32 %R0, t6
Combining: t7: i32 = Register %R0
Combining: t6: i32 = zero_extend t3
Creating constant: t10: i32 = Constant<65535>
Creating new node: t11: i32 = and t2, Constant:i32<65535>
… into: t11: i32 = and t2, Constant:i32<65535>
I was wondering if there is a way to expand the t6 node to “zext t3” so it won’t combine?
(Maybe defining some pattern on my backend’s tablegen or something like that)
Thanks,
Liad.