================ @@ -1289,6 +1299,14 @@ static bool runImpl(Function &F, LazyValueInfo *LVI, DominatorTree *DT, FnChanged |= BBChanged; } + // Infer range attribute on return value. + if (RetRange && !RetRange->isFullSet()) { + Attribute RangeAttr = F.getRetAttribute(Attribute::Range); + if (RangeAttr.isValid()) + RetRange = RetRange->intersectWith(RangeAttr.getRange()); + if (!RetRange->isEmptySet() && !RetRange->isSingleElement()) + F.addRangeRetAttr(*RetRange); ---------------- goldsteinn wrote:
Could we cause an inf loop if existing range attr is same as new one? https://github.com/llvm/llvm-project/pull/99620 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits