[PATCH] D78847: [LV] Fix recording of BranchTakenCount for FoldTail
Anh Tuyen Tran via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 10 20:13:30 PDT 2020
anhtuyen added a comment.
In D78847#2028759 <https://reviews.llvm.org/D78847#2028759>, @Ayal wrote:
> In D78847#2028708 <https://reviews.llvm.org/D78847#2028708>, @anhtuyen wrote:
>
> > Hello,
>
>
> [snip]
>
> > In this example, the operand[0] (%induction) correctly has type i64, but the loop bound (14) is of vector type <1 x i64>
> >
> > There might be multiple ways to address this assert failure. I list below a few simple ones for your reference: they might or might not be a good solution at all.
> >
> > 1. Option 1: Not to generate the icmp instructions for %induction. In the particular case of this testcase, these instructions seem to be redundant.
> > 2. Option 2: If we are to generate the icmp instructions above, can we set the BackedgeTakenCount to the State depending on the type of the first operand? In cases like this one when the first operand is not a vector type, using Value *TCMO instead of Value *VTCMO might be an option.
> >
> > I will open a Bugzzila and copy its link to this page when my password reset goes through.
> >
> > Thanks, Anh
>
> Yes, thanks for catching this!
> One quick fix is indeed to set VTCMO to TCMO when State->VF == 1, instead of "splatting" it into a vector of a single element.
> Thinking if fold-tail-by-masking should be restricted to work for VF>1 only, given that only vectors (loads/stores) get masked.
I also came up (and gave up) that fix last week, because it would not work for a loop whose VF is 1, but the loop bound is a vector. I will come up with an example shortly to demonstrate my thought.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78847/new/
https://reviews.llvm.org/D78847
More information about the llvm-commits
mailing list