D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21527 - Unnecessary store to memory in SIMD code
Summary: Unnecessary store to memory in SIMD code
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: backend, performance, pull, SIMD
Depends on:
Blocks:
 
Reported: 2021-01-06 10:57 UTC by Walter Bright
Modified: 2021-01-06 11:52 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Walter Bright 2021-01-06 10:57:36 UTC
The following code:

 float f(float a, float b) {
    float c = a + b;
    float d = c - b;
    return d;
 }

unnecessarily stores c into memory when it could be left in an XMM register. Compile with -m32 -O.
Comment 1 Dlang Bot 2021-01-06 11:01:16 UTC
@WalterBright created dlang/dmd pull request #12103 "fix Issue 21527 - Unnecessary store to memory in SIMD code" fixing this issue:

- fix Issue 21527 - Unnecessary store to memory in SIMD code

https://github.com/dlang/dmd/pull/12103
Comment 2 Dlang Bot 2021-01-06 11:52:53 UTC
dlang/dmd pull request #12103 "fix Issue 21527 - Unnecessary store to memory in SIMD code" was merged into master:

- 4de894dcd8022925132674643c47d2108443765f by Walter Bright:
  fix Issue 21527 - Unnecessary store to memory in SIMD code

https://github.com/dlang/dmd/pull/12103