R600: rework handling of the constants

Remove Cxxx registers, add new special register - "ALU_CONST" and new
operand for each alu src - "sel". ALU_CONST is used to designate that the
new operand contains the value to override src.sel, src.kc_bank, src.chan
for constants in the driver.

Patch by: Vadim Girlin

Vincent Lejeune:
  - Use pointers for constants
  - Fold CONST_ADDRESS when possible

Tom Stellard:
  - Give CONSTANT_BUFFER_0 its own address space
  - Use integer types for constant loads

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173222 91177308-0d34-0410-b5e6-96231b3b80d8
docs: Update title of external tutorial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173224 91177308-0d34-0410-b5e6-96231b3b80d8
Remove the last of uses that use the Attribute object as a collection of attributes.

Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173228 91177308-0d34-0410-b5e6-96231b3b80d8
Add the IR attribute 'sspstrong'.

SSPStrong applies a heuristic to insert stack protectors in these situations:

* A Protector is required for functions which contain an array, regardless of
  type or length.

* A Protector is required for functions which contain a structure/union which
  contains an array, regardless of type or length.  Note, there is no limit to
  the depth of nesting.

* A protector is required when the address of a local variable (i.e., stack
  based variable) is exposed. (E.g., such as through a local whose address is
  taken as part of the RHS of an assignment or a local whose address is taken as
  part of a function argument.)

This patch implements the SSPString attribute to be equivalent to
SSPRequired. This will change in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173230 91177308-0d34-0410-b5e6-96231b3b80d8
Add the heuristic to differentiate SSPStrong from SSPRequired.

The requirements of the strong heuristic are:

* A Protector is required for functions which contain an array, regardless of
  type or length.

* A Protector is required for functions which contain a structure/union which
  contains an array, regardless of type or length.  Note, there is no limit to
  the depth of nesting.

* A protector is required when the address of a local variable (i.e., stack
  based variable) is exposed. (E.g., such as through a local whose address is
  taken as part of the RHS of an assignment or a local whose address is taken as
  part of a function argument.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173231 91177308-0d34-0410-b5e6-96231b3b80d8
DominatorTreeTest.cpp: Add the file header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173233 91177308-0d34-0410-b5e6-96231b3b80d8
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173234 91177308-0d34-0410-b5e6-96231b3b80d8
Untabify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173235 91177308-0d34-0410-b5e6-96231b3b80d8
IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately if it is not linked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173236 91177308-0d34-0410-b5e6-96231b3b80d8
IRTests/IRBuilderTest.cpp: Let GV added to the module.

It fixes --vg-leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173237 91177308-0d34-0410-b5e6-96231b3b80d8
IRTests/IRBuilderTest.cpp: GetIntTy: Delete DL at yourself since it is not linked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173238 91177308-0d34-0410-b5e6-96231b3b80d8
IRTests/WaymarkTest.cpp: Fix in --vg-leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173239 91177308-0d34-0410-b5e6-96231b3b80d8
llvm/unittests: Use OwningPtr to fix --vg-leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173240 91177308-0d34-0410-b5e6-96231b3b80d8
Initialize the components of this class.  Otherwise GCC thinks that Array may be
used uninitialized, since it fails to understand that Array is only used when
SingleValue is not, and outputs a warning.  It also seems generally safer given
that the constructor is non-trivial and has plenty of early exits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173242 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] use ADD instead of OR when applying shadow offset of PowerPC. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55975 for details

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173258 91177308-0d34-0410-b5e6-96231b3b80d8
Make sure metarenamer won't rename special stuff (intrinsics and explicitly renamed stuff).
Otherwise this might hide the problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173265 91177308-0d34-0410-b5e6-96231b3b80d8
NVPTX: Stop leaking memory by using a managed constant instead of a new Argument.

This is still an egregious hack since we don't have a nice interface for this
kind of thing but should help the valgrind leak check buildbot to become green.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173267 91177308-0d34-0410-b5e6-96231b3b80d8
Clean up assignment of CalleeSaveStackSlotSize: get rid of the default and explicitly set this in every target that needs to change it from the default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173270 91177308-0d34-0410-b5e6-96231b3b80d8
Fix powerpc test failure - forgot to initialize stack slot size for PPCLinuxMCAsmInfo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173275 91177308-0d34-0410-b5e6-96231b3b80d8
InstCombine: Clean up weird code that talks about a modulus that's long gone.

This does the right thing unless the multiplication overflows, but the old code
didn't handle that case either.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173276 91177308-0d34-0410-b5e6-96231b3b80d8