[llvm-branch-commits] [RISCV] Remove hasSideEffects=1 for saturating/fault-only-first instructions (PR #90049)

Pengcheng Wang via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 25 06:19:37 PDT 2024


https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/90049

Masking them as `hasSideEffects=1` stops some optimizations.

For saturating instructions, they may write `vxsat`. This is like
floating-point instructions that may write `fflags`, but we don't
model floating-point instructions as `hasSideEffects=1`.

For fault-only-first instructions, I think we have made its side
effect `vl` an output operand and added explict def of `VL`.

These changes make optimizations like `performCombineVMergeAndVOps`
and MachineCSE possible for these instructions.

As a consequence, `copyprop.mir` can't test what we want to test in
https://reviews.llvm.org/D155140, so we replace `vssra.vi` with a
VCIX instruction (it has side effects).





More information about the llvm-branch-commits mailing list