[TargetLowering] remove fdiv and frem from canOpTrap() (PR29114)
authorSanjay Patel <spatel@rotateright.com>
Mon, 29 Aug 2016 13:32:41 +0000 (13:32 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 29 Aug 2016 13:32:41 +0000 (13:32 +0000)
commitb57d0a2fda00fd50f78dc89802b457072194a75a
tree7fcd003f9fb42b5ccff06d1c172cebf054593114
parent0a955d6dcb8108d7a4fdd9aec0f46fab5e447230
[TargetLowering] remove fdiv and frem from canOpTrap() (PR29114)

Assuming the default FP env, we should not treat fdiv and frem any differently in terms of
trapping behavior than any other FP op. Ie, FP ops do not trap with the default FP env.

This matches how we treat these ops in IR with isSafeToSpeculativelyExecute(). There's a
similar bug in Constant::canTrap().

This bug manifests in PR29114:
https://llvm.org/bugs/show_bug.cgi?id=29114
...as a sequence of scalar divisions instead of a vector division on x86 for a <3 x float>
type.

Differential Revision: https://reviews.llvm.org/D23974

llvm-svn: 279970
llvm/include/llvm/Target/TargetLowering.h
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/test/CodeGen/X86/vec3.ll