[llvm] [BOLT] Improve InsertNegateRAStatePass::inferUnknownStates (PR #163381)

Gergely Bálint via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 00:55:42 PST 2025


bgergely0 wrote:

Hi @maksfb! 

> For testing purposes, if we had a way to run a selected optimization pass without running anything else, would it help? E.g. --pass-list=mark-ra-states,insert-negate-ra-state-pass,finalize-functions will only run those three and not the rest.

Sorry, my earlier `opt` analogy wasn't the most precise. What I want to test here is that `mark-ra-states` runs, then I treat the transformations between that and `insert-negate-ra-state-pass` as a "black box". So I need these transformations, to introduce new instructions.

What I wanted to simplify with is to skip reverse-engineering all passes in their current state, so I can make them generate new instructions in the exact way I need them to test these changes. Instead, these gtests "pretend" that a certain transformation happened, introducing new instructions in all sort of configurations.

Naturally, this _could mean_ that the changes here are covering cases that would not exist in any real code, but it looks logical to make this part as robust as I can, without looking for specific assembly inputs for each possible case. 

WDYT?

(cc: @paschalis-mpeis, @peterwaller-arm )

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


More information about the llvm-commits mailing list