diff options
author | Sander de Smalen <sander.desmalen@arm.com> | 2023-08-07 11:33:27 +0000 |
---|---|---|
committer | Sander de Smalen <sander.desmalen@arm.com> | 2023-08-07 13:01:06 +0000 |
commit | bbb95893ded91fc2a639ea304684b22fc6f2d5a3 (patch) | |
tree | fe9846ef91dd817d3690ee5c1eca1e90bf621194 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 4097a24584121dba562d471fab97d3dfec1b5bff (diff) | |
download | llvm-bbb95893ded91fc2a639ea304684b22fc6f2d5a3.zip llvm-bbb95893ded91fc2a639ea304684b22fc6f2d5a3.tar.gz llvm-bbb95893ded91fc2a639ea304684b22fc6f2d5a3.tar.bz2 |
[TII] NFCI: Simplify the interface for isTriviallyReMaterializable
Currently `isTriviallyReMaterializable` calls
`isReallyTriviallyReMaterializable` and
`isReallyTriviallyReMaterializableGeneric`. The two interfaces
are confusing, but there are also some real issues with this.
The documentation of this function (see below) suggests that
`isReallyTriviallyRematerializable` allows the target to override the
default behaviour.
/// For instructions with opcodes for which the M_REMATERIALIZABLE flag is
/// set, this hook lets the target specify whether the instruction is actually
/// trivially rematerializable, taking into consideration its operands.
It however implements something different. The default behaviour
is the analysis done in `isReallyTriviallyReMaterializableGeneric`,
which is testing if it is safe to rematerialize the MachineInstr.
The result of `isReallyTriviallyReMaterializable` is only considered if
`isReallyTriviallyReMaterializableGeneric` returns `false`. That means
there is no way to override the default behaviour if
`isReallyTriviallyReMaterializableGeneric` returns true (i.e. it is safe to
rematerialize, but we'd rather not).
By making this a single interface, we can override the interface to do either.
Reviewed By: craig.topper, nemanjai
Differential Revision: https://reviews.llvm.org/D156520
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions