Fix a problem brian ran into with the bytecode reader asserting. It turns

out that the problem was actually the writer writing out a 'null' value
because it didn't normalize it.  This fixes:
test/Regression/Assembler/2004-01-22-FloatNormalization.ll

llvm-svn: 10967
This commit is contained in:
Chris Lattner 2004-01-23 00:55:21 +00:00
parent 6fd5e2bdaf
commit 241ed4c500
1 changed files with 5 additions and 0 deletions

View File

@ -701,6 +701,11 @@ ConstantInt *ConstantInt::get(const Type *Ty, unsigned char V) {
static ValueMap<double, Type, ConstantFP> FPConstants;
ConstantFP *ConstantFP::get(const Type *Ty, double V) {
if (Ty == Type::FloatTy) {
// Force the value through memory to normalize it.
volatile float Tmp = V;
V = Tmp;
}
return FPConstants.getOrCreate(Ty, V);
}