Use isSingleValueType instead of isFirstClassType to

exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2008-05-23 01:52:21 +00:00
parent f3061f8210
commit 8f8e269270

View File

@ -9030,7 +9030,7 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
if (SrcETy->isSized() && TD->getTypeStoreSize(SrcETy) == Size) { if (SrcETy->isSized() && TD->getTypeStoreSize(SrcETy) == Size) {
// The SrcETy might be something like {{{double}}} or [1 x double]. Rip // The SrcETy might be something like {{{double}}} or [1 x double]. Rip
// down through these levels if so. // down through these levels if so.
while (!SrcETy->isFirstClassType()) { while (!SrcETy->isSingleValueType()) {
if (const StructType *STy = dyn_cast<StructType>(SrcETy)) { if (const StructType *STy = dyn_cast<StructType>(SrcETy)) {
if (STy->getNumElements() == 1) if (STy->getNumElements() == 1)
SrcETy = STy->getElementType(0); SrcETy = STy->getElementType(0);
@ -9045,7 +9045,7 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
break; break;
} }
if (SrcETy->isFirstClassType()) if (SrcETy->isSingleValueType())
NewPtrTy = PointerType::getUnqual(SrcETy); NewPtrTy = PointerType::getUnqual(SrcETy);
} }
} }