[PATCH] D98147: [SCEV] Improve modelling for pointer constants

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 7 12:29:07 PST 2021


Meinersbur added a comment.

I cannot see the mentioned null constant handling? Is it because removing the `ConstantPointerNull` condition it falls back to the generic case that now does handle null constants?



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:1076
+    // Does the operand happen to be a (pointer) constant? If so, see if we can
+    // produce an integer constant (but *NOT* an ptr2int constant expression!).
+    if (auto *PC = dyn_cast<Constant>(U->getValue()))
----------------
[typo] a~~n~~ ptr2int

IIUC, this is to reduce `ptr2int(int2ptr(x)) -> x`?


================
Comment at: polly/test/Isl/CodeGen/partial_write_impossible_restriction.ll:9-10
+
+; FIXME: How to update this test?
+; XFAIL: *
+
----------------
Does it crash or a CHECK-line not match?


================
Comment at: polly/test/ScopInfo/constant_functions_outside_scop_as_unknown.ll:9
 ; CHECK-NEXT: p2: %param2
+; CHECK-NEXT: p3: null
 ; CHECK-NEXT: Arrays {
----------------
Weird. A constant doesn't need to be parametrized.


================
Comment at: polly/test/ScopInfo/memset_null.ll:16-22
+; CHECK-NEXT:        Stmt_for_cond5_preheader_us221_b
+; CHECK-NEXT:            Domain :=
+; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221_b[0] };
+; CHECK-NEXT:            Schedule :=
+; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221_b[i0] -> [0, 1] };
+; CHECK-NEXT:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT:                { Stmt_for_cond5_preheader_us221_b[i0] -> MemRef1[o0] : o0 >= 0 };
----------------
Mmmh, the test description says that the memset should not be modeled (I think it should have optimistically assumed that it is never executed)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98147/new/

https://reviews.llvm.org/D98147



More information about the llvm-commits mailing list