Using a PatLeaf for sext_16_node allowed matching smulbb and smlabb instructions once the operands had been sign extended. But we also need to use sext_inreg operands allow with sext_16_node to catch a few more cases that enable use to remove the unnecessary sxth.
Details
Diff Detail
Event Timeline
lib/Target/ARM/ARMInstrThumb2.td | ||
---|---|---|
2754 | Does ISel automatically match the commuted version? (IIRC it does, but I haven't looked in a while.) Could you use "PatFrags" to make a pattern that's either a sext_inreg or a sext_16_node, so you don't have to repeat these patterns? I haven't actually tried something like that, but I think it's possible. |
Hi Eli,
Thanks for taking a look. Yes, the operands can be commuted and it's why the tests accept top-bottom and bottom-top muls in those tests. I've now also added a few extra tests with swapped operands.
I've tried to combine these patterns before into something nicer, without luck and again I've tried and failed... The errors given by tablegen leave me baffled: I seem to be hitting a problem using 'PatFrags' matching a 'PatFrag' and a 'PatLeaf' and also some kind of type errors that I haven't seen before! However, I have created some PatFrags for the muls to simplify the descriptions.
Does ISel automatically match the commuted version? (IIRC it does, but I haven't looked in a while.)
Could you use "PatFrags" to make a pattern that's either a sext_inreg or a sext_16_node, so you don't have to repeat these patterns? I haven't actually tried something like that, but I think it's possible.