[PATCH] D89456: [SCEV] Introduce SCEVPtrToIntExpr (PR46786)
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 18 21:40:50 PDT 2020
mkazantsev added a comment.
I don't think that mixing `null` into AddRecs is correct and expected.
================
Comment at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:100
+ static bool classof(const SCEV *S) {
+ return S->getSCEVType() == scPtrToInt || S->getSCEVType() == scTruncate ||
+ S->getSCEVType() == scZeroExtend ||
----------------
Nit: better add it last, and keep it 1 per line.
================
Comment at: llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll:534
; CHECK-NEXT: %text.addr.5 = phi i8* [ %incdec.ptr112, %while.cond111 ], [ null, %while.body ]
-; CHECK-NEXT: --> {0,+,-1}<nw><%while.cond111> U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %while.cond111: Computable, %while.body: Variant }
+; CHECK-NEXT: --> {null,+,-1}<nw><%while.cond111> U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %while.cond111: Computable, %while.body: Variant }
; CHECK-NEXT: %incdec.ptr112 = getelementptr inbounds i8, i8* %text.addr.5, i64 -1
----------------
What's the type of the AddRec here? Is it an integral-type AddRec with pointer base? If so, this will be a source of various bugs because the code relies on fact that AddRec's type matches Base's type in many places.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89456/new/
https://reviews.llvm.org/D89456
More information about the llvm-commits
mailing list