[PATCH] D158589: [MIPS] Add handing of forbidden slot when IR with inline asm

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 23:26:32 PDT 2023


MaskRay added a subscriber: FlyGoat.
MaskRay added a comment.

I am quite concerned with extra parameters in `AsmPrinter::emitInlineAsm`, `parseStatement`, and similar member functions. Do we have a way not adding them?

@FlyGoat



================
Comment at: llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h:95
+
+  /// MIp - Pointer to the machine instruction of the current inlineAsm.
+  const MachineInstr *MIp;
----------------
Don't repeat the variable/function name in new code.


================
Comment at: llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h:96
+  /// MIp - Pointer to the machine instruction of the current inlineAsm.
+  const MachineInstr *MIp;
 };
----------------
Do we have to have this variable?


================
Comment at: llvm/test/MC/Mips/forbidden-slot.s:1
+# RUN: clang --target=mipsel-linux-gnu -march=mips32r6 -c %s -o tmp.o
+# RUN: llvm-objdump -d tmp.o | FileCheck %s --check-prefix=MIPSELR6
----------------
we cannot use clang in llvm tests due to layering reasons https://maskray.me/blog/2021-08-08-toolchain-testing#the-test-checks-at-the-wrong-layer. also, llvm-project may be built with just llvm, not clang, and this would fail.


================
Comment at: llvm/test/MC/Mips/forbidden-slot.s:4
+
+# MIPSELR6: beqzc	$9, 0x0 <aaa>
+# MIPSELR6-NEXT: b	0x0 <aaa>
----------------
Align instructions for better look
```
# MIPSELR6:      beqzc	$9, 0x8 <bbb>
# MIPSELR6-NEXT: nop <aaa>
# MIPSELR6:      b	0x8 <bbb>
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158589/new/

https://reviews.llvm.org/D158589



More information about the llvm-commits mailing list