The *czero.nez...opt2 pattern was guarded by TARGET_ZICOND, while its
dual opt1 pattern and the base czero patterns use TARGET_ZICOND_LIKE.
Its output body already emits a vt.maskc instruction under
TARGET_XVENTANACONDOPS, but that arm was dead under the narrower guard,
so XVentanaCondOps-only targets missed this optimization.
Use TARGET_ZICOND_LIKE to match opt1.
gcc/ChangeLog:
* config/riscv/zicond.md (*czero.nez.<GPR:mode><X:mode>.opt2):
Guard with TARGET_ZICOND_LIKE instead of TARGET_ZICOND.
Signed-off-by: Jim Lin <[email protected]>
---
gcc/config/riscv/zicond.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/riscv/zicond.md b/gcc/config/riscv/zicond.md
index a890322a518..814fe767404 100644
--- a/gcc/config/riscv/zicond.md
+++ b/gcc/config/riscv/zicond.md
@@ -83,7 +83,7 @@
(const_int 0))
(match_operand:GPR 2 "register_operand" "r")
(match_operand:GPR 3 "register_operand" "1")))]
- "TARGET_ZICOND && rtx_equal_p (operands[1], operands[3])"
+ "TARGET_ZICOND_LIKE && rtx_equal_p (operands[1], operands[3])"
{
if (TARGET_ZICOND)
return "czero.eqz\t%0,%2,%1";
--
2.52.0