[PATCH] D88806: [SCEV] Model inttoptr and ptrtoint casts not as unknown, but as zext/trunc/self of unknown

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 14:50:21 PDT 2020


efriedma added a comment.

Using getUnknown on a value that SCEV would normally be able to reason about has weird side-effects: unrelated uses of the value will also pick up the Unknown.  Not sure what all the implications of that are off the top of my head, but it's hard to reason about.

Also, treating two distinct inttoptr instructions with the same operand as if they're equivalent is a known source of unsoundness; I don't want to expand that.

Given that, I don't think this is the right way to approach the issue.  I prefer the approach from https://bugs.llvm.org/show_bug.cgi?id=46786#c20 .  That would allow optimizing the given examples, I think: in contexts where we don't care about the derivation of a pointer, we can look through ptrtoint/inttoptr operations.  (I don't think I'll have time to implement that in the near future, though.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88806



More information about the llvm-commits mailing list