[PATCH] D27984: [ARM] [RFC] Use AddDefaultCC/Pred where possible. NFC

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 05:21:36 PST 2017


MatzeB added a comment.

First: Factoring out the common code for adding those operands and thereby giving it a more obvious name than `addReg(0)` is a good thing!

> I guess we'd have to compare a substantial sample of all the lines of code where this pattern can be applied to see if this similarity between the assembly syntax of the instruction and the BuildMI syntax actually holds; or if it's just hand-wavy wishful thinking on my part.

We should really compare the BuildMI order with how the MachineInstrs will look later! Of course it is a good idea to have the operand order of the MachineInstrs correspond to assembly syntax, but having BuildMI correspond to assembly doesn't help if the MachineInstrs themselfes have a different order.

I'm not necessarily against the custom MachineInstrBuilder, but all the templating machinery
feels a bit heavy for the problem at hand so I proposed a variant on how to integrate this with BuildMI in https://reviews.llvm.org/D28057.


https://reviews.llvm.org/D27984





More information about the llvm-commits mailing list