@@ -2788,18 +2788,6 @@ static Value *getWideOperand(Value *Oper) {
2788
2788
return Oper;
2789
2789
}
2790
2790
2791
- // / Return true if we allow an IV chain to include both types.
2792
- static bool isCompatibleIVType (Value *LVal, Value *RVal) {
2793
- Type *LType = LVal->getType ();
2794
- Type *RType = RVal->getType ();
2795
- return (LType == RType) || (LType->isPointerTy () && RType->isPointerTy () &&
2796
- // Different address spaces means (possibly)
2797
- // different types of the pointer implementation,
2798
- // e.g. i16 vs i32 so disallow that.
2799
- (LType->getPointerAddressSpace () ==
2800
- RType->getPointerAddressSpace ()));
2801
- }
2802
-
2803
2791
// / Return an approximation of this SCEV expression's "base", or NULL for any
2804
2792
// / constant. Returning the expression itself is conservative. Returning a
2805
2793
// / deeper subexpression is more precise and valid as long as it isn't less
@@ -2979,7 +2967,7 @@ void LSRInstance::ChainInstruction(Instruction *UserInst, Instruction *IVOper,
2979
2967
continue ;
2980
2968
2981
2969
Value *PrevIV = getWideOperand (Chain.Incs .back ().IVOperand );
2982
- if (! isCompatibleIVType ( PrevIV, NextIV))
2970
+ if (PrevIV-> getType () != NextIV-> getType ( ))
2983
2971
continue ;
2984
2972
2985
2973
// A phi node terminates a chain.
@@ -3273,7 +3261,7 @@ void LSRInstance::GenerateIVChain(const IVChain &Chain,
3273
3261
// do this if we also found a wide value for the head of the chain.
3274
3262
if (isa<PHINode>(Chain.tailUserInst ())) {
3275
3263
for (PHINode &Phi : L->getHeader ()->phis ()) {
3276
- if (! isCompatibleIVType (& Phi, IVSrc))
3264
+ if (Phi. getType () != IVSrc-> getType ( ))
3277
3265
continue ;
3278
3266
Instruction *PostIncV = dyn_cast<Instruction>(
3279
3267
Phi.getIncomingValueForBlock (L->getLoopLatch ()));
0 commit comments