[llvm] Move ExpandMemCmp and MergeIcmp to the middle end (PR #77370)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 12:37:13 PST 2024


nikic wrote:

> One question is where to put this in the pipeline. The inline expansions probably benefit the most from the passes we run early, but we might want to wait a bit so that we can try and prove a constant argument to the memcmp (though I imagine if they are going to be constant, it's directly from the source).

I'd probably recommend to start conservatively and add the passes at the end of the module optimization pipeline, before the last SimplifyCFG invocation (in the vicinity of ExpandDivRem). This won't address your motivating case, but it will allow us to iron out issues from moving these passes to the middle-end, while still mostly keeping their current pipeline position.

Once they are in the middle-end pipeline, it will be easier to evaluate different positions.

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


More information about the llvm-commits mailing list