[llvm] r255691 - [LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring specific instructions.

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 13:47:44 PST 2016


I've reverted this commit in r261368 and merged that to 3.8 in r261369
to unbreak things in the meantime.

On Wed, Feb 17, 2016 at 6:48 PM, Cong Hou <congh at google.com> wrote:
> Sorry for the late reply! I am currently working in Beijing. Start
> investigating it now...
>
>
> thanks,
> Cong
>
> On Wed, Feb 17, 2016 at 10:08 AM, Hans Wennborg <hans at chromium.org> wrote:
>>
>> On Tue, Feb 16, 2016 at 11:06 AM, Hans Wennborg <hans at chromium.org> wrote:
>> > On Mon, Feb 15, 2016 at 12:28 PM, Dimitry Andric <dimitry at andric.com>
>> > wrote:
>> >> On 15 Dec 2015, at 23:45, Cong Hou via llvm-commits
>> >> <llvm-commits at lists.llvm.org> wrote:
>> >>>
>> >>> Author: conghou
>> >>> Date: Tue Dec 15 16:45:09 2015
>> >>> New Revision: 255691
>> >>>
>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=255691&view=rev
>> >>> Log:
>> >>> [LoopVectorizer] Refine loop vectorizer's register usage calculator by
>> >>> ignoring specific instructions.
>> >>>
>> >>> (This is the third attempt to check in this patch, and the first two
>> >>> are r255454
>> >>> and r255460. The once failed test file reg-usage.ll is now moved to
>> >>> test/Transform/LoopVectorize/X86 directory with target datalayout and
>> >>> target
>> >>> triple indicated.)
>> >>>
>> >>> LoopVectorizationCostModel::calculateRegisterUsage() is used to
>> >>> estimate the
>> >>> register usage for specific VFs. However, it takes into account many
>> >>> instructions that won't be vectorized, such as induction variables,
>> >>> GetElementPtr instruction, etc.. This makes the loop vectorizer too
>> >>> conservative
>> >>> when choosing VF. In this patch, the induction variables that won't be
>> >>> vectorized plus GetElementPtr instruction will be added to
>> >>> ValuesToIgnore set
>> >>> so that their register usage won't be considered any more.
>> >>>
>> >>>
>> >>> Differential revision: http://reviews.llvm.org/D15177
>> >>
>> >> This appears to have introduced a use-after-free, see
>> >> https://llvm.org/bugs/show_bug.cgi?id=26509 for the details and a valgrind
>> >> log.  Is there any way we can fix this one before 3.8 release, or revert it
>> >> otherwise?
>> >
>> > Cong, do you think this is something that's easy to fix or should we
>> > revert in the branch to be safe?
>>
>> Cong: ping?
>
>


More information about the llvm-commits mailing list