[llvm] [SelectionDAG][RISCV] Fix break of vnsrl pattern in issue #94265 (PR #95563)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 14 09:43:50 PDT 2024
================
@@ -4339,6 +4339,20 @@ 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 isTypeDesirableForOp(unsigned Opc, EVT NewVT, EVT OldVT) const {
----------------
arsenm wrote:
Can you use IsDesirableToPromoteOp instead?
Either way you should not add a new version of isTypeDesirableForOp. If something new is necessary, modify the existing one
https://github.com/llvm/llvm-project/pull/95563
More information about the llvm-commits
mailing list