================
@@ -1985,6 +1985,28 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst
&CI) {
{InnerPtr, NewMask}));
}
}
+ bool Changed = false;
+ KnownBits Known = computeKnownBits(II, /*Depth*/ 0, II);
+ // See if we can deduce non-null.
+ if (!CI.hasRetAttr(Attribute::NonNull) &&
+ (Known.isNonZero() ||
+ isKnownNonZero(II, DL, /*Depth*/ 0, &AC, II, &DT))) {
+ CI.addRetAttr(Attribute::NonNull);
+ Changed = true;
+ }
+
+ // Known bits will capture if we had alignment information assosiated with
----------------
nikic wrote:
associated
https://github.com/llvm/llvm-project/pull/67166
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits