[llvm] [BOLT] Simplify RAState helpers (NFCI) (PR #162820)

Gergely Bálint via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 04:33:44 PDT 2025


================
@@ -40,25 +40,30 @@ void InsertNegateRAState::runOnFunction(BinaryFunction &BF) {
     coverFunctionFragmentStart(BF, FF);
     bool FirstIter = true;
     MCInst PrevInst;
+    bool PrevRAState = false;
----------------
bgergely0 wrote:

It's not: https://github.com/llvm/llvm-project/blob/e8149e436c5310064405f6aea7d8d49e16ecfaa7/bolt/lib/Passes/InsertNegateRAStatePass.cpp#L110-L117

Although I agree that this part is somewhat unclear. Other option to what I have here is to only keep a PrevInst, but then I'd need to `auto PrevRAState = getRAState(PrevInst)` in each iteration, so I'm not sure if that's any better.

https://github.com/llvm/llvm-project/pull/162820


More information about the llvm-commits mailing list