[PATCH] D153097: [RISCV] Make linker-relaxable instructions terminate MCDataFragment

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 11:14:42 PDT 2023


nickdesaulniers added a comment.

Is the presubmit failure related?



================
Comment at: llvm/lib/MC/MCExpr.cpp:661
+    uint64_t SAOffset = SA.getOffset(), SBOffset = SB.getOffset();
     int64_t Displacement = SA.getOffset() - SB.getOffset();
     bool Reverse = false;
----------------
could use your new variables here.


================
Comment at: llvm/lib/MC/MCExpr.cpp:688
+      if (DF && DF->isLinkerRelaxable()) {
+        if (&*FI != FB || SBOffset != DF->getContents().size())
+          BBeforeRelax = true;
----------------
once set, we probably don't need to check these other conditions? maybe check `!BBeforeRelax` first, and `!AAfterRelax` below (L690)?

```
if (!BBeforeRelax && (&*FI != FB || ...))
  ...
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153097



More information about the llvm-commits mailing list