- Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Description
Alive2 proof: https://alive2.llvm.org/ce/z/gs8NJq
Missed example: https://godbolt.org/z/PsEvnzvM9
Description:
In src function, with %add in b1 and %sub in b2, we failed to merge them into a single select instruction, and further failed to merge two BasicBlock into the common destination.
Real-world motivation
This snippet of IR is derived from numpy/core/src/npymath/extr_halffloat.c (after O3 pipeline).
The example above is a reduced version. If you're interested in the original suboptimal IR and optimal IR, see also: https://godbolt.org/z/hq7ox6o3e
Let me know if you can confirm that it's an optimization opportunity, thanks.