LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 18526 - LoopVectorizer: Mistakenly vectorize multi reduction value users
Summary: LoopVectorizer: Mistakenly vectorize multi reduction value users
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: opt (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks: 16431
  Show dependency tree
 
Reported: 2014-01-17 18:53 PST by Arnold Schwaighofer
Modified: 2014-01-20 00:12 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
Test case (1.46 KB, application/octet-stream)
2014-01-17 18:53 PST, Arnold Schwaighofer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arnold Schwaighofer 2014-01-17 18:53:01 PST
Created attachment 11889 [details]
Test case

t3025 and t1519 from http://llvm.org/bugs/show_bug.cgi?id=16431#c22 are misoptimized.

As described in
http://llvm.org/bugs/show_bug.cgi?id=16431#c23

"The diff tests are vectorizer bugs (look like the same bug): t3025 and t1519. They disappear with -fno-vectorize.

Furthermore,

it seems to be the loops:

    for (k1 = 54; k1 > 2; k1--) {
        gp += gp - ((++n) + k1);

        // Test Loop Vectorization
        for (ju = 1; ju < 1; ++ju) {
            d5[ju] = ff[k1][k1];
        }

    }

and 

    for (k = 2; k < 61; ++k) {
        n += n - ((f + k7) + (nf++));
        xs5[k] = 13 + 5;
        xs5[k] += nt7--;
    }

We should not be vectorizing them. “gp” and “n” are not reductions. But we seem to :(."
Comment 1 Arnold Schwaighofer 2014-01-17 18:57:55 PST
xref rdar://15851149
Comment 2 Arnold Schwaighofer 2014-01-18 21:21:14 PST
Fixed in r199570.