[PATCH] D122635: [RISCV] Filter out instructions which contain unsafe things when outlining

Wang Pengcheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 02:49:04 PDT 2022


pcwang-thead updated this revision to Diff 421468.
pcwang-thead added a comment.

Rebase and update commit message.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122635

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfo.cpp


Index: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
+++ llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
@@ -1272,7 +1272,8 @@
 
   // Make sure the operands don't reference something unsafe.
   for (const auto &MO : MI.operands())
-    if (MO.isMBB() || MO.isBlockAddress() || MO.isCPI() || MO.isJTI())
+    if (MO.isMBB() || MO.isBlockAddress() || MO.isCPI() || MO.isJTI() ||
+        MO.isCFIIndex() || MO.isFI() || MO.isTargetIndex())
       return outliner::InstrType::Illegal;
 
   // Don't allow instructions which won't be materialized to impact outlining


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122635.421468.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220408/a2abaeec/attachment.bin>


More information about the llvm-commits mailing list