[PATCH] D104322: [SCEV] PtrToInt on non-integral pointers is allowed

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 14:29:29 PDT 2021


lebedev.ri created this revision.
lebedev.ri added reviewers: efriedma, reames, mkazantsev, nikic.
lebedev.ri added a project: LLVM.
Herald added subscribers: javed.absar, hiraditya.
lebedev.ri requested review of this revision.

As per (committed without review) @reames's rGac81cb7e6dde9b0890ee1780eae94ab96743569b <https://reviews.llvm.org/rGac81cb7e6dde9b0890ee1780eae94ab96743569b> change,
we are now allowed to produce `ptrtoint` for non-integral pointers.
This will unblock further unbreaking of SCEV regarding int-vs-pointer type confusion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104322

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp


Index: llvm/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/lib/Analysis/ScalarEvolution.cpp
+++ llvm/lib/Analysis/ScalarEvolution.cpp
@@ -1060,9 +1060,6 @@
   if (!Op->getType()->isPointerTy())
     return Op;
 
-  assert(!getDataLayout().isNonIntegralPointerType(Op->getType()) &&
-         "Source pointer type must be integral for ptrtoint!");
-
   // What would be an ID for such a SCEV cast expression?
   FoldingSetNodeID ID;
   ID.AddInteger(scPtrToInt);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104322.352248.patch
Type: text/x-patch
Size: 525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210615/c1d39be1/attachment.bin>


More information about the llvm-commits mailing list