> Index: llvm/lib/VMCore/ConstantFolding.cpp > diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.107 llvm/lib/VMCore/ > ConstantFolding.cpp:1.108 > --- llvm/lib/VMCore/ConstantFolding.cpp:1.107 Sun Dec 3 23:19:34 2006 > +++ llvm/lib/VMCore/ConstantFolding.cpp Mon Dec 4 21:30:09 2006 > @@ -777,8 +777,7 @@ > uint64_t V = > DoubleToBits(cast<ConstantFP>(CP->getOperand(i))- > >getValue()); > Constant *C = ConstantInt::get(Type::ULongTy, V); > - Result.push_back( > - ConstantExpr::getInferredCast(C, false, DstEltTy, > false)); > + Result.push_back(ConstantExpr::getTruncOrBitCast(C, > DstEltTy )); > } > return ConstantPacked::get(Result); > } > @@ -787,8 +786,7 @@ > for (unsigned i = 0; i != SrcNumElts; ++i) { > uint32_t V = FloatToBits(cast<ConstantFP>(CP->getOperand(i))- > >getValue()); > Constant *C = ConstantInt::get(Type::UIntTy, V); > - Result.push_back( > - ConstantExpr::getInferredCast(C, false, DstEltTy, false)); > + Result.push_back(ConstantExpr::getTruncOrBitCast(C, DstEltTy)); > } > return ConstantPacked::get(Result); > }
Again, these should only be bitcast. They can never be truncates. > @@ -855,7 +853,7 @@ > } > if (isAllNull) > // This is casting one pointer type to another, always > BitCast > - return ConstantExpr::getCast(CE->getOperand(0), DestTy); > + return ConstantExpr::getPointerCast(CE->getOperand(0), > DestTy); > } > } Likewise. -Chris _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits