New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 1637 - Register spilling with recent gcc & clang
Summary: Register spilling with recent gcc & clang
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - matrix products (show other bugs)
Version: unspecified
Hardware: All All
: Normal Performance Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3.4
  Show dependency treegraph
 
Reported: 2018-12-06 17:08 UTC by Gael Guennebaud
Modified: 2018-12-07 09:06 UTC (History)
2 users (show)



Attachments

Description Gael Guennebaud 2018-12-06 17:08:57 UTC
We have some performance regressions with recent compiler versions of both clang and gcc. The problem is bad register allocation leading to spilling. More precisely, here is what I found:

With AVX (no FMA):
- gcc 5:    OK
- gcc >= 6: spilling in 2pX4 kernel
- clang:    OK

With AVX+FMA:
- gcc: OK
- clang 5: OK
- clang >=6: spilling in 3pX4 kernel

With AVX512f(+FMA)
- gcc: ok
- clang: ok
Comment 1 Gael Guennebaud 2018-12-06 22:34:31 UTC
For gcc, I managed to trick it with more aggressive asm comments to isolate each "EIGEN_GEBP_ONESTEP":

asm("" : [a0] "+x" (A0), [a1] "+x" (A1) ); \


Such a trick does not work for clang.
Comment 2 Gael Guennebaud 2018-12-07 08:26:57 UTC
For gcc:
https://bitbucket.org/eigen/eigen/commits/9f52fde0348
Comment 3 Gael Guennebaud 2018-12-07 09:06:16 UTC
for clang:
https://bitbucket.org/eigen/eigen/commits/40e26d3f60fb/

I backported the two workaround to 3.3

Note You need to log in before you can comment on or make changes to this bug.