[llvm] [LoopAccessAnalysis] Fix type mismatch (PR #183116)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 3 01:21:04 PST 2026
================
@@ -250,8 +250,13 @@ static bool evaluatePtrAddRecAtMaxBTCWillNotWrap(
return true;
});
if (DerefRK) {
- DerefBytesSCEV =
- SE.getUMaxExpr(DerefBytesSCEV, SE.getSCEV(DerefRK.IRArgValue));
+ const SCEV *DerefRKSCEV = SE.getSCEV(DerefRK.IRArgValue);
+ // Ensure both operands have the same type
+ Type *CommonTy =
+ SE.getWiderType(DerefBytesSCEV->getType(), DerefRKSCEV->getType());
+ DerefBytesSCEV = SE.getNoopOrAnyExtend(DerefBytesSCEV, CommonTy);
+ DerefRKSCEV = SE.getNoopOrAnyExtend(DerefRKSCEV, CommonTy);
----------------
fhahn wrote:
Why any extend? Both quantities should be positive, so better always use Zext?
https://github.com/llvm/llvm-project/pull/183116
More information about the llvm-commits
mailing list