From 31e5bdccf29f0ce6172f0f0bbb43a9a736b1ef0c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 23 May 2008 00:12:03 +0000 Subject: [PATCH] Use isSingleValueType instead of isFirstClassType to exclude struct and array types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51456 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/StructRetPromotion.cpp | 2 +- lib/Transforms/Scalar/ScalarReplAggregates.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index 4f4f5748ebd..f857dce669c 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -339,7 +339,7 @@ bool SRETPromotion::nestedStructType(const StructType *STy) { unsigned Num = STy->getNumElements(); for (unsigned i = 0; i < Num; i++) { const Type *Ty = STy->getElementType(i); - if (!Ty->isFirstClassType() && Ty != Type::VoidTy) + if (!Ty->isSingleValueType() && Ty != Type::VoidTy) return true; } return false; diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 7102b17d25e..ee80104f108 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -643,7 +643,7 @@ void SROA::RewriteBitCastUserOfAlloca(Instruction *BCInst, AllocationInst *AI, const Type *EltTy =cast(EltPtr->getType())->getElementType(); // If we got down to a scalar, insert a load or store as appropriate. - if (EltTy->isFirstClassType()) { + if (EltTy->isSingleValueType()) { if (isa(MI) || isa(MI)) { Value *Elt = new LoadInst(SROADest ? OtherElt : EltPtr, "tmp", MI);