X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FSpillPlacement.h;h=fc412f817cdb490545129c4bfd9710558a4b0fd4;hb=20df03ccd572aefadc3d68e4abc2e58c0bef9ff7;hp=9a4fc6dc970007e65af864f09b3209423643d2b2;hpb=e60f103d2d3541e57a6ca8d788e959e03b615e5f;p=oota-llvm.git diff --git a/lib/CodeGen/SpillPlacement.h b/lib/CodeGen/SpillPlacement.h index 9a4fc6dc970..fc412f817cd 100644 --- a/lib/CodeGen/SpillPlacement.h +++ b/lib/CodeGen/SpillPlacement.h @@ -71,6 +71,7 @@ public: DontCare, ///< Block doesn't care / variable not live. PrefReg, ///< Block entry/exit prefers a register. PrefSpill, ///< Block entry/exit prefers a stack slot. + PrefBoth, ///< Block entry prefers both register and stack. MustSpill ///< A register is impossible, variable must be spilled. }; @@ -79,6 +80,11 @@ public: unsigned Number; ///< Basic block number (from MBB::getNumber()). BorderConstraint Entry : 8; ///< Constraint on block entry. BorderConstraint Exit : 8; ///< Constraint on block exit. + + /// True when this block changes the value of the live range. This means + /// the block has a non-PHI def. When this is false, a live-in value on + /// the stack can be live-out on the stack without inserting a spill. + bool ChangesValue; }; /// prepare - Reset state and prepare for a new spill placement computation. @@ -96,9 +102,13 @@ public: /// live out. void addConstraints(ArrayRef LiveBlocks); - /// addPrefSpill - Add PrefSpill constraints to all blocks listed. + /// addPrefSpill - Add PrefSpill constraints to all blocks listed. This is + /// equivalent to calling addConstraint with identical BlockConstraints with + /// Entry = Exit = PrefSpill, and ChangesValue = false. + /// /// @param Blocks Array of block numbers that prefer to spill in and out. - void addPrefSpill(ArrayRef Blocks); + /// @param Strong When true, double the negative bias for these blocks. + void addPrefSpill(ArrayRef Blocks, bool Strong); /// addLinks - Add transparent blocks with the given numbers. void addLinks(ArrayRef Links);