I'm trying to create the Machine LICM pass and I have this defined:
class VISIBILITY_HIDDEN MachineLICM : public MachineFunctionPass {
...
public:
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG();
AU.addRequired<MachineLoopInfo>();
AU.addRequired<MachineDominatorTree>();
}
...
};
But when I go to use it:
bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
...
// Get our Loop information...
LI = &getAnalysis<MachineLoopInfo>();
...
for (MachineLoopInfo::iterator
I = LI->begin(), E = LI->end(); I != E; ++I) {
...
it doesn't execute the loop. In fact, the analysis is never ran. How
do I force it to be run?
-bw
On Dec 6, 2007, at 5:56 PM, Bill Wendling wrote:> I'm trying to create the Machine LICM pass and I have this defined: > > But when I go to use it: > > bool MachineLICM::runOnMachineFunction(MachineFunction &MF) { > ... > // Get our Loop information... > LI = &getAnalysis<MachineLoopInfo>(); > ... > for (MachineLoopInfo::iterator > I = LI->begin(), E = LI->end(); I != E; ++I) { > ... > > it doesn't execute the loop. In fact, the analysis is never ran. How > do I force it to be run?Maybe this is because it has runOnFunction disabled?: class MachineLoopInfo : public MachineFunctionPass { ... bool runOnFunction(Function& F) { return false; } -Chris
Fixed now! --Owen On Dec 6, 2007, at 9:30 PM, Chris Lattner wrote:> > On Dec 6, 2007, at 5:56 PM, Bill Wendling wrote: > >> I'm trying to create the Machine LICM pass and I have this defined: >> >> But when I go to use it: >> >> bool MachineLICM::runOnMachineFunction(MachineFunction &MF) { >> ... >> // Get our Loop information... >> LI = &getAnalysis<MachineLoopInfo>(); >> ... >> for (MachineLoopInfo::iterator >> I = LI->begin(), E = LI->end(); I != E; ++I) { >> ... >> >> it doesn't execute the loop. In fact, the analysis is never ran. How >> do I force it to be run? > > Maybe this is because it has runOnFunction disabled?: > > class MachineLoopInfo : public MachineFunctionPass { > ... > bool runOnFunction(Function& F) { return false; } > > -Chris > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2555 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071206/d8cd5771/attachment.bin>
Apparently Analagous Threads
- [LLVMdev] MachineLoopInfo Analysis Not Done
- [LLVMdev] Find all backedges of CFG by MachineDominatorTree. please look at my jpg.
- [LLVMdev] Find all backedges of CFG by MachineDominatorTree. please look at my jpg.
- [LLVMdev] VLIWPacketizerList: failing to schedule terminators
- [LLVMdev] Extracting libmachine from libcodegen (bug 1121)