(original) (raw)
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:
=== zextCreating new node: t3: i16 = truncate t2Creating new node: t5: ch = CopyToReg t0, Register:i32 %vreg1, t2Creating new node: t6: i32 = zero\_extend t3Creating new node: t9: ch = MyArchISD::RET\_FLAG t8, Register:i32 %R0, t8:1Initial selection DAG: BB#0 'zext:entry'SelectionDAG has 10 nodes:t0: ch = EntryTokent2: i32,ch = CopyFromReg t0, Register:i32 %vreg0t5: ch = CopyToReg t0, Register:i32 %vreg1, t2t3: i16 = truncate t2t6: i32 = zero\_extend t3t8: ch,glue = CopyToReg t5, Register:i32 %R0, t6t9: 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, t6Combining: t7: i32 = Register %R0Combining: t6: i32 = zero\_extend t3Creating 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.