aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-10-19 21:23:22 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-10-19 21:23:22 +0000
commit4a7e72ff3e293d3fcf0a55338ec6316b3731aacb (patch)
tree56c81a5bb8979cc3df924078dcbfb328a5d9ee64 /include
parent46329b72097fe55d565d8d05b3c07dfdde04bf8e (diff)
downloadexternal_llvm-4a7e72ff3e293d3fcf0a55338ec6316b3731aacb.zip
external_llvm-4a7e72ff3e293d3fcf0a55338ec6316b3731aacb.tar.gz
external_llvm-4a7e72ff3e293d3fcf0a55338ec6316b3731aacb.tar.bz2
Local spiller optimization:
Turn a store folding instruction into a load folding instruction. e.g. xorl %edi, %eax movl %eax, -32(%ebp) movl -36(%ebp), %eax orl %eax, -32(%ebp) => xorl %edi, %eax orl -36(%ebp), %eax mov %eax, -32(%ebp) This enables the unfolding optimization for a subsequent instruction which will also eliminate the newly introduced store instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43192 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/MRegisterInfo.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h
index dd24f37..afcadc4 100644
--- a/include/llvm/Target/MRegisterInfo.h
+++ b/include/llvm/Target/MRegisterInfo.h
@@ -563,6 +563,14 @@ public:
return 0;
}
+ /// getOpcodeAfterMemoryFold - Returns the opcode of the would be new
+ /// instruction after load / store is folded into an instruction of the
+ /// specified opcode. It returns zero if the specified unfolding is not
+ /// possible.
+ virtual unsigned getOpcodeAfterMemoryFold(unsigned Opc, unsigned OpNum) const{
+ return 0;
+ }
+
/// unfoldMemoryOperand - Separate a single instruction which folded a load or
/// a a store or a load and a store into two or more instruction. If this is
/// possible, returns true as well as the new instructions by reference.
@@ -578,8 +586,9 @@ public:
}
/// getOpcodeAfterMemoryUnfold - Returns the opcode of the would be new
- /// instruction after load / store are unfolded from the specified opcode.
- /// It returns zero if the specified unfolding is impossible.
+ /// instruction after load / store are unfolded from an instruction of the
+ /// specified opcode. It returns zero if the specified unfolding is not
+ /// possible.
virtual unsigned getOpcodeAfterMemoryUnfold(unsigned Opc,
bool UnfoldLoad, bool UnfoldStore) const {
return 0;