[PATCH] D24557: [Loop Vectorizer] Simplified GEP cloning. NFC.

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 11:41:53 PDT 2016


mkuper added a comment.

In https://reviews.llvm.org/D24557#542843, @mssimpso wrote:

> Yeah, I agree about the asserts. We check these conditions in isConsecutivePtr. But just to mirror what what you said above, I think we should be able to verify them with following assert in the existing loop:
>
>   assert(i == getGEPInductionOperand(Gep) || Legal->isUniform(Gep->getOperand(i))
>
>
> What do you think?


This covers the "else" branch of the original if, but I think it doesn't cover the pointer IV case (since getGEPInductionOperand() doesn't quite do what its name implies. :-\ ).
It should probably be something like:

  assert(i == getGEPInductionOperand(Gep) || Legal->isUniform(Gep->getOperand(i) || Legal->isInductionVariable(Gep->getOperand(i)))

Regardless, I thought it would be clearer for it to be a separate NDEBUG loop, but I'm totally ok with it being in the existing loop.


Repository:
  rL LLVM

https://reviews.llvm.org/D24557





More information about the llvm-commits mailing list