diff options
| author | Pengcheng Wang <wangpengcheng.pp@bytedance.com> | 2024-04-30 14:14:16 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-30 14:14:16 +0800 |
| commit | 940ef9687f5f19ce02b7fa5d2eb6225f458fbdd9 (patch) | |
| tree | dc214a3ead467af2068c1552fa181955a84d8b64 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
| parent | fb21343473e33e9a886b42d2fe95d1cec1cd0030 (diff) | |
| download | llvm-940ef9687f5f19ce02b7fa5d2eb6225f458fbdd9.zip llvm-940ef9687f5f19ce02b7fa5d2eb6225f458fbdd9.tar.gz llvm-940ef9687f5f19ce02b7fa5d2eb6225f458fbdd9.tar.bz2 | |
[RISCV] Remove hasSideEffects=1 for saturating/fault-only-first instructions
Marking them as `hasSideEffects=1` stops some optimizations.
According to `Target.td`:
> // 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 think that explicit Def/Use list
is kind of side effects captured by any operands of the instruction,
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.
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).
Reviewers: jacquesguan, topperc, preames, asb, lukel97
Reviewed By: topperc, lukel97
Pull Request: https://github.com/llvm/llvm-project/pull/90049
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
