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

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 10:24:10 PDT 2016


mkuper added a comment.

In https://reviews.llvm.org/D24557#543796, @delena wrote:

> Let's look at this GEP:
>
> getelementptr inbounds i8, i8* %ptr, i64 %ind
>
> May %ptr be not-loop-invariant and not-induction-variable?
>  It may be uniform, right?
>  In this case 
>  assert(i == getGEPInductionOperand(Gep) || Legal->isUniform(Gep->getOperand(i) || Legal->isInductionVariable(Gep->getOperand(i)))
>  should work, but
>  assert(i == getGEPInductionOperand(Gep) || PSE.getSE()->isLoopInvariant(PSE.getSCEV(Gep->getOperand(i)) || Legal->isInductionVariable(Gep->getOperand(i)))
>  will not.


I'm not sure I understand what you're saying.

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

Is exactly the check I suggested.
If you're saying it should work in all cases, then what's the problem? Or are you saying there are other cases where it's the wrong check? Or did I completely misunderstand you?


Repository:
  rL LLVM

https://reviews.llvm.org/D24557





More information about the llvm-commits mailing list