[polly] [Polly] Narrow IV to lower type when possible (PR #212708)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 07:34:59 PDT 2026
================
@@ -464,6 +464,25 @@ static bool hasLoopCarriedDependence(isl::ast_node_for For, const Scop &S) {
return false;
}
+static Value *adjustToType(IRBuilderBase &Builder, Value *V, Type *Ty) {
+ if (V->getType() == Ty)
+ return V;
+ if (V->getType()->getIntegerBitWidth() < Ty->getIntegerBitWidth())
+ return Builder.CreateSExt(V, Ty);
+ return Builder.CreateTrunc(V, Ty);
+}
+
+// Returns true when V is known to fit in IntPtrTy without data loss.
+// Accepts i64 constants such as 0 and 1 that ISL materialises as i64 even on
+// 32-bit targets.
----------------
anilkund wrote:
Done
https://github.com/llvm/llvm-project/pull/212708
More information about the llvm-commits
mailing list