summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-04-24 01:15:27 +0000
committerMatthias Braun <matze@braunis.de>2015-04-24 01:15:27 +0000
commitf417ff95bcef5322eac52ee71a446c7c60012830 (patch)
tree04d660f78eaa4ccf84a93ffed7a8300339d8fc4c
parent6b77f549cb3fa3f543941289c5ebc2cdc88ab079 (diff)
downloadbcm5719-llvm-f417ff95bcef5322eac52ee71a446c7c60012830.tar.gz
bcm5719-llvm-f417ff95bcef5322eac52ee71a446c7c60012830.zip
Improve isTriviallyReMaterializable() documentation.
This should make it clear under which narrow circumstances implicit physreg uses are okay when rematerializing and prevent people from accidentally allowing too much when overriding isReallyTriviallyReMaterializable() even with the weaker assert in the RegisterCoalescer. llvm-svn: 235679
-rw-r--r--llvm/include/llvm/Target/TargetInstrInfo.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/llvm/include/llvm/Target/TargetInstrInfo.h b/llvm/include/llvm/Target/TargetInstrInfo.h
index 110976a0a82..f9c1e523e5a 100644
--- a/llvm/include/llvm/Target/TargetInstrInfo.h
+++ b/llvm/include/llvm/Target/TargetInstrInfo.h
@@ -67,9 +67,11 @@ public:
const TargetRegisterInfo *TRI,
const MachineFunction &MF) const;
- /// isTriviallyReMaterializable - Return true if the instruction is trivially
- /// rematerializable, meaning it has no side effects and requires no operands
- /// that aren't always available.
+ /// Return true if the instruction is trivially rematerializable, meaning it
+ /// has no side effects and requires no operands that aren't always available.
+ /// This means the only allowed uses are constants and unallocatable physical
+ /// registers so that the instructions result is independent of the place
+ /// in the function.
bool isTriviallyReMaterializable(const MachineInstr *MI,
AliasAnalysis *AA = nullptr) const {
return MI->getOpcode() == TargetOpcode::IMPLICIT_DEF ||
@@ -79,12 +81,13 @@ public:
}
protected:
- /// isReallyTriviallyReMaterializable - 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. This predicate must return false
- /// if the instruction has any side effects other than producing a value, or
- /// if it requres any address registers that are not always available.
+ /// 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. This
+ /// predicate must return false if the instruction has any side effects other
+ /// than producing a value, or if it requres any address registers that are
+ /// not always available.
+ /// Requirements must be check as stated in isTriviallyReMaterializable() .
virtual bool isReallyTriviallyReMaterializable(const MachineInstr *MI,
AliasAnalysis *AA) const {
return false;
OpenPOWER on IntegriCloud