Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[SLP] SLP vectorizer change causes performance loss #45231

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR46261
Status NEW
Importance P normal
Reported by Wolfgang Pieb (Wolfgang_Pieb@playstation.sony.com)
Reported on 2020-06-09 14:48:10 -0700
Last modified on 2021-01-05 03:08:47 -0800
Version trunk
Hardware PC Windows NT
CC a.bataev@hotmail.com, anton.a.afanasyev@gmail.com, chfast@gmail.com, dtemirbulatov@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, paul_robinson@playstation.sony.com, spatel+llvm@rotateright.com, Vasileios.porpodas@intel.com
Fixed by commit(s)
Attachments test.cpp (1227 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 23593
Test case

After the commit https://github.com/llvm/llvm-
project/commit/6a18a9548761b266b28a49f705a568677c24b59b the attached test
experiences a roughly 50% slowdown.

Compile with clang -O2 -march=btver2.

The IR dump after SLP shows that, before the commit, a substantial number of
shuffle instructions are present, e.g.

%shuffle = shufflevector <2 x float> %14, <2 x float> undef, <4 x i32> <i32 0,
i32 0, i32 0, i32 1>

whereas after the commit, the IR dump does not show any.
Quuxplusone commented 4 years ago

Attached test.cpp (1227 bytes, text/plain): Test case

Quuxplusone commented 4 years ago

Codegen (Trunk vs 9.0): https://godbolt.org/z/sfbUSQ

Quuxplusone commented 4 years ago
It is a regression after 6a18a9548761b266b28a49f705a568677c24b59b
With updated look-ahead heuristic, we unable to find this exact set of
operations.