Summary: | Possible future performance regression in x86 for 64-bit constant expansions | ||
---|---|---|---|
Product: | gcc | Reporter: | Sudakshina Das <sudi.das> |
Component: | rtl-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | enhancement | Keywords: | missed-optimization |
Priority: | P3 | ||
Version: | 8.0 | ||
Target Milestone: | --- | ||
See Also: | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82339 | ||
Host: | Target: | x86_64-*-*, i?86-*-* | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2023-08-03 00:00:00 | |
Attachments: |
test1
test2 |
Description
Sudakshina Das
2017-10-06 16:57:08 UTC
Created attachment 42318 [details]
test2
__INT64_TYPE__ f1 (__INT64_TYPE__ i) { return (((__INT64_TYPE__)1) << 63) >> i; } is already an existing missed optimization. Note the missed-optimization is that any (1 << C) >> x can be instead written as 1 << C - x iff we know that C - x > 0. For C == precision(x)-1 we can infer that directly from x being mentioned in the shift. Note the -Os regression part was improved via r8-3504-g2891beff1aa8e6 (PR 82339). |