Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit CSE of integer constants #10615

Merged
merged 2 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ Working version
parameter passing on PowerPC (16 registers) and on s390x (8 registers).
(Xavier Leroy, review by Mark Shinwell)

- #10591, #10615: Tune the heuristic for CSE of integer constants
so as to avoid excessive CSE on compiler-generated constants
and long register allocation times.
(Xavier Leroy, report by Edwin Török, review by Nicolás Ojeda Bär)

### Standard library:

* #7812, #10475: `Filename.chop_suffix name suff` now checks that `suff`
Expand Down
5 changes: 0 additions & 5 deletions asmcomp/arm/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ method! class_of_operation op =
| Ispecific _ -> Op_pure
| _ -> super#class_of_operation op

method! is_cheap_operation op =
match op with
| Iconst_int n -> n <= 255n && n >= 0n
| _ -> false

end

let fundecl f =
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/arm64/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ method! class_of_operation op =

method! is_cheap_operation op =
match op with
| Iconst_int n -> n <= 65535n && n >= 0n
| Iconst_int n -> n <= 0x7FFF_FFFFn && n >= -0x8000_0000n
| _ -> false

end
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/power/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ method! class_of_operation op =

method! is_cheap_operation op =
match op with
| Iconst_int n -> n <= 32767n && n >= -32768n
| Iconst_int n -> n <= 0x7FFF_FFFFn && n >= -0x8000_0000n
| _ -> false

end
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/riscv/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ method! class_of_operation op =

method! is_cheap_operation op =
match op with
| Iconst_int n -> n <= 0x7FFn && n >= -0x800n
| Iconst_int n -> n <= 0x7FFF_FFFFn && n >= -0x8000_0000n
| _ -> false

end
Expand Down