New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 22225 - Spec2006 403.gcc misscompare runfail with avx512 loop vectorization
Summary: Spec2006 403.gcc misscompare runfail with avx512 loop vectorization
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: opt (show other bugs)
Version: 3.6
Hardware: PC Linux
: P normal
Assignee: Elena Demikhovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-14 06:25 PST by Sergey Gvozdarev
Modified: 2015-02-18 11:09 PST (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Gvozdarev 2015-01-14 06:25:45 PST
Test 403.gcc from spec2006 started to fail after a commit:

commit 14fb445715551c6eda9146e829d0470550c8fff6
Author: Elena Demikhovsky <elena.demikhovsky@intel.com>
Date:   Tue Dec 16 11:50:42 2014 +0000

    Masked Load and Store Intrinsics in loop vectorizer.
    The loop vectorizer optimizes loops containing conditional memory
    accesses by generating masked load and store intrinsics.
    This decision is target dependent.

    http://reviews.llvm.org/D6527

Compiler options:
-O2 -ffast-math -static -m32 -mfpmath=sse -march=core-avx2

On -march=slm this test is OK.


LOG:
...
*** Miscompare of 166.s;
32309:          movq    %rbx, %rdi
                movl    $1, %r9d
            ^
32311:          movl    $.LC154, %esi
                movq    %rbx, %rdi
            ^
32312:          movl    $.LC155, %edx
                movl    $.LC154, %esi
                    ^
32313:          movl    $max_insts, %ecx
                movl    $.LC155, %edx
               ^
32314:          movl    $1, %r9d
                movl    $max_insts, %ecx
               ^
32318:          xorl    %r8d, %r8d
                movl    $.LC156, %esi
         ^
32319:          movl    $.LC156, %esi
                movl    $.LC157, %edx
                    ^
32320:          movl    $.LC157, %edx
                movl    $fastfwd_count, %ecx
               ^
32321:          movl    $fastfwd_count, %ecx
                movq    $0, (%rsp)
            ^
32322:          movl    $1, %r9d
                call    opt_reg_int
         ^

Sergey Gvozdarev
===============
Software Engineer
Intel Compiler Team
Intel
Comment 1 Elena Demikhovsky 2015-01-22 02:23:56 PST
The bug was in LoopVectorize.cpp in handling masked load/store in the case of reversed loop.
The mask should be reversed as well.
Added a test.

The bug is fixed in revision 226791.
Comment 2 Sergey Gvozdarev 2015-02-16 09:38:18 PST
Elena,

3.6 branch is still affected, please backport the patch to 3.6 branch.

Thanks
Comment 3 Hans Wennborg 2015-02-18 11:09:01 PST
(In reply to comment #2)
> Elena,
> 
> 3.6 branch is still affected, please backport the patch to 3.6 branch.
> 
> Thanks

It was merged yesterday: http://llvm.org/viewvc/llvm-project?rev=229555&view=rev