You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This snippet of IR is derived from qemu/system/physmem.c@phys_page_set_level (after O3 pipeline).
The example above is a reduced version. If you're interested in the original suboptimal IR and optimal IR, please email me.
Let me know if you can confirm that it's an optimization opportunity, thanks.
The text was updated successfully, but these errors were encountered:
This fold already happens for add, sub, and mul and was introduced in commit f12a556. It is performed in foldBinOpOfSelectAndCastOfSelectCondition. This function seems to have two issues: It doesn't preserve flags like nuw, nsw, or disjoint and it allows multi-use selects which I don't think is profitable (see https://godbolt.org/z/vo8GY6xsa and https://alive2.llvm.org/ce/z/AtLvvW). I guess I should fix that function first so that I can use it for this.
@gwastar, yes, I looked into this function. One-use constraint is needed for the select at least.
You could first file a patch to add some constraints on it, and then file the second patch for this issue.
Alive2 proof: https://alive2.llvm.org/ce/z/-f5J6T
Motivating example
can be folded to:
Real-world motivation
This snippet of IR is derived from qemu/system/physmem.c@phys_page_set_level (after O3 pipeline).
The example above is a reduced version. If you're interested in the original suboptimal IR and optimal IR, please email me.
Let me know if you can confirm that it's an optimization opportunity, thanks.
The text was updated successfully, but these errors were encountered: