99namespace llvm {
1010namespace VNCoercion {
1111
12- static bool isFirstClassAggregate (Type *Ty) {
13- return Ty->isStructTy () || Ty->isArrayTy ();
14- }
15-
1612// / Return true if coerceAvailableValueToLoadType will succeed.
1713bool 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