diff options
author | Dan Gohman <gohman@apple.com> | 2009-10-07 17:38:06 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-10-07 17:38:06 +0000 |
commit | eef78170dfb5ee4137742e94dbb0253cdda451f8 (patch) | |
tree | d809153a8332a1292de9f01eb8cf5cfbead8297e /include | |
parent | d5ce7033ba2445d8fd13504e422afeeffb61c3d3 (diff) | |
download | external_llvm-eef78170dfb5ee4137742e94dbb0253cdda451f8.zip external_llvm-eef78170dfb5ee4137742e94dbb0253cdda451f8.tar.gz external_llvm-eef78170dfb5ee4137742e94dbb0253cdda451f8.tar.bz2 |
Replace TargetInstrInfo::isInvariantLoad and its target-specific
implementations with a new MachineInstr::isInvariantLoad, which uses
MachineMemOperands and is target-independent. This brings MachineLICM
and other functionality to targets which previously lacked an
isInvariantLoad implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 8 | ||||
-rw-r--r-- | include/llvm/Target/TargetInstrInfo.h | 10 |
2 files changed, 8 insertions, 10 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 66af73e..27265da 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -26,6 +26,7 @@ namespace llvm { +class AliasAnalysis; class TargetInstrDesc; class TargetInstrInfo; class TargetRegisterInfo; @@ -286,6 +287,13 @@ public: /// have no volatile memory references. bool hasVolatileMemoryRef() const; + /// isInvariantLoad - Return true if this instruction is loading from a + /// location whose value is invariant across the function. For example, + /// loading a value from the constant pool or from from the argument area of + /// a function if it does not change. This should only return true of *all* + /// loads the instruction does are invariant (if it does multiple loads). + bool isInvariantLoad(AliasAnalysis *AA = 0) const; + // // Debugging support // diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 2d21a9b..74a47c2 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -157,16 +157,6 @@ public: unsigned DestReg, unsigned SubIdx, const MachineInstr *Orig) const = 0; - /// isInvariantLoad - Return true if the specified instruction (which is - /// marked mayLoad) is loading from a location whose value is invariant across - /// the function. For example, loading a value from the constant pool or from - /// from the argument area of a function if it does not change. This should - /// only return true of *all* loads the instruction does are invariant (if it - /// does multiple loads). - virtual bool isInvariantLoad(const MachineInstr *MI) const { - return false; - } - /// convertToThreeAddress - This method must be implemented by targets that /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target /// may be able to convert a two-address instruction into one or more true |