[PATCH] D149551: [Interpreter] Filter out RISC-V +relax feature

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 30 07:54:46 PDT 2023


Hahnfeld created this revision.
Hahnfeld added reviewers: v.g.vassilev, sgraenitz, lhames, StephenFan.
Herald added subscribers: VincentWu, vkmr, luismarques, sameer.abuasal, s.egerton, Jim, PkmX, rogfer01, shiva0217, kito-cheng, simoncook, arichardson.
Herald added a project: All.
Hahnfeld requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

JITLink for RISC-V does not implement linker relaxation and until now
only ignored the related alignment relocations. However, the logic has
a flaw and it is actually not valid to ignore them. Just disable the
feature to have less problems.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149551

Files:
  clang/lib/Interpreter/IncrementalExecutor.cpp


Index: clang/lib/Interpreter/IncrementalExecutor.cpp
===================================================================
--- clang/lib/Interpreter/IncrementalExecutor.cpp
+++ clang/lib/Interpreter/IncrementalExecutor.cpp
@@ -43,7 +43,12 @@
   llvm::ErrorAsOutParameter EAO(&Err);
 
   auto JTMB = JITTargetMachineBuilder(TI.getTriple());
-  JTMB.addFeatures(TI.getTargetOpts().Features);
+  for (const auto &F : TI.getTargetOpts().Features) {
+    if (F == "+relax")
+      continue;
+    JTMB.getFeatures().AddFeature(F);
+  }
+
   LLJITBuilder Builder;
   Builder.setJITTargetMachineBuilder(JTMB);
   // Enable debugging of JIT'd code (only works on JITLink for ELF and MachO).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149551.518313.patch
Type: text/x-patch
Size: 680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230430/905ae1b0/attachment.bin>


More information about the cfe-commits mailing list