diff options
author | Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp> | 2022-06-17 22:47:49 +0900 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2022-06-17 23:28:14 -0700 |
commit | 479b6f449ee999501ad6eff0b7db8d0cd5b2d28d (patch) | |
tree | 792545e37b0995be2b60a94b691461ac417038ce /gcc/expr.cc | |
parent | 5a66d7dd2bf4c99b743de65a5b0bcfab44c77305 (diff) | |
download | gcc-479b6f449ee999501ad6eff0b7db8d0cd5b2d28d.zip gcc-479b6f449ee999501ad6eff0b7db8d0cd5b2d28d.tar.gz gcc-479b6f449ee999501ad6eff0b7db8d0cd5b2d28d.tar.bz2 |
xtensa: Defer storing integer constants into litpool until reload
Storing integer constants into litpool in the early stage of compilation
hinders some integer optimizations. In fact, such integer constants are
not subject to the constant folding process.
For example:
extern unsigned short value;
extern void foo(void);
void test(void) {
if (value == 30001)
foo();
}
.literal_position
.literal .LC0, value
.literal .LC1, 30001
test:
l32r a3, .LC0
l32r a2, .LC1
l16ui a3, a3, 0
extui a2, a2, 0, 16 // runtime zero-extension despite constant
bne a3, a2, .L1
j.l foo, a9
.L1:
ret.n
This patch defers the placement of integer constants into litpool until
the start of reload:
.literal_position
.literal .LC0, value
.literal .LC1, 30001
test:
l32r a3, .LC0
l32r a2, .LC1
l16ui a3, a3, 0
bne a3, a2, .L1
j.l foo, a9
.L1:
ret.n
gcc/ChangeLog:
* config/xtensa/constraints.md (Y):
Change to include integer constants until reload begins.
* config/xtensa/predicates.md (move_operand): Ditto.
* config/xtensa/xtensa.cc (xtensa_emit_move_sequence):
Change to allow storing integer constants into litpool only after
reload begins.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions