[llvm] r246232 - [ValueTracking] readnone CallInsts are fair game for speculation

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 04:32:52 PDT 2015


On Thu, Aug 27, 2015 at 06:20:52PM -0500, Hal Finkel via llvm-commits wrote:
> int divide(int x, int y) { return x/y; }
> 
> is readnone, according to our definition, but could trap if speculated with y == 0.

Well, it *may* trap. It is strictly undefined behavior and e.g. the ARM
software version does *not* trap.

Joerg


More information about the llvm-commits mailing list