[llvm] [RISCV] Disable performCombineVMergeAndVOps for PseduoVIOTA_M. (PR #71483)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 6 20:17:23 PST 2023
================
@@ -3501,6 +3501,19 @@ bool RISCVDAGToDAGISel::performCombineVMergeAndVOps(SDNode *N) {
if (!True.isMachineOpcode())
return false;
+ // This transformation is illegal for viota.m when Mask is not a true mask.
+ switch (True->getMachineOpcode()) {
+ case RISCV::PseudoVIOTA_M_MF8:
+ case RISCV::PseudoVIOTA_M_MF4:
+ case RISCV::PseudoVIOTA_M_MF2:
+ case RISCV::PseudoVIOTA_M_M1:
+ case RISCV::PseudoVIOTA_M_M2:
+ case RISCV::PseudoVIOTA_M_M4:
+ case RISCV::PseudoVIOTA_M_M8:
+ if (Mask && !usesAllOnesMask(Mask, Glue))
+ return false;
+ }
----------------
lukel97 wrote:
Could we use that new `getRVVMCOpcode` helper
```suggestion
if (getRVVMCOpcode(True->getMachineOpcode()) == RISCV::VIOTA_M && !usesAllOnesMask(Mask, Glue))
return false;
```
https://github.com/llvm/llvm-project/pull/71483
More information about the llvm-commits
mailing list