diff options
author | Hongyu Wang <hongyu.wang@intel.com> | 2024-04-18 16:53:26 +0800 |
---|---|---|
committer | Hongyu Wang <hongyu.wang@intel.com> | 2024-07-15 14:50:33 +0800 |
commit | 681ff5ccca153864eb86099eed201838d8d98bc2 (patch) | |
tree | 130ab779d12a465e72a96b07ab203c9974274643 /gcc/tree-vect-loop.cc | |
parent | 60ba989220d9dec07d82009b0dafe684e652577f (diff) | |
download | gcc-681ff5ccca153864eb86099eed201838d8d98bc2.zip gcc-681ff5ccca153864eb86099eed201838d8d98bc2.tar.gz gcc-681ff5ccca153864eb86099eed201838d8d98bc2.tar.bz2 |
[APX NF] Add a pass to convert legacy insn to NF insns
For APX ccmp, current infrastructure will always generate cstore for
the ccmp flag user, like
cmpe %rcx, %r8
ccmpnel %rax, %rbx
seta %dil
add %rcx, %r9
add %r9, %rdx
testb %dil, %dil
je .L2
For such case, the legacy add clobbers FLAGS_REG so there should have
extra cstore to avoid the flag be reset before using it. If the
instructions between flag producer and user are NF insns, the setcc/
test sequence is not required.
Add a pass to convert legacy flag clobber insns to their NF counterpart.
The convertion only happens when
1. APX_NF enabled.
2. For a BB, cstore was find, and there are insns between such cstore
and next explicit set insn to FLAGS_REG (test or cmp).
3. All the insns found should have NF counterpart.
The pass was added after rtl-ifcvt which eliminates some branch when
profitable, which could cause some flag-clobbering insn put between
cstore and jcc.
gcc/ChangeLog:
* config/i386/i386.md (has_nf): New define_attr, add to all
nf related patterns.
* config/i386/i386-features.cc (apx_nf_convert): New function
to convert Non-NF insns to their NF counterparts.
(class pass_apx_nf_convert): New pass class.
(make_pass_apx_nf_convert): New.
* config/i386/i386-passes.def: Add pass_apx_nf_convert after
rtl_ifcvt.
* config/i386/i386-protos.h (make_pass_apx_nf_convert): Declare.
gcc/testsuite/ChangeLog:
* gcc.target/i386/apx-nf-2.c: New test.
Diffstat (limited to 'gcc/tree-vect-loop.cc')
0 files changed, 0 insertions, 0 deletions