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

Ying Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 22:58:25 PST 2023


yingopq updated this revision to Diff 558070.
yingopq added a comment.

Add a global variable 'CurForbiddenSlotAttr' to save current instruction`s forbidden slot and whether set reorder.
This is the judgment condition for whether to add nop.  
We would add a couple of '.set noreorder' and '.set reorder' to wrap the current instruction and the next instruction.
Then we can get previous instruction`s forbidden slot attribute and whether set reorder by 'CurForbiddenSlotAttr'.
If previous instruction has forbidden slot and .set reorder is active and current instruction is CTI.  Then emit a NOP
after it.


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

https://reviews.llvm.org/D158589

Files:
  llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
  llvm/test/CodeGen/Mips/llvm-ir/forbidden-slot-ir.ll
  llvm/test/MC/Mips/forbidden-slot.s
  llvm/test/MC/Mips/mips32r6/relocations.s
  llvm/test/MC/Mips/mips64r6/relocations.s
  llvm/test/MC/Mips/relocation.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158589.558070.patch
Type: text/x-patch
Size: 11336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20231110/a5f36c14/attachment.bin>


More information about the llvm-commits mailing list