I confirm that existing constraint-elimination pass is able to deal with cases I’m interested in. I also made some studies and confrim that the constraint elimination pass triggers very rarely on our code too. It’s like 40 methods affected out of 2500 on a huge Java workload, and in each case it made 1-8 transforms and that’s it.
No conditions created for it to be wide-spreadly useful?
Also here [RFC] Inject invariant conditions to loops to enable unswitching (and constraint elimination?) is a related discussing about how we can trigger constraint-elimination more frequently.