aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-25 23:07:07 +0000
committerDale Johannesen <dalej@apple.com>2007-09-25 23:07:07 +0000
commitf53d83e5f075d5bfe38169a406617c06ef844bef (patch)
treed70f31f8a5ced87d8222fbce79c437ce0e1e5f20 /lib/VMCore/ConstantFold.cpp
parent62a4eae84f410bc5f536e6cea2f5d8d17653dca4 (diff)
downloadexternal_llvm-f53d83e5f075d5bfe38169a406617c06ef844bef.tar.gz
external_llvm-f53d83e5f075d5bfe38169a406617c06ef844bef.tar.bz2
external_llvm-f53d83e5f075d5bfe38169a406617c06ef844bef.zip
Make APFloat->int conversions deterministic even in
cases with undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index d8b8566193..7154afb183 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -197,8 +197,6 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
APFloat::opStatus status = V.convertToInteger(x, DestBitWidth,
opc==Instruction::FPToSI,
APFloat::rmTowardZero);
- if (status!=APFloat::opOK && status!=APFloat::opInexact)
- return 0; // give up
APInt Val(DestBitWidth, 2, x);
return ConstantInt::get(Val);
}