<div dir="ltr">Hello ,<div><br></div><div>I have written a very simple MachineFunction Pass that currently does nothing. It compiles fine but when I try to load it with llc it give me following error:</div><div><p style="margin:0px;font-size:13px;line-height:normal;font-family:Hack;color:rgb(235,235,235);background-color:rgb(0,0,0)">llc -optimize-regalloc=0 -load lib/GCRA.dylib -regalloc=gc test/fibo.bc </p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Hack;color:rgb(235,235,235);background-color:rgb(0,0,0)">Pass 'Bundle Machine CFG Edges' is not initialized.</p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Hack;color:rgb(235,235,235);background-color:rgb(0,0,0)">Verify if there is a pass dependency cycle.</p></div><div><br></div><div>What is going wrong here ?</div><div>Here is my very simple code:</div><div><br></div><div><div>//===-- GCRA.cpp - Regsiter Allocator --------------------------------===//</div><div>//</div><div>//</div><div>//</div><div>//===-----------------------------------------------------------------===//</div><div>//</div><div>// This is very simple register allocator based on George and Appel.</div><div>//</div><div>//===-----------------------------------------------------------------===//</div><div><br></div><div>#include "llvm/CodeGen/Passes.h"</div><div>#include "llvm/CodeGen/MachineFunction.h"</div><div>#include "llvm/CodeGen/MachineFunctionPass.h"</div><div>#include "llvm/CodeGen/MachineInstr.h"</div><div>#include "llvm/CodeGen/MachineLoopInfo.h"</div><div>#include "llvm/CodeGen/MachineFrameInfo.h"</div><div>#include "llvm/CodeGen/MachineRegisterInfo.h"</div><div>#include "llvm/CodeGen/RegAllocRegistry.h"</div><div>#include "llvm/Target/TargetInstrInfo.h"</div><div>#include "llvm/Target/TargetMachine.h"</div><div>#define DEBUG_TYPE "gcra"</div><div>#include "llvm/Support/Debug.h"</div><div>#include "llvm/Support/Compiler.h"</div><div>#include "llvm/ADT/Statistic.h"</div><div>#include "llvm/CodeGen/VirtRegMap.h"</div><div>#include "llvm/PassAnalysisSupport.h"</div><div><br></div><div>using namespace llvm;</div><div><br></div><div>namespace {</div><div><span class="" style="white-space:pre"> </span>class GCRA : public MachineFunctionPass {</div><div><br></div><div><span class="" style="white-space:pre"> </span>public:</div><div><span class="" style="white-space:pre">            </span>static char id; // Pass Identification</div><div><br></div><div><span class="" style="white-space:pre">            </span>GCRA() : MachineFunctionPass(id) {</div><div><span class="" style="white-space:pre">                 </span></div><div><span class="" style="white-space:pre">           </span>}</div><div><br></div><div><span class="" style="white-space:pre">         </span>bool runOnMachineFunction(MachineFunction &MFn) {</div><div><span class="" style="white-space:pre">                      </span>return false;</div><div><span class="" style="white-space:pre">              </span>}</div><div><br></div><div><span class="" style="white-space:pre">         </span>void getAnalysisUsage(AnalysisUsage &AU) const {</div><div><span class="" style="white-space:pre">               </span></div><div><span class="" style="white-space:pre">           </span>}</div><div><span class="" style="white-space:pre">  </span>};</div><div><br></div><div>  char GCRA::id = 0;</div><div>  </div><div>}</div><div>  namespace llvm {</div><div>  FunctionPass *createGCRA() { return new GCRA(); }</div><div>  }</div><div><br></div><div>  static RegisterRegAlloc register_gcra("gc",</div><div><span class="" style="white-space:pre">                                 </span>"graph-coloring register allocator",</div><div><span class="" style="white-space:pre">                                     </span>createGCRA);</div><div><br></div><div>Please help!</div><div><br></div><div>Sincerely,</div><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><i><font size="2" face="monospace, monospace"><b>Vivek Pandya</b></font></i><div><br></div></div></div></div></div></div>
</div></div>