Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
119–120 | Nope, I actually had a FIXME to remove it. We should only need the register size, and this we can always recompute. |
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
105 | This should probably propagate that this is an error with the function return value? | |
120 | Specify physical register in comment? | |
128–131 | Looking again this assert doesn't really make sense. You are finding the registers from the reg class iterator, so obviously it is in the class already | |
133 | Picking multiple physical registers by scanning through the register class doesn't make any sense to me. I would expect NumRegs > 1 only with a virtual register | |
154 | Move this into default case? | |
380 | Reg.isPhysical() |
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
120 | Which comment do you mean? | |
128–131 | I've mostly copied this function from the SelectionDAG code, but I agree this assertion should never trigger. I couldn't find out from the history why this assertion was added, maybe because the target provides both the physical register and the register class, and they have to match? | |
133 | The LLVM IR reference manual contains the following paragraph:
X86 uses this at least with the 'A' register constraint, but there are other targets, too (e.g. ARM uses it to pass 64-bit values in even-odd register pairs). | |
154 | At least my Xcode warns about adding a default case for a switch which covers all enumeration values. I think there's also a similar notice in the development guide? |
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
133 | With physical registers? Can you add a testcase for this? |
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
133 | I can add a fictitious test for AArch64, but it doesn't have asm template argument modifiers to access the "higher" register. |
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
118–123 | Comments seem out of place here? Move them closer to the code that corresponds to them? | |
128–131 | Maybe just use std::find_if? Also what should happen if you don't find the assigned register here? | |
179 | Extra parens around if? | |
222–224 | Remove braces on single-line if? | |
316 | s/node/instruction/ | |
355–359 | Can this be a range-based for? | |
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-inline-asm.ll | ||
3 | -verify-machineinstrs? |
Rebase & address more review comments
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
128–131 | Previously, there was an assertion if the end of the iterator was reached without finding the register, but I removed it in another iteration. | |
133 | Turns out I can't add a test for this at the moment, because I'm bailing out if an output constraint needs more than one register (see line 408). |
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | ||
---|---|---|
251 | Add a TRI variable instead of calling getSubtarget().getRegisterInfo() repeatedly through the function | |
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | ||
693–694 | This part isn't tested, I would leave this for a separate patch. I'm not sure checking for inline asm explicitly is the right thing here |
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | ||
---|---|---|
693–694 | Sure I can remove this change from the patch. I temporarily removed the -stop-after argument from the irtranslator test to run down to assembly, which resulted in a crash in the register bank selector of AArch64. |
Hoist call to getRegisterInfo() and create local variable. Fix a few clangTidy issues
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | ||
---|---|---|
693–694 | After removing this line, another AArch64 test starts failing (stack_guard_remat.ll). It triggers the very same crash in the register bank selector of AArch64: llvm::LLT::getScalarSizeInBits() const: Assertion 'RawData != 0 && "Invalid Type"'. What do you think would be an appropriate check during register bank selection? |
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | ||
---|---|---|
693–694 | OK, can you add an explicit regbankselect for asm test then? |
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | ||
---|---|---|
693–694 | I've added a test and extracted the MI.isInlineAsm() check similar to the MI.isDebugInstr() below. Note, however, that I had to specifically add the register class annotations to the input MIR (for the virtual register definitions of inline asm instructions), because it is not printed by the MIRPrinter by default. This makes the current output of MIRPrinter for inline asm instructions not round-trippable. |
Don't need to repeat function name