[llvm-commits] [llvm] r44702 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/MachineLICM.cpp lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86InstrInfo.h

Evan Cheng evan.cheng at apple.com
Sat Dec 8 13:23:12 PST 2007


Sorry, I made a mistake. The renaming is a bad idea.  Please revert.  
We should mark instructions that produce side effects. All the others  
have no side effects. Then those that do not have register operands  
are candidates for trivial remat.

Evan

On Dec 7, 2007, at 11:17 PM, Bill Wendling <isanbard at gmail.com> wrote:

> Author: void
> Date: Sat Dec  8 01:17:56 2007
> New Revision: 44702
>
> URL: http://llvm.org/viewvc/llvm-project?rev=44702&view=rev
> Log:
> Renaming:
>
>  isTriviallyReMaterializable -> hasNoSideEffects
>  isReallyTriviallyReMaterializable -> isTriviallyReMaterializable
>
> Modified:
>    llvm/trunk/include/llvm/Target/TargetInstrInfo.h
>    llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
>    llvm/trunk/lib/CodeGen/MachineLICM.cpp
>    llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
>    llvm/trunk/lib/Target/X86/X86InstrInfo.h
>
> Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=44702&r1=44701&r2=44702&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)
> +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Sat Dec  8  
> 01:17:56 2007
> @@ -288,24 +288,24 @@
>     return get(Opcode).Flags & M_HAS_OPTIONAL_DEF;
>   }
>
> -  /// isTriviallyReMaterializable - Return true if the instruction  
> is trivially
> +  /// hasNoSideEffects - Return true if the instruction is trivially
>   /// rematerializable, meaning it has no side effects and requires  
> no operands
>   /// that aren't always available.
> -  bool isTriviallyReMaterializable(MachineInstr *MI) const {
> +  bool hasNoSideEffects(MachineInstr *MI) const {
>     return (MI->getInstrDescriptor()->Flags & M_REMATERIALIZIBLE) &&
> -           isReallyTriviallyReMaterializable(MI);
> +           isTriviallyReMaterializable(MI);
>   }
>
> protected:
> -  /// isReallyTriviallyReMaterializable - For instructions with  
> opcodes for
> -  /// which the M_REMATERIALIZABLE flag is set, this function tests  
> whether the
> -  /// instruction itself is actually trivially rematerializable,  
> considering
> -  /// its operands.  This is used for targets that have  
> instructions that are
> -  /// only trivially rematerializable for specific uses.  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.
> -  virtual bool isReallyTriviallyReMaterializable(MachineInstr *MI)  
> const {
> +  /// isTriviallyReMaterializable - For instructions with opcodes  
> for which the
> +  /// M_REMATERIALIZABLE flag is set, this function tests whether the
> +  /// instruction itself is actually trivially rematerializable,  
> considering its
> +  /// operands.  This is used for targets that have instructions  
> that are only
> +  /// trivially rematerializable for specific uses.  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.
> +  virtual bool isTriviallyReMaterializable(MachineInstr *MI) const {
>     return true;
>   }
>
>
> Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=44702&r1=44701&r2=44702&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
> +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Sat Dec  8  
> 01:17:56 2007
> @@ -613,7 +613,7 @@
>     return false;
>
>   isLoad = false;
> -  if (tii_->isTriviallyReMaterializable(MI)) {
> +  if (tii_->hasNoSideEffects(MI)) {
>     isLoad = MI->getInstrDescriptor()->Flags & M_LOAD_FLAG;
>     return true;
>   }
>
> Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=44702&r1=44701&r2=44702&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Sat Dec  8 01:17:56 2007
> @@ -120,7 +120,7 @@
>       if (TID->ImplicitUses || !I.getNumOperands()) return false;
>
>       MachineOpCode Opcode = TID->Opcode;
> -      return TII->isTriviallyReMaterializable(&I) &&
> +      return TII->hasNoSideEffects(&I) &&
>         // FIXME: Below necessary?
>         !(TII->isReturn(Opcode) ||
>           TII->isTerminatorInstr(Opcode) ||
>
> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=44702&r1=44701&r2=44702&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sat Dec  8 01:17:56  
> 2007
> @@ -116,7 +116,7 @@
> }
>
>
> -bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr  
> *MI) const {
> +bool X86InstrInfo::isTriviallyReMaterializable(MachineInstr *MI)  
> const {
>   switch (MI->getOpcode()) {
>   default: break;
>   case X86::MOV8rm:
>
> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=44702&r1=44701&r2=44702&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original)
> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Sat Dec  8 01:17:56 2007
> @@ -239,7 +239,7 @@
>                    unsigned& destReg) const;
>   unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex)  
> const;
>   unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex)  
> const;
> -  bool isReallyTriviallyReMaterializable(MachineInstr *MI) const;
> +  bool isTriviallyReMaterializable(MachineInstr *MI) const;
>
>   /// convertToThreeAddress - This method must be implemented by  
> targets that
>   /// set the M_CONVERTIBLE_TO_3_ADDR flag.  When this flag is set,  
> the target
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list