[llvm] r235679 - Improve isTriviallyReMaterializable() documentation.
Quentin Colombet
qcolombet at apple.com
Thu Apr 23 18:26:18 PDT 2015
For the record, this is a follow-up of r235673 that we discussed offline.
Thanks Matthias,
Quentin
> On Apr 23, 2015, at 6:15 PM, Matthias Braun <matze at braunis.de> wrote:
>
> Author: matze
> Date: Thu Apr 23 20:15:27 2015
> New Revision: 235679
>
> URL: http://llvm.org/viewvc/llvm-project?rev=235679&view=rev
> Log:
> 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.
>
> Modified:
> llvm/trunk/include/llvm/Target/TargetInstrInfo.h
>
> Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=235679&r1=235678&r2=235679&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)
> +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Apr 23 20:15:27 2015
> @@ -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;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150423/6dcd0b77/attachment.html>
More information about the llvm-commits
mailing list