[LLVMdev] Disappearing Machine Basic Blocks (for new instruction)

Edward Lee eslee3 at uiuc.edu
Fri Sep 19 16:14:47 PDT 2008


I have a new instruction that takes 2 labels, and in SelectionDAGISel,
I have it doing "CurMBB->addSuccessor()" for both machine blocks. The
DAG node it creates also takes both blocks as SDOperands.

When I lower to x86, the not-fallthrough block disappears. If I run
llc with --fast, the blocks stay around, so it must be an optimization
pass of some sort that doesn't realize my new instruction is
branch-like.

How do I tell LLVM to not delete the target blocks of my instruction?

Here's a list of files I've modified so far:
M llvm-2.3/include/llvm/CodeGen/SelectionDAGNodes.h
M llvm-2.3/include/llvm/Instruction.def
M llvm-2.3/include/llvm/Instructions.h
M llvm-2.3/include/llvm/Support/InstVisitor.h
M llvm-2.3/lib/AsmParser/LLLexer.cpp
M llvm-2.3/lib/AsmParser/llvmAsmParser.cpp.cvs
M llvm-2.3/lib/AsmParser/llvmAsmParser.h.cvs
M llvm-2.3/lib/AsmParser/llvmAsmParser.y
M llvm-2.3/lib/AsmParser/llvmAsmParser.y.cvs
M llvm-2.3/lib/Bitcode/Reader/BitcodeReader.cpp
M llvm-2.3/lib/Bitcode/Writer/BitcodeWriter.cpp
M llvm-2.3/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
M llvm-2.3/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
M llvm-2.3/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
M llvm-2.3/lib/Target/TargetSelectionDAG.td
M llvm-2.3/lib/Target/X86/X86InstrInfo.td
M llvm-2.3/lib/VMCore/Instruction.cpp
M llvm-2.3/lib/VMCore/Instructions.cpp

Ed



More information about the llvm-dev mailing list