diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-08-29 15:27:17 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-29 15:27:17 +0000 |
commit | 25475bcc0c3e656d7e03dcc483e12601033f55a0 (patch) | |
tree | 68ccfa8c6bef12f0c310f0b93ffc51f9babdf7da /llvm/lib | |
parent | 20f02b271b30f266b3f84a0a366408c8e0a129d4 (diff) | |
download | bcm5719-llvm-25475bcc0c3e656d7e03dcc483e12601033f55a0.tar.gz bcm5719-llvm-25475bcc0c3e656d7e03dcc483e12601033f55a0.zip |
[Constant] remove fdiv and frem from canTrap()
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 the fdiv/frem in IR with isSafeToSpeculativelyExecute() and in
the backend after:
https://reviews.llvm.org/rL279970
llvm-svn: 279973
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/Constants.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index d8d55b472f3..6951b0c8c04 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -347,10 +347,8 @@ static bool canTrapImpl(const Constant *C, return false; case Instruction::UDiv: case Instruction::SDiv: - case Instruction::FDiv: case Instruction::URem: case Instruction::SRem: - case Instruction::FRem: // Div and rem can trap if the RHS is not known to be non-zero. if (!isa<ConstantInt>(CE->getOperand(1)) ||CE->getOperand(1)->isNullValue()) return true; |