[PATCH] D105510: [ScalarEvolution] Strictly enforce pointer/int type rules.

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 03:17:32 PDT 2021


mkazantsev accepted this revision.
mkazantsev added a comment.
This revision is now accepted and ready to land.

Looks fine!



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:10600
 
+    if (LHS->getType()->isPointerTy())
+      return false;
----------------
efriedma wrote:
> mkazantsev wrote:
> > It looks like it filters out such simple case as `(LHS == RHS ) => (RHS== LHS)` (if `LHS = FoundRHS` and `RHS = FoundLHS`). Could you please add a unit test to ensure it's not broken with this patch?
> This is inside the `if (getTypeSizeInBits(LHS->getType()) < getTypeSizeInBits(FoundLHS->getType()))`.  Since you can't extend/trunc a pointer, this means FoundLHS is not a pointer.  I can't see how isImpliedCond could return any useful information in that case.
Err, you are right.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105510



More information about the llvm-commits mailing list