[llvm] [IPSCCP] Infer nonnull return attribute (PR #106553)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 06:19:15 PDT 2024


================
@@ -232,9 +232,13 @@ define i1 @ip_test_nonnull_caller(ptr %p) {
 }
 
 define ptr @ret_nonnull_pointer(ptr nonnull %p) {
-; CHECK-LABEL: define ptr @ret_nonnull_pointer(
-; CHECK-SAME: ptr nonnull [[P:%.*]]) {
-; CHECK-NEXT:    ret ptr [[P]]
+; SCCP-LABEL: define ptr @ret_nonnull_pointer(
----------------
nikic wrote:

Currently we only infer attributes in IPSCCP. I don't think there's any reason to not do it in SCCP as well, so that's another followup improvement...

https://github.com/llvm/llvm-project/pull/106553


More information about the llvm-commits mailing list