diff options
author | Eli Bendersky <eliben@google.com> | 2013-04-19 22:29:18 +0000 |
---|---|---|
committer | Eli Bendersky <eliben@google.com> | 2013-04-19 22:29:18 +0000 |
commit | 75299e3a95c0cfcade8515c603e7802351a11bee (patch) | |
tree | e46da3596b22c4fee03b305fe027f7ef8e9daa98 /include/llvm/CodeGen/FastISel.h | |
parent | 2a8bea7a8eba9bfa05dcc7a87e9152a0043841b2 (diff) | |
download | llvm-75299e3a95c0cfcade8515c603e7802351a11bee.tar.gz llvm-75299e3a95c0cfcade8515c603e7802351a11bee.tar.bz2 llvm-75299e3a95c0cfcade8515c603e7802351a11bee.tar.xz |
Move TryToFoldFastISelLoad to FastISel, where it belongs. In general, I'm
trying to move as much FastISel logic as possible out of the main path in
SelectionDAGISel - intermixing them just adds confusion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179902 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/FastISel.h')
-rw-r--r-- | include/llvm/CodeGen/FastISel.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/FastISel.h b/include/llvm/CodeGen/FastISel.h index 705db7e643..be14f749bf 100644 --- a/include/llvm/CodeGen/FastISel.h +++ b/include/llvm/CodeGen/FastISel.h @@ -123,12 +123,28 @@ public: /// index value. std::pair<unsigned, bool> getRegForGEPIndex(const Value *V); - /// TryToFoldLoad - The specified machine instr operand is a vreg, and that + /// \brief We're checking to see if we can fold \p LI the \p FoldInst. + /// Note that we could have a sequence where multiple LLVM IR instructions + /// are folded into the same machineinstr. For example we could have: + /// A: x = load i32 *P + /// B: y = icmp A, 42 + /// C: br y, ... + /// + /// In this scenario, \p LI is "A", and \p FoldInst is "C". We know + /// about "B" (and any other folded instructions) because it is between + /// A and C. + /// + /// If we succeed folding, return true. + /// + bool tryToFoldLoad(const LoadInst *LI, const Instruction *FoldInst); + + /// \brief The specified machine instr operand is a vreg, and that /// vreg is being provided by the specified load instruction. If possible, /// try to fold the load as an operand to the instruction, returning true if /// possible. - virtual bool TryToFoldLoad(MachineInstr * /*MI*/, unsigned /*OpNo*/, - const LoadInst * /*LI*/) { + /// This method should be implemented by targets. + virtual bool tryToFoldLoadIntoMI(MachineInstr * /*MI*/, unsigned /*OpNo*/, + const LoadInst * /*LI*/) { return false; } |