projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a12651
)
Fix constant folding of FP->int due to cut & paste error in last commit.
author
Reid Spencer
<rspencer@reidspencer.com>
Mon, 11 Dec 2006 21:27:28 +0000
(21:27 +0000)
committer
Reid Spencer
<rspencer@reidspencer.com>
Mon, 11 Dec 2006 21:27:28 +0000
(21:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32447
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/ConstantFold.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/ConstantFold.cpp
b/lib/VMCore/ConstantFold.cpp
index 7eb7d4d8f8b6f026269347ec5b0fa2e6eb8a3582..bad774e67fdebaaca0f8fdcfebc863f56e7c38c9 100644
(file)
--- a/
lib/VMCore/ConstantFold.cpp
+++ b/
lib/VMCore/ConstantFold.cpp
@@
-983,9
+983,10
@@
Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) {
// FP -> Integral.
if (DestTy->isIntegral()) {
- if (DestTy == Type::
Floa
tTy)
+ if (DestTy == Type::
IntTy || DestTy == Type::UIn
tTy)
return ConstantInt::get(DestTy, FloatToBits(FP->getValue()));
- assert(DestTy == Type::DoubleTy && "Unknown FP type!");
+ assert((DestTy == Type::LongTy || DestTy == Type::ULongTy)
+ && "Incorrect integer type for bitcast!");
return ConstantInt::get(DestTy, DoubleToBits(FP->getValue()));
}
}