SuccessChanges

Summary

  1. [SystemZ] Fix CMakeLists.txt for alphabetical order (NFC).
  2. [SystemZ, RegAlloc] Favor 3-address instructions during instruction selection. This patch aims to reduce spilling and register moves by using the 3-address versions of instructions per default instead of the 2-address equivalent ones. It seems that both spilling and register moves are improved noticeably generally. Regalloc hints are passed to increase conversions to 2-address instructions which are done in SystemZShortenInst.cpp (after regalloc). Since the SystemZ reg/mem instructions are 2-address (dst and lhs regs are the same), foldMemoryOperandImpl() can no longer trivially fold a spilled source register since the reg/reg instruction is now 3-address. In order to remedy this, new 3-address pseudo memory instructions are used to perform the folding only when the dst and lhs virtual registers are known to be allocated to the same physreg. In order to not let MachineCopyPropagation run and change registers on these transformed instructions (making it 3-address), a new target pass called SystemZPostRewrite.cpp is run just after VirtRegRewriter, that immediately lowers the pseudo to a target instruction. If it would have been possibe to insert a COPY instruction and change a register operand (convert to 2-address) in foldMemoryOperandImpl() while trusting that the caller (e.g. InlineSpiller) would update/repair the involved LiveIntervals, the solution involving pseudo instructions would not have been needed. This is perhaps a potential improvement (see Phabricator post). Common code changes: * A new hook TargetPassConfig::addPostRewrite() is utilized to be able to run a target pass immediately before MachineCopyPropagation. * VirtRegMap is passed as an argument to foldMemoryOperand(). Review: Ulrich Weigand, Quentin Colombet https://reviews.llvm.org/D60888
Revision 362869 by jonpa:
[SystemZ]  Fix CMakeLists.txt for alphabetical order (NFC).
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/SystemZ/CMakeLists.txttrunk/lib/Target/SystemZ/CMakeLists.txt
Revision 362868 by jonpa:
[SystemZ, RegAlloc]  Favor 3-address instructions during instruction selection.

This patch aims to reduce spilling and register moves by using the 3-address
versions of instructions per default instead of the 2-address equivalent
ones. It seems that both spilling and register moves are improved noticeably
generally.

Regalloc hints are passed to increase conversions to 2-address instructions
which are done in SystemZShortenInst.cpp (after regalloc).

Since the SystemZ reg/mem instructions are 2-address (dst and lhs regs are
the same), foldMemoryOperandImpl() can no longer trivially fold a spilled
source register since the reg/reg instruction is now 3-address. In order to
remedy this, new 3-address pseudo memory instructions are used to perform the
folding only when the dst and lhs virtual registers are known to be allocated
to the same physreg. In order to not let MachineCopyPropagation run and
change registers on these transformed instructions (making it 3-address), a
new target pass called SystemZPostRewrite.cpp is run just after
VirtRegRewriter, that immediately lowers the pseudo to a target instruction.

If it would have been possibe to insert a COPY instruction and change a
register operand (convert to 2-address) in foldMemoryOperandImpl() while
trusting that the caller (e.g. InlineSpiller) would update/repair the
involved LiveIntervals, the solution involving pseudo instructions would not
have been needed. This is perhaps a potential improvement (see Phabricator
post).

Common code changes:

* A new hook TargetPassConfig::addPostRewrite() is utilized to be able to run a
target pass immediately before MachineCopyPropagation.

* VirtRegMap is passed as an argument to foldMemoryOperand().

Review: Ulrich Weigand, Quentin Colombet
https://reviews.llvm.org/D60888
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/CodeGen/TargetInstrInfo.htrunk/include/llvm/CodeGen/TargetInstrInfo.h
The file was modified/llvm/trunk/include/llvm/CodeGen/TargetPassConfig.htrunk/include/llvm/CodeGen/TargetPassConfig.h
The file was modified/llvm/trunk/lib/CodeGen/InlineSpiller.cpptrunk/lib/CodeGen/InlineSpiller.cpp
The file was modified/llvm/trunk/lib/CodeGen/TargetInstrInfo.cpptrunk/lib/CodeGen/TargetInstrInfo.cpp
The file was modified/llvm/trunk/lib/CodeGen/TargetPassConfig.cpptrunk/lib/CodeGen/TargetPassConfig.cpp
The file was modified/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpptrunk/lib/Target/AArch64/AArch64InstrInfo.cpp
The file was modified/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.htrunk/lib/Target/AArch64/AArch64InstrInfo.h
The file was modified/llvm/trunk/lib/Target/SystemZ/CMakeLists.txttrunk/lib/Target/SystemZ/CMakeLists.txt
The file was modified/llvm/trunk/lib/Target/SystemZ/SystemZ.htrunk/lib/Target/SystemZ/SystemZ.h
The file was modified/llvm/trunk/lib/Target/SystemZ/SystemZInstrFormats.tdtrunk/lib/Target/SystemZ/SystemZInstrFormats.td
The file was modified/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpptrunk/lib/Target/SystemZ/SystemZInstrInfo.cpp
The file was modified/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.htrunk/lib/Target/SystemZ/SystemZInstrInfo.h
The file was modified/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.tdtrunk/lib/Target/SystemZ/SystemZInstrInfo.td
The file was added/llvm/trunk/lib/Target/SystemZ/SystemZPostRewrite.cpptrunk/lib/Target/SystemZ/SystemZPostRewrite.cpp
The file was modified/llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpptrunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp
The file was modified/llvm/trunk/lib/Target/SystemZ/SystemZShortenInst.cpptrunk/lib/Target/SystemZ/SystemZShortenInst.cpp
The file was modified/llvm/trunk/lib/Target/SystemZ/SystemZTargetMachine.cpptrunk/lib/Target/SystemZ/SystemZTargetMachine.cpp
The file was modified/llvm/trunk/lib/Target/X86/X86InstrInfo.cpptrunk/lib/Target/X86/X86InstrInfo.cpp
The file was modified/llvm/trunk/lib/Target/X86/X86InstrInfo.htrunk/lib/Target/X86/X86InstrInfo.h
The file was modified/llvm/trunk/test/CodeGen/SystemZ/asm-18.lltrunk/test/CodeGen/SystemZ/asm-18.ll
The file was modified/llvm/trunk/test/CodeGen/SystemZ/ctpop-01.lltrunk/test/CodeGen/SystemZ/ctpop-01.ll
The file was modified/llvm/trunk/test/CodeGen/SystemZ/int-add-05.lltrunk/test/CodeGen/SystemZ/int-add-05.ll
The file was added/llvm/trunk/test/CodeGen/SystemZ/int-sub-11.lltrunk/test/CodeGen/SystemZ/int-sub-11.ll
The file was modified/llvm/trunk/test/CodeGen/SystemZ/scalar-ctlz.lltrunk/test/CodeGen/SystemZ/scalar-ctlz.ll
The file was modified/llvm/trunk/test/CodeGen/SystemZ/store_nonbytesized_vecs.lltrunk/test/CodeGen/SystemZ/store_nonbytesized_vecs.ll
The file was modified/llvm/trunk/test/CodeGen/SystemZ/vec-combine-02.lltrunk/test/CodeGen/SystemZ/vec-combine-02.ll

Summary

  1. update debugging docs to be less out of date
  2. Substantially reduce instantiations and debug size of std::function std::function uses a standard allocator to manage its memory, however standard allocators are templates and using them correctly requires a stupid amount of instantiations. This leads to a substantial increase in debug info and object sizes. This patch addresses the issue by dropping the allocator when possible and using raw new and delete to get memory. This change decreases the object file size for the test func.wrap.func.con/F.pass.cpp by 33% and the final binary by 29% (when compiled with -g -ggnu-pubnames -gpubnames). It also roughly halfs the number of entries in the pubnames and pubtype sections.
Revision 362866 by ericwf:
update debugging docs to be less out of date
Change TypePath in RepositoryPath in Workspace
The file was modified/libcxx/trunk/docs/DesignDocs/DebugMode.rsttrunk/docs/DesignDocs/DebugMode.rst
Revision 362865 by ericwf:
Substantially reduce instantiations and debug size of std::function

std::function uses a standard allocator to manage its memory, however
standard allocators are templates and using them correctly requires
a stupid amount of instantiations. This leads to a substantial increase
in debug info and object sizes.

This patch addresses the issue by dropping the allocator when possible
and using raw new and delete to get memory.

This change decreases the object file size for the test func.wrap.func.con/F.pass.cpp by 33% and the final binary by 29% (when compiled with -g -ggnu-pubnames -gpubnames).

It also roughly halfs the number of entries in the pubnames and pubtype
sections.
Change TypePath in RepositoryPath in Workspace
The file was modified/libcxx/trunk/include/__configtrunk/include/__config
The file was modified/libcxx/trunk/include/functionaltrunk/include/functional
The file was modified/libcxx/trunk/include/memorytrunk/include/memory