In function isSafeToSpeculativelyExecuteWithOpcode, integer DIV/REM is marked as unsafe to execute speculatively, but floating point FDIV/FREM is not checked. They are also unsafe for the same reason.
There are some optimization regressions with this patch, such as select.ll. It is because function isSafeToSpeculativelyExecuteWithOpcode is called in several different kinds of speculations.
1 The dest block may be executed but the src block is not executed, like the new test case, it is danger for FDIV. 2 The src block is executed by the dest may not be executed, like select.ll, it is safe for FDIV.
In future we may split isSafeToSpeculativelyExecuteWithOpcode for different speculations to get most optimization opportunities.
I don't think this is correct. x/0.0 is infinity or negative infinity. Unless x is 0.0 in which case it's nan. But in any case its not undefined.