Add higher-level API for dealing with bundled MachineInstrs.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 7 Dec 2012 04:23:29 +0000 (04:23 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 7 Dec 2012 04:23:29 +0000 (04:23 +0000)
commitfead62d4f47795ab314ceecdac404649abb536b3
tree6371fb6f08ddbbe36196f38f7796fb104c3df515
parent641de41cb433d618c7c8eae32f9dcab800758129
Add higher-level API for dealing with bundled MachineInstrs.

This is still a work in progress. The purpose is to make bundling and
unbundling operations explicit, and to catch errors where bundles are
broken or created inadvertently.

The old IsInsideBundle flag is replaced by two MI flags: BundledPred
which has the same meaning as IsInsideBundle, and BundledSucc which is
set on instructions that are bundled with a successor. Having two flags
provdes redundancy to detect when a bundle is inadvertently torn by a
splice() or insert(), and it makes it possible to write bundle iterators
that don't need to peek at adjacent instructions.

The new flags can't be manipulated directly (once setIsInsideBundle is
gone). Instead there are MI functions to make and break bundle bonds.

The setIsInsideBundle function will be removed in a future commit. It
should be replaced by bundleWithPred().

llvm-svn: 169583
llvm/include/llvm/CodeGen/MachineInstr.h
llvm/lib/CodeGen/MachineInstr.cpp