[PATCH] D37874: [TwoAddressInstructionPass] When prepending COPYs when processing tied operands, take the register class constraint from the instruction operands not the register we're copying.
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 14 17:36:05 PDT 2017
arsenm added inline comments.
================
Comment at: lib/CodeGen/TwoAddressInstructionPass.cpp:1521-1522
MIB.addReg(RegB, 0, SubRegB);
- const TargetRegisterClass *RC = MRI->getRegClass(RegB);
+ const TargetRegisterClass *RC = TII->getRegClass(MI->getDesc(), SrcIdx, TRI,
+ *MF);
if (SubRegB) {
----------------
craig.topper wrote:
> arsenm wrote:
> > Can't this now fail if the instruction uses an unknown register class operand?
> Can you give an example? I'm not very familiar with some of this stuff.
You can define an instruction operand with an unknown register class, e.g. PATCHPOINT uses this:
let OutOperandList = (outs unknown:$dst);
Similarly variable_ops instructions don't have statically known register classes from the operand definition.
https://reviews.llvm.org/D37874
More information about the llvm-commits
mailing list