Skip to content

Commit c281bf4

Browse files
committed
review fixes
1 parent 8fc1d65 commit c281bf4

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Transforms/Utils/VNCoercion.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
namespace llvm {
1010
namespace VNCoercion {
1111

12-
static bool isFirstClassAggregate(Type *Ty) {
13-
return Ty->isStructTy() || Ty->isArrayTy();
14-
}
15-
1612
/// Return true if coerceAvailableValueToLoadType will succeed.
1713
bool canCoerceMustAliasedValueToLoad(Value *StoredVal, Type *LoadTy,
1814
Function *F) {
@@ -40,7 +36,8 @@ bool canCoerceMustAliasedValueToLoad(Value *StoredVal, Type *LoadTy,
4036
unsigned MinVScale = Attrs.getVScaleRangeMin();
4137
MinStoreSize =
4238
TypeSize::getFixed(MinStoreSize.getKnownMinValue() * MinVScale);
43-
} else if (isa<ScalableVectorType>(StoredTy) || isa<ScalableVectorType>(LoadTy)) {
39+
} else if (isa<ScalableVectorType>(StoredTy) ||
40+
isa<ScalableVectorType>(LoadTy)) {
4441
return false;
4542
}
4643

@@ -61,7 +58,7 @@ bool canCoerceMustAliasedValueToLoad(Value *StoredVal, Type *LoadTy,
6158
return true;
6259
}
6360

64-
if (isFirstClassAggregate(LoadTy) || isFirstClassAggregate(StoredTy))
61+
if (LoadTy->isAggregateType() || StoredTy->isAggregateType())
6562
return false;
6663

6764
bool StoredNI = DL.isNonIntegralPointerType(StoredTy->getScalarType());
@@ -325,7 +322,7 @@ static Value *getStoreValueForLoadHelper(Value *SrcVal, unsigned Offset,
325322
// (e.g. creating a ptrtoint on NI addrspace), since it is a special case in
326323
// canCoerceMustAliasedValueToLoad, so instead form the NullValue for the load
327324
// directly
328-
if (auto *CI = dyn_cast<Constant>(getUnderlyingObject(SrcVal)))
325+
if (auto *CI = dyn_cast<Constant>(SrcVal))
329326
if (CI->isNullValue())
330327
return Constant::getNullValue(LoadTy);
331328

0 commit comments

Comments
 (0)