+<!--=========================================================================-->
+<div class="doc_subsection">
+<a name="codegen">Target Independent Code Generator Improvements</a>
+</div>
+
+<div class="doc_text">
+
+<p>We have put a significant amount of work into the code generator
+infrastructure, which allows us to implement more aggressive algorithms and make
+it run faster:</p>
+
+<ul>
+<li>The 'llc -asm-verbose' option (which is now the default) has been enhanced
+ to emit many useful comments to .s files indicating information about spill
+ slots and loop nest structure. This should make it much easier to read and
+ understand assembly files. This is wired up in llvm-gcc and clang to
+ the <tt>-fverbose-asm</tt> option.</li>
+
+<li>New LSR with "full strength reduction" mode, which can reduce address
+ register pressure in loops where address generation is important.</li>
+
+<li>A new codegen level Common Subexpression Elimination pass (MachineCSE)
+ is available and enabled by default. It catches redundancies exposed by
+ lowering.</li>
+<li>A new pre-register-allocation tail duplication pass is available and enabled
+ by default, it can substantially improve branch prediction quality in some
+ cases.</li>
+<li>A new sign and zero extension optimization pass (OptimizeExtsPass)
+ is available and enabled by default. This pass can takes advantage
+ architecture features like x86-64 implicit zero extension behavior and
+ sub-registers.</li>
+<li>The code generator now supports a mode where it attempts to preserve the
+ order of instructions in the input code. This is important for source that
+ is hand scheduled and extremely sensitive to scheduling. It is compatible
+ with the GCC <tt>-fno-schedule-insns</tt> option.</li>
+<li>The target-independent code generator now supports generating code with
+ arbitrary numbers of result values. Returning more values than was
+ previously supported is handled by returning through a hidden pointer. In
+ 2.7, only the X86 and XCore targets have adopted support for this
+ though.</li>
+<li>The code generator now supports generating code that follows the
+ <a href="LangRef.html#callingconv">Glasgow Haskell Compiler Calling
+ Convention</a> and ABI.</li>
+<li>The "<a href="CodeGenerator.html#selectiondag_select">DAG instruction
+ selection</a>" phase of the code generator has been largely rewritten for
+ 2.7. Previously, tblgen spit out tons of C++ code which was compiled and
+ linked into the target to do the pattern matching, now it emits a much
+ smaller table which is read by the target-independent code. The primary
+ advantages of this approach is that the size and compile time of various
+ targets is much improved. The X86 code generator shrunk by 1.5MB of code,
+ for example.</li>
+<li>Almost the entire code generator has switched to emitting code through the
+ MC interfaces instead of printing textually to the .s file. This led to a
+ number of cleanups and speedups. In 2.7, debug an exception handling
+ information does not go through MC yet.</li>
+</ul>
+</div>