InsertBranch called unconditionally?

According to the docs, InsertBranch should only be called if
AnalyzeBranch returns success. But in targets (like ARM or Sparc) that
don't implement them, the following test fails:

According to the docs, InsertBranch should only be called if
AnalyzeBranch returns success. But in targets (like ARM or Sparc) that
don't implement them, the following test fails:

Sorry about that, I updated all targets to support InsertBranch of an uncond branch. Of course, it would be good if targets implement the rest of the branch methods: this will cause the code generator to produce better code for them.

-Chris

-----------------------------------
void %__gcov_init() {
entry:
       switch uint 0, label %cond_true.i [
                uint 0, label %UnifiedReturnBlock
                uint 875573313, label %gcov_version.exit
       ]

cond_true.i: ; preds = %entry
       ret void

gcov_version.exit: ; preds = %entry
       ret void

UnifiedReturnBlock: ; preds = %entry
       ret void
}
---------------------------------------

The error is:

llc: /home/rafael/dev/llvm/cvs/include/llvm/Target/TargetInstrInfo.h:317:
virtual void llvm::TargetInstrInfo::InsertBranch(llvm::MachineBasicBlock&,
llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, const
std::vector<llvm::MachineOperand, std::allocator<llvm::MachineOperand>

&) const: Assertion `0 && "Target didn't implement

TargetInstrInfo::InsertBranch!"' failed.
llc((anonymous namespace)::PrintStackTrace()+0x17)[0xc2f98f]
llc((anonymous namespace)::SignalHandler(int)+0x10e)[0xc2fbfc]
/lib/libc.so.6[0x2b59c5fb5110]
/lib/libc.so.6(gsignal+0x3b)[0x2b59c5fb507b]
/lib/libc.so.6(abort+0x10e)[0x2b59c5fb684e]
/lib/libc.so.6(__assert_fail+0x104)[0x2b59c5faeaf4]
llc[0x7d8149]
llc((anonymous namespace)::BranchFolder::ReplaceTailWithBranchTo(llvm::ilist_iterator<llvm::MachineInstr>,
llvm::MachineBasicBlock*)+0xe3)[0xab7ef9]
llc((anonymous namespace)::BranchFolder::TailMergeBlocks(llvm::MachineFunction&)+0x451)[0xab837b]
llc((anonymous namespace)::BranchFolder::runOnMachineFunction(llvm::MachineFunction&)+0x7d)[0xab872d]

Best Regards,
Rafael
_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-Chris