[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
Mon Mar 28 22:26:00 PDT 2022


pcwang-thead created this revision.
pcwang-thead added reviewers: craig.topper, asb, lewis-revill, jrtc27, luismarques.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
pcwang-thead requested review of this revision.
Herald added subscribers: llvm-commits, eopXD, MaskRay.
Herald added a project: LLVM.

Like JumpTableIndex, FrameIndex and others.


Repository:
  rG LLVM Github Monorepo

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.418788.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220329/180ad2e4/attachment.bin>


More information about the llvm-commits mailing list