aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>2024-01-09 09:24:53 +0800
committerPan Li <pan2.li@intel.com>2024-01-09 18:22:14 +0800
commitdb584633e600840619bfb821d8293094ef26a668 (patch)
tree762cc680bc87c5d44fc7c59b4fb09ff45ca0e5ee /gcc
parent1413af02d62182bc1e19698aaa4dae406f8f13bf (diff)
downloadgcc-db584633e600840619bfb821d8293094ef26a668.zip
gcc-db584633e600840619bfb821d8293094ef26a668.tar.gz
gcc-db584633e600840619bfb821d8293094ef26a668.tar.bz2
RISC-V: Fix loop invariant check
As Robin suggested, remove gimple_uid check which is sufficient for our need. Tested on both RV32/RV64 no regression, ok for trunk ? gcc/ChangeLog: * config/riscv/riscv-vector-costs.cc (loop_invariant_op_p): Fix loop invariant check.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/riscv/riscv-vector-costs.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/riscv/riscv-vector-costs.cc b/gcc/config/riscv/riscv-vector-costs.cc
index 3bae581..f4a1a78 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -241,7 +241,7 @@ loop_invariant_op_p (class loop *loop,
if (SSA_NAME_IS_DEFAULT_DEF (op)
|| !flow_bb_inside_loop_p (loop, gimple_bb (SSA_NAME_DEF_STMT (op))))
return true;
- return gimple_uid (SSA_NAME_DEF_STMT (op)) & 1;
+ return false;
}
/* Return true if the variable should be counted into liveness. */