[SelectionDAG] Relax constraints on STEP_VECTOR step operand
authorFraser Cormack <fraser@codeplay.com>
Wed, 14 Apr 2021 08:03:27 +0000 (09:03 +0100)
committerFraser Cormack <fraser@codeplay.com>
Tue, 20 Apr 2021 07:41:42 +0000 (08:41 +0100)
commit457da7f298fe0081d2b0dde8f3ca1a472ea35754
tree29aff1b3737ef8287637f81e122dcb8abfa8992c
parent4bb60c285cb3090e5fa91f585714a63618e08b4f
[SelectionDAG] Relax constraints on STEP_VECTOR step operand

This patch relaxes the requirement that the STEP_VECTOR step constant
must be of a type at least as large as the vector element type. This
does not permit its use on targets which have legal vector element types
larger than the largest legal scalar type, such as i64 vectors on RV32.

As such, the requirement has been loosened so that the step operand must
be any scalar type so long as the constant immediate is non-negative and
the value fits inside the vector element type.

This limits combining optimizations in certain circumstances but in
practice it's unlikely to be a hindrance.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D100660
llvm/include/llvm/CodeGen/ISDOpcodes.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/RISCV/rvv/stepvector-rv32.ll [deleted file]
llvm/test/CodeGen/RISCV/rvv/stepvector.ll [moved from llvm/test/CodeGen/RISCV/rvv/stepvector-rv64.ll with 91% similarity]