@@ -553,23 +553,16 @@ Constant *FoldReinterpretLoadFromConst(Constant *C, Type *LoadTy,
553
553
554
554
// If this isn't an integer load we can't fold it directly.
555
555
if (!IntType) {
556
- // If this is a float/double load, we can try folding it as an int32/64 load
557
- // and then bitcast the result. This can be useful for union cases. Note
556
+ // If this is a non-integer load, we can try folding it as an int load and
557
+ // then bitcast the result. This can be useful for union cases. Note
558
558
// that address spaces don't matter here since we're not going to result in
559
559
// an actual new load.
560
- Type *MapTy;
561
- if (LoadTy->isHalfTy ())
562
- MapTy = Type::getInt16Ty (C->getContext ());
563
- else if (LoadTy->isFloatTy ())
564
- MapTy = Type::getInt32Ty (C->getContext ());
565
- else if (LoadTy->isDoubleTy ())
566
- MapTy = Type::getInt64Ty (C->getContext ());
567
- else if (LoadTy->isVectorTy ()) {
568
- MapTy = PointerType::getIntNTy (
569
- C->getContext (), DL.getTypeSizeInBits (LoadTy).getFixedSize ());
570
- } else
560
+ if (!LoadTy->isHalfTy () && !LoadTy->isFloatTy () && !LoadTy->isDoubleTy () &&
561
+ !LoadTy->isVectorTy ())
571
562
return nullptr ;
572
563
564
+ Type *MapTy = Type::getIntNTy (
565
+ C->getContext (), DL.getTypeSizeInBits (LoadTy).getFixedSize ());
573
566
if (Constant *Res = FoldReinterpretLoadFromConst (C, MapTy, Offset, DL)) {
574
567
if (Res->isNullValue () && !LoadTy->isX86_MMXTy () &&
575
568
!LoadTy->isX86_AMXTy ())
0 commit comments