Description
Bugzilla Link | 11973 |
Resolution | WONTFIX |
Resolved on | Jul 01, 2017 06:17 |
Version | unspecified |
OS | Linux |
Attachments | testcase |
CC | @hfinkel,@rotateright |
Extended Description
Looking at the dumps of
clang -O2 test.c -mllvm -vectorize
-mllvm -debug-only=bb-vectorize
-mllvm -bb-vectorize-debug-pair-selection
-mllvm -bb-vectorize-debug-candidate-selection
when test.c does not contain coefficients that can be transformed into shifts, the vectorizer matches different pairable instructions than when it contains a multiple of 2.
For instance, when I replace the first write to w of the attached testcase with:
w++ = 2a - 5b + 7c;
The debugging dumps look like this:
BBV: looking at %mul = shl i8 %0, 1 <-> %3 = mul i8 %1, -5
Whereas if that first write to w is like this:
w++ = 3a - 5b + 7c;
we have the following candidate pair:
BBV: looking at %mul = mul i8 %0, 3 <-> %3 = mul i8 %1, -5
BBV: candidate pair %mul = mul i8 %0, 3 <-> %3 = mul i8 %1, -5