[PATCH] D84294: [SCEV] Remove invalid assert. PR46786

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 00:48:05 PDT 2020


lebedev.ri added a comment.

I'm obviously okay with dropping the assert until it actually doesn't trigger.

(copying from https://bugs.llvm.org/show_bug.cgi?id=46786#c8)

The question is, is "is pointer" a sticky bit or not?
In IR, GEP takes a pointer and produces a pointer.
In SCEV, as we can see, that's not really so.

In IR, if it ask GetUnderlyingObject() about some GEP,
it will recurse into the base pointer somewhat and return something.

In SCEV, if i ask SCEV::getPointerBase() about getSCEV(same GEP),
it will only try to recurse as long as there is exactly a single pointer operand.
So if GEP's SCEV somehow got folded in a way that obscured the fact that it produces a pointer,
i think there's an issue.

So here, i would  actually think the problem is that the fix in D82633 <https://reviews.llvm.org/D82633>
was too narrow. Instead of fixing `SCEVAddExpr::getType()`, `SCEVNAryExpr::getType()`
should have been fixed, i believe that would resolve the assertion in this report.


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

https://reviews.llvm.org/D84294





More information about the llvm-commits mailing list