This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
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: 2019-12-04 18:13 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
Comment 4 Nobody 2019-12-04 18:13:53 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1637.

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