[PATCH] D40742: [LV] Fix PR34965 - Extend InstWidening with CM_Widen_Recursive

Diego Caballero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 11:18:09 PST 2017


dcaballe created this revision.

Changes to the original scalar loop during LV code gen cause the return value of Legal->isConsecutivePtr() to be inconsistent with the return value during legal/cost phases (further analysis and information of the bug is in https://reviews.llvm.org/D39346). This patch is an alternative fix to PR34965 following the CM_Widen approach proposed by Ayal and Gil in https://reviews.llvm.org/D39346. It extends InstWidening enum with CM_Widen_Reverse to properly record the widening decision for consecutive reverse memory accesses and, consequently, get rid of the Legal->isConsetuviePtr() call in LV code gen. I think this is a simpler/cleaner solution to PR34965 than the one in https://reviews.llvm.org/D39346.

Thanks,
Diego


https://reviews.llvm.org/D40742

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/consecutive-ptr-cg-bug.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40742.125179.patch
Type: text/x-patch
Size: 6003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171201/a7c71773/attachment.bin>


More information about the llvm-commits mailing list