[llvm] [SelectionDAG][RISCV] Fix break of vnsrl pattern in issue #94265 (PR #95563)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 29 09:05:03 PDT 2024
================
@@ -4339,6 +4339,21 @@ class TargetLowering : public TargetLoweringBase {
return isTypeLegal(VT);
}
+ /// Same as isTypeDesirableForOp(unsigned Opc, EVT VT), but also check if
+ /// the target is 'desirable' to truncate or extend OldVT to NewVT only using
+ /// the given node type, without the need of explicit trunc or ext. e.g. On
+ /// RISC-V Vector extension, vnsrl.wi can directly convert <n x i32> to <n x
+ /// i16> when shifting, with no extra trunc operations needed.
+ virtual bool isTypeDesirableForOpWithCast(unsigned Opc, EVT NewVT,
+ EVT OldVT) const {
----------------
RKSimon wrote:
Nearly all of those isTypeDesirableForOp calls are testing whether we should promote/truncate an existing op with the new type - including the old type as well is likely to be useful.
https://github.com/llvm/llvm-project/pull/95563
More information about the llvm-commits
mailing list