diff options
author | Pan Li <pan2.li@intel.com> | 2024-07-18 20:16:34 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2024-07-19 08:39:21 +0800 |
commit | 02cc8494745c4235890ad58e93b5acce5a89a775 (patch) | |
tree | 3a11a58357e95d730c0030095871474dc5695b10 /libgomp/target.c | |
parent | e20ea6bcf8456b655656e50174f58a364fdb7a4e (diff) | |
download | gcc-02cc8494745c4235890ad58e93b5acce5a89a775.zip gcc-02cc8494745c4235890ad58e93b5acce5a89a775.tar.gz gcc-02cc8494745c4235890ad58e93b5acce5a89a775.tar.bz2 |
Match: Only allow single use of MIN_EXPR for SAT_TRUNC form 2 [PR115863]
The SAT_TRUNC form 2 has below pattern matching.
From:
_18 = MIN_EXPR <left_8, 4294967295>;
iftmp.0_11 = (unsigned int) _18;
To:
_18 = MIN_EXPR <left_8, 4294967295>;
iftmp.0_11 = .SAT_TRUNC (left_8);
But if there is another use of _18 like below, the transform to the
.SAT_TRUNC may have no earnings. For example:
From:
_18 = MIN_EXPR <left_8, 4294967295>; // op_0 def
iftmp.0_11 = (unsigned int) _18; // op_0
stream.avail_out = iftmp.0_11;
left_37 = left_8 - _18; // op_0 use
To:
_18 = MIN_EXPR <left_8, 4294967295>; // op_0 def
iftmp.0_11 = .SAT_TRUNC (left_8);
stream.avail_out = iftmp.0_11;
left_37 = left_8 - _18; // op_0 use
Pattern recog to .SAT_TRUNC cannot eliminate MIN_EXPR as above. Then the
backend (for example x86/riscv) will have additional 2-3 more insns
after pattern recog besides the MIN_EXPR. Thus, keep the normal truncation
as is should be the better choose.
The below testsuites are passed for this patch:
1. The rv64gcv fully regression tests.
2. The x86 bootstrap tests.
3. The x86 fully regression tests.
PR target/115863
gcc/ChangeLog:
* match.pd: Add single_use check for .SAT_TRUNC form 2.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr115863-1.c: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
Diffstat (limited to 'libgomp/target.c')
0 files changed, 0 insertions, 0 deletions