[llvm] [SimplifyCFG] Add foldCondStoreToSelect optimization (PR #207654)

Karthika Devi C via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 04:17:20 PDT 2026


kartcq wrote:

> ```c++
> mergeConditionalStores
> ```

I initially thought of reusing mergeConditionalStores but it was looking for a different CFG shape — both arms of PBI need to flow into QBI's parent, which is not the case here. I also explored splitting mergeConditionalStoreToAddress and reusing parts of it, but that also didn't work out — it produces a conditional store behind a new branch, whereas what I need is an unconditional select+store to eliminate the branch and enable vectorization. So ended up writing a new function.

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


More information about the llvm-commits mailing list