aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>2023-01-03 15:30:30 +0800
committerKito Cheng <kito.cheng@sifive.com>2023-01-27 02:53:01 +0800
commitcca9c44eca42d71ef20fc00a261616ba66edd089 (patch)
tree50628e55413bdb5342c000b5c5ecde13c5effd15
parentaef20243b842284587023306e922e483b2401f34 (diff)
downloadgcc-cca9c44eca42d71ef20fc00a261616ba66edd089.zip
gcc-cca9c44eca42d71ef20fc00a261616ba66edd089.tar.gz
gcc-cca9c44eca42d71ef20fc00a261616ba66edd089.tar.bz2
RISC-V: Fix bugs of available condition.
Suppose there are 2 demand infos: Demand 1: demand TAIL. Demand 2: not demand TAIL. If a block is demand 1, we should adjust this block is available both for demand 1 && 2. However, if a block is demand 2, we should only adjust this block is available for demand 2 only. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (vector_insn_info::operator>=): Fix available condition.
-rw-r--r--gcc/config/riscv/riscv-vsetvl.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index f6f24f7..7e292f0 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -1048,12 +1048,10 @@ vector_insn_info::operator>= (const vector_insn_info &other) const
}
}
- if (demand_p (DEMAND_TAIL_POLICY) && !other.demand_p (DEMAND_TAIL_POLICY)
- && get_ta () != other.get_ta ())
+ if (!demand_p (DEMAND_TAIL_POLICY) && other.demand_p (DEMAND_TAIL_POLICY))
return false;
- if (demand_p (DEMAND_MASK_POLICY) && !other.demand_p (DEMAND_MASK_POLICY)
- && get_ma () != other.get_ma ())
+ if (!demand_p (DEMAND_MASK_POLICY) && other.demand_p (DEMAND_MASK_POLICY))
return false;
return true;