[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 20:40:30 PDT 2024


wangpc-pp wrote:

According to `Target.td`:
```c
// Does the instruction have side effects that are not captured by any
// operands of the instruction or other flags?
bit hasSideEffects = ?;
```
It seems we don't need to set `hasSideEffects` for vleNff since we have modelled `vl` as an output operand.
As for saturating instructions, I used to think that explicit `Def`/`Use` list is kind of side effects `captured by any operands of the instruction` (IIUC), so we don't need to set `hasSideEffects` either. And I have just investigated AArch64's implementation, they don't set this flag and don't add `Def` list (for example, [UQADD - Unsigned saturating Add](https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UQADD--Unsigned-saturating-Add-)):
https://github.com/llvm/llvm-project/blob/2de0bedfebb77a6c8a5b0d00902f796fa4022fd6/llvm/lib/Target/AArch64/AArch64InstrInfo.td#L5348
https://github.com/llvm/llvm-project/blob/2de0bedfebb77a6c8a5b0d00902f796fa4022fd6/llvm/lib/Target/AArch64/AArch64InstrFormats.td#L7317-L7336



https://github.com/llvm/llvm-project/pull/90049


More information about the llvm-branch-commits mailing list