oota-llvm.git
11 years agoR600/SI: Lower BUILD_VECTOR to REG_SEQUENCE v2
Tom Stellard [Wed, 14 Aug 2013 23:24:32 +0000 (23:24 +0000)]
R600/SI: Lower BUILD_VECTOR to REG_SEQUENCE v2

Using REG_SEQUENCE for BUILD_VECTOR rather than a series of INSERT_SUBREG
instructions should make it easier for the register allocator to coalasce
unnecessary copies.

v2:
  - Use an SGPR register class if all the operands of BUILD_VECTOR are
    SGPRs.

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

11 years agoR600/SI: Choose the correct MOV instruction for copying immediates
Tom Stellard [Wed, 14 Aug 2013 23:24:24 +0000 (23:24 +0000)]
R600/SI: Choose the correct MOV instruction for copying immediates

The instruction selector will now try to infer the destination register
so it can decided whether to use V_MOV_B32 or S_MOV_B32 when copying
immediates.

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

11 years agoR600/SI: Assign a register class to the $vaddr operand for MIMG instructions
Tom Stellard [Wed, 14 Aug 2013 23:24:17 +0000 (23:24 +0000)]
R600/SI: Assign a register class to the $vaddr operand for MIMG instructions

The previous code declared the operand as unknown:$vaddr, which made
it possible for scalar registers to be used instead of vector registers.

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

11 years ago[llvm-build] Make Py3 compatible.
Daniel Dunbar [Wed, 14 Aug 2013 23:15:39 +0000 (23:15 +0000)]
[llvm-build] Make Py3 compatible.

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

11 years agoDataFlowSanitizer: move abilist input file to Inputs.
Peter Collingbourne [Wed, 14 Aug 2013 22:28:36 +0000 (22:28 +0000)]
DataFlowSanitizer: move abilist input file to Inputs.

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

11 years agoDebugInfo: Prefer references over pointers, pass by const reference for a type that...
David Blaikie [Wed, 14 Aug 2013 22:23:05 +0000 (22:23 +0000)]
DebugInfo: Prefer references over pointers, pass by const reference for a type that will grow in the future

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

11 years agoR600/SI: Handle MSAA texture targets
Tom Stellard [Wed, 14 Aug 2013 22:22:14 +0000 (22:22 +0000)]
R600/SI: Handle MSAA texture targets

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188421 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Allow conversion between v32i8 and v8i32
Tom Stellard [Wed, 14 Aug 2013 22:22:09 +0000 (22:22 +0000)]
R600/SI: Allow conversion between v32i8 and v8i32

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188420 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Fix an obvious typo
Tom Stellard [Wed, 14 Aug 2013 22:22:03 +0000 (22:22 +0000)]
R600/SI: Fix an obvious typo

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188419 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add pattern for fp_to_uint
Tom Stellard [Wed, 14 Aug 2013 22:21:57 +0000 (22:21 +0000)]
R600/SI: Add pattern for fp_to_uint

This fixes the F2U opcode for the Mesa driver.

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188418 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[lit] Add test coverage of gtest format.
Daniel Dunbar [Wed, 14 Aug 2013 22:21:11 +0000 (22:21 +0000)]
[lit] Add test coverage of gtest format.

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

11 years ago[lit] Ensure test output is converted to strings where possible.
Daniel Dunbar [Wed, 14 Aug 2013 22:21:01 +0000 (22:21 +0000)]
[lit] Ensure test output is converted to strings where possible.

 - This cleans up the text output of failing tests when run under PY3.

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

11 years agoFix small typo: s/succ/Succ/
Mark Lacey [Wed, 14 Aug 2013 22:11:42 +0000 (22:11 +0000)]
Fix small typo: s/succ/Succ/

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

11 years agoDataFlowSanitizer: Instrumentation for memset.
Peter Collingbourne [Wed, 14 Aug 2013 20:51:38 +0000 (20:51 +0000)]
DataFlowSanitizer: Instrumentation for memset.

Differential Revision: http://llvm-reviews.chandlerc.com/D1395

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

11 years agoActually fix PPC64 64-bit GPR inline asm constraint matching
Hal Finkel [Wed, 14 Aug 2013 20:05:04 +0000 (20:05 +0000)]
Actually fix PPC64 64-bit GPR inline asm constraint matching

This is a follow-up to r187693, correcting that code to request the correct
register class. The previous version, with the wrong register class, was not
really correcting the constraints, but rather was removing them. Coincidentally,
this fixed the failing test case in r187693, but obviously created other
problems.

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

11 years agoDataFlowSanitizer: greylist is now ABI list.
Peter Collingbourne [Wed, 14 Aug 2013 18:54:12 +0000 (18:54 +0000)]
DataFlowSanitizer: greylist is now ABI list.

This replaces the old incomplete greylist functionality with an ABI
list, which can provide more detailed information about the ABI and
semantics of specific functions.  The pass treats every function in
the "uninstrumented" category in the ABI list file as conforming to
the "native" (i.e. unsanitized) ABI.  Unless the ABI list contains
additional categories for those functions, a call to one of those
functions will produce a warning message, as the labelling behaviour
of the function is unknown.  The other supported categories are
"functional", "discard" and "custom".

- "discard" -- This function does not write to (user-accessible) memory,
  and its return value is unlabelled.
- "functional" -- This function does not write to (user-accessible)
  memory, and the label of its return value is the union of the label of
  its arguments.
- "custom" -- Instead of calling the function, a custom wrapper __dfsw_F
  is called, where F is the name of the function.  This function may wrap
  the original function or provide its own implementation.

Differential Revision: http://llvm-reviews.chandlerc.com/D1345

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

11 years ago[lit] Support parsing scripts with inconsistent or invalid encodings.
Daniel Dunbar [Wed, 14 Aug 2013 18:22:41 +0000 (18:22 +0000)]
[lit] Support parsing scripts with inconsistent or invalid encodings.

 - For whatever reason, we have a lot of test files with bogus unicode
   characters. This patch allows those scripts to still be parsed on Python3 by
   changing the parsing logic to work on binary files, and only require the
   actual script commands to be convertible to ascii.

 - This patch has been tweaked to now ensure that the command strings are not of
   unicode type on Python 2.6-7.

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

11 years agoUse the MSVC __cpuid intrinsic instead of inline asm
Reid Kleckner [Wed, 14 Aug 2013 18:21:51 +0000 (18:21 +0000)]
Use the MSVC __cpuid intrinsic instead of inline asm

This works around PR16830 in LLVM when self-hosting clang on Windows.

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

11 years agoRemove unnecessary parameter to RenumberValues.
Jakob Stoklund Olesen [Wed, 14 Aug 2013 17:28:52 +0000 (17:28 +0000)]
Remove unnecessary parameter to RenumberValues.

Patch by Matthias Braun!

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

11 years agoRemove unused function.
Jakob Stoklund Olesen [Wed, 14 Aug 2013 17:28:49 +0000 (17:28 +0000)]
Remove unused function.

Patch by Matthias Braun!

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

11 years agoImprove misleading comment.
Jakob Stoklund Olesen [Wed, 14 Aug 2013 17:28:46 +0000 (17:28 +0000)]
Improve misleading comment.

Patch by Matthias Braun!

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

11 years agoRemove declaration of nonexistant function.
Jakob Stoklund Olesen [Wed, 14 Aug 2013 17:28:44 +0000 (17:28 +0000)]
Remove declaration of nonexistant function.

Patch by Matthias Braun!

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

11 years agoLiveIntervalUnion is not used in RegAllocBase.
Jakob Stoklund Olesen [Wed, 14 Aug 2013 17:28:42 +0000 (17:28 +0000)]
LiveIntervalUnion is not used in RegAllocBase.

Patch by Matthias Braun!

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

11 years agoRemove unused struct/enum
Jakob Stoklund Olesen [Wed, 14 Aug 2013 17:28:39 +0000 (17:28 +0000)]
Remove unused struct/enum

Patch by Matthias Braun!

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

11 years agollvm-symbolizer: add support for .gnu_debuglink section
Alexey Samsonov [Wed, 14 Aug 2013 17:09:30 +0000 (17:09 +0000)]
llvm-symbolizer: add support for .gnu_debuglink section

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

11 years agoLet t2LDRBi8 and t2LDRBi12 have same Base Pointer
Renato Golin [Wed, 14 Aug 2013 16:35:29 +0000 (16:35 +0000)]
Let t2LDRBi8 and t2LDRBi12 have same Base Pointer

When determining if two different loads are from the same base address,
this patch allows one load to use a t2LDRi8 address mode and another to
use a t2LDRi12 address mode. The current implementation is very
conservative and this allows the case of differing Thumb2 byte loads to
be considered. Allowing these differing modes instead of forcing the exact
same opcode is useful for situations where one opcodes loads from a base
address+1 and a second opcode loads for a base address-1.

Patch by Daniel Stewart.

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

11 years agoSphinx refuses to render this code block. Try adding a newline.
Benjamin Kramer [Wed, 14 Aug 2013 16:18:47 +0000 (16:18 +0000)]
Sphinx refuses to render this code block. Try adding a newline.

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

11 years agoExpose CRC-32 implementation from zlib
Alexey Samsonov [Wed, 14 Aug 2013 16:03:29 +0000 (16:03 +0000)]
Expose CRC-32 implementation from zlib

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

11 years agoRevert r188376, "[lit] Support parsing scripts with inconsistent or invalid encodings...
Daniel Dunbar [Wed, 14 Aug 2013 15:55:25 +0000 (15:55 +0000)]
Revert r188376, "[lit] Support parsing scripts with inconsistent or invalid encodings.", this doesn't work yet for bots using the internal shell.

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

11 years agoAdd the C99 hex-float assembly syntax to our extension document.
Tim Northover [Wed, 14 Aug 2013 15:27:20 +0000 (15:27 +0000)]
Add the C99 hex-float assembly syntax to our extension document.

As Ben pointed out, GAS doesn't support this syntax so we should give at least
some warning that it might not be portable.

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

11 years ago[lit] Support parsing scripts with inconsistent or invalid encodings.
Daniel Dunbar [Wed, 14 Aug 2013 15:24:58 +0000 (15:24 +0000)]
[lit] Support parsing scripts with inconsistent or invalid encodings.

 - For whatever reason, we have a lot of test files with bogus unicode
   characters. This patch allows those scripts to still be parsed on Python3 by
   changing the parsing logic to work on binary files, and only require the
   actual script commands to be convertible to ascii.

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

11 years agoAdd test-case for hex floating-literals
Tim Northover [Wed, 14 Aug 2013 14:55:54 +0000 (14:55 +0000)]
Add test-case for hex floating-literals

Somehow I forgot to test one of the error conditions I'd added.

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

11 years agoSupport C99 hexadecimal floating-point literals in assembly
Tim Northover [Wed, 14 Aug 2013 14:23:31 +0000 (14:23 +0000)]
Support C99 hexadecimal floating-point literals in assembly

It's useful to be able to write down floating-point numbers without having to
worry about what they'll be rounded to (as C99 discovered), this extends that
ability to the MC assembly parsers.

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

11 years agoFix a really terrifying but improbable bug in mem2reg. If you have seen
Chandler Carruth [Wed, 14 Aug 2013 08:56:41 +0000 (08:56 +0000)]
Fix a really terrifying but improbable bug in mem2reg. If you have seen
extremely subtle miscompilations (such as a load getting replaced with
the value stored *below* the load within a basic block) related to
promoting an alloca to an SSA value, there is the dim possibility that
you hit this. Please let me know if you won this unfortunate lottery.

The first half of mem2reg's core logic (as it is used both in the
standalone mem2reg pass and in SROA) builds up a mapping from
'Instruction *' to the index of that instruction within its basic block.
This allows quickly establishing which store dominate a particular load
even for large basic blocks. We cache this information throughout the
run of mem2reg over a function in order to amortize the cost of
computing it.

This is not in and of itself a strange pattern in LLVM. However, it
introduces a very important constraint: absolutely no instruction can be
deleted from the program without updating the mapping. Otherwise a newly
allocated instruction might get the same pointer address, and then end
up with a wrong index. Yes, LLVM routinely suffers from a *single
threaded* variant of the ABA problem. Most places in LLVM don't find
avoiding this an imposition because they don't both delete and create
new instructions iteratively, but mem2reg *loves* to do this... All the
time. Fortunately, the mem2reg code was really careful about updating
this cache to handle this eventuallity... except when it comes to the
debug declare intrinsic. Oops. The fix is to invalidate that pointer in
the cache when we delete it, the same as we do when deleting alloca
instructions and other instructions.

I've also caused the same bug in new code while working on a fix to
PR16867, so this seems to be a really unfortunate pattern. Hopefully in
subsequent patches the deletion of dead instructions can be consolidated
sufficiently to make it less likely that we'll see future occurences of
this bug.

Sorry for not having a test case, but I have literally no idea how to
reliably trigger this kind of thing. It may be single-threaded, but it
remains an ABA problem. It would require a really amazing number of
stars to align.

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

11 years agoMake more helper methods into static functions.
Craig Topper [Wed, 14 Aug 2013 07:53:41 +0000 (07:53 +0000)]
Make more helper methods into static functions.

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

11 years agoRemove tab characters.
Craig Topper [Wed, 14 Aug 2013 07:35:18 +0000 (07:35 +0000)]
Remove tab characters.

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

11 years agoMake some helper methods static.
Craig Topper [Wed, 14 Aug 2013 07:34:43 +0000 (07:34 +0000)]
Make some helper methods static.

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

11 years agoUse MVT in more lowering code.
Craig Topper [Wed, 14 Aug 2013 07:04:42 +0000 (07:04 +0000)]
Use MVT in more lowering code.

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

11 years agoReplace EVT with MVT in isVectorShift. Keeps compiler from generating unneeded checks...
Craig Topper [Wed, 14 Aug 2013 06:21:10 +0000 (06:21 +0000)]
Replace EVT with MVT in isVectorShift. Keeps compiler from generating unneeded checks and handling for extended types.

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

11 years agoReplace EVT with MVT in many of the shuffle lowering functions. Keeps compiler from...
Craig Topper [Wed, 14 Aug 2013 05:58:39 +0000 (05:58 +0000)]
Replace EVT with MVT in many of the shuffle lowering functions. Keeps compiler from generating unneeded checks and handling for extended types.

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

11 years ago[lit] Fix a relative import issue I missed earlier.
Daniel Dunbar [Wed, 14 Aug 2013 05:07:16 +0000 (05:07 +0000)]
[lit] Fix a relative import issue I missed earlier.

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

11 years ago[lit] Avoid StringIO.
Daniel Dunbar [Wed, 14 Aug 2013 05:07:13 +0000 (05:07 +0000)]
[lit] Avoid StringIO.
 - We barely used it, and it is very hard to use in a 2.5-3 compatible
   way because of changing expectations for its input types.

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

11 years ago[lit] Fix tests to execute lit with same python as invoked with.
Daniel Dunbar [Wed, 14 Aug 2013 05:07:09 +0000 (05:07 +0000)]
[lit] Fix tests to execute lit with same python as invoked with.

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

11 years ago[lit] Factor ShTest format script command parsing from other processing.
Daniel Dunbar [Wed, 14 Aug 2013 05:07:04 +0000 (05:07 +0000)]
[lit] Factor ShTest format script command parsing from other processing.

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

11 years ago[lit] Move executeCommand() into lit.util.
Daniel Dunbar [Wed, 14 Aug 2013 05:07:01 +0000 (05:07 +0000)]
[lit] Move executeCommand() into lit.util.

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

11 years ago[lit] Move formats into their own subpackage.
Daniel Dunbar [Wed, 14 Aug 2013 05:06:55 +0000 (05:06 +0000)]
[lit] Move formats into their own subpackage.

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

11 years ago[CMake] add_llvm_library: Specify explicit suffix .imp to import library to avoid...
NAKAMURA Takumi [Wed, 14 Aug 2013 03:34:49 +0000 (03:34 +0000)]
[CMake] add_llvm_library: Specify explicit suffix .imp to import library to avoid a warning between profile_rt-static and profile_rt-shared with lib/profile_rt.lib.

FIXME: It seems MS version of profile_rt.dll doesn't contain any export symbols.

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

11 years agoLit: Introduce "%/[STpst] into parseIntegratedTestScript(), to normalize substitutions.
NAKAMURA Takumi [Wed, 14 Aug 2013 02:26:31 +0000 (02:26 +0000)]
Lit: Introduce "%/[STpst] into parseIntegratedTestScript(), to normalize substitutions.

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

11 years ago[mips] Fix bug in parsing accumulator registers.
Akira Hatanaka [Wed, 14 Aug 2013 01:15:52 +0000 (01:15 +0000)]
[mips] Fix bug in parsing accumulator registers.

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

11 years ago[mips] Use register operands instead of register classes in DSP instruction
Akira Hatanaka [Wed, 14 Aug 2013 01:02:20 +0000 (01:02 +0000)]
[mips] Use register operands instead of register classes in DSP instruction
definitions.

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

11 years ago[mips] Rename DSPRegs.
Akira Hatanaka [Wed, 14 Aug 2013 00:53:38 +0000 (00:53 +0000)]
[mips] Rename DSPRegs.

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

11 years ago[mips] Rename HIRegs and LORegs.
Akira Hatanaka [Wed, 14 Aug 2013 00:47:08 +0000 (00:47 +0000)]
[mips] Rename HIRegs and LORegs.

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

11 years agollvm/test/CodeGen/X86/setcc-sentinals.ll: Relax expressions for x86_64-win32.
NAKAMURA Takumi [Wed, 14 Aug 2013 00:46:00 +0000 (00:46 +0000)]
llvm/test/CodeGen/X86/setcc-sentinals.ll: Relax expressions for x86_64-win32.

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

11 years agoFix always creating GEP with i32 indices
Matt Arsenault [Wed, 14 Aug 2013 00:24:38 +0000 (00:24 +0000)]
Fix always creating GEP with i32 indices

Use the pointer size if datalayout is available.
Use i64 if it's not, which is consistent with what other
places do when the pointer size is unknown.

The test doesn't really test this in a useful way
since it will be transformed to that later anyway,
but this now tests it for non-zero arrays and when
datalayout isn't available. The cases in
visitGetElementPtrInst should save an extra re-visit to
the newly created GEP since it won't need to cleanup after
itself.

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

11 years agoUse type helper functions instead of cast
Matt Arsenault [Wed, 14 Aug 2013 00:24:34 +0000 (00:24 +0000)]
Use type helper functions instead of cast

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

11 years agoUse array initializer, space around operator
Matt Arsenault [Wed, 14 Aug 2013 00:24:05 +0000 (00:24 +0000)]
Use array initializer, space around operator

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

11 years ago[mips] Properly parse registers that appear in inline-asm constraints.
Akira Hatanaka [Wed, 14 Aug 2013 00:21:25 +0000 (00:21 +0000)]
[mips] Properly parse registers that appear in inline-asm constraints.

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

11 years agoBBVectorize: Add initial stores to the write set when tracking uses
Hal Finkel [Tue, 13 Aug 2013 23:34:32 +0000 (23:34 +0000)]
BBVectorize: Add initial stores to the write set when tracking uses

When computing the use set of a store, we need to add the store to the write
set prior to iterating over later instructions. Otherwise, if there is a later
aliasing load of that store, that load will not be tagged as a use, and bad
things will happen.

trackUsesOfI still adds later dependent stores of an instruction to that
instruction's write set, but it never sees the original instruction, and so
when tracking uses of a store, the store must be added to the write set by the
caller.

Fixes PR16834.

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

11 years agoRemove duplicate copy of testcase in r188327.
Nick Lewycky [Tue, 13 Aug 2013 22:55:05 +0000 (22:55 +0000)]
Remove duplicate copy of testcase in r188327.

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

11 years agoRevert r187191, which broke opt -mem2reg on the testcases included in PR16867.
Nick Lewycky [Tue, 13 Aug 2013 22:51:58 +0000 (22:51 +0000)]
Revert r187191, which broke opt -mem2reg on the testcases included in PR16867.
However, opt -O2 doesn't run mem2reg directly so nobody noticed until r188146
when SROA started sending more things directly down the PromoteMemToReg path.

In order to revert r187191, I also revert dependent revisions r187296, r187322
and r188146. Fixes PR16867. Does not add the testcases from that PR, but both
of them should get added for both mem2reg and sroa when this revert gets
unreverted.

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

11 years ago[Mips][msa] Value types for MSA support.
Jack Carter [Tue, 13 Aug 2013 22:34:26 +0000 (22:34 +0000)]
[Mips][msa] Value types for MSA support.

Added v8f16 to ValueTypes.h, ValueTypes.cpp, ValueTypes.td,
and CodeGenTarget.cpp

Patch by Daniel Sanders

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

11 years agoOptions: explicit handling of --
Hans Wennborg [Tue, 13 Aug 2013 22:23:05 +0000 (22:23 +0000)]
Options: explicit handling of --

Clients of the option parsing library should handle it explicitly
using a KIND_REMAINING_ARGS option.

Clang and lld have been updated in r188316 and r188318, respectively.

Also fix -Wsign-compare warning in the option parsing test.

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

11 years agoDAG: Combine (and (setne X, 0), (setne X, -1)) -> (setuge (add X, 1), 2)
Jim Grosbach [Tue, 13 Aug 2013 21:30:58 +0000 (21:30 +0000)]
DAG: Combine (and (setne X, 0), (setne X, -1)) -> (setuge (add X, 1), 2)

A common idiom is to use zero and all-ones as sentinal values and to
check for both in a single conditional ("x != 0 && x != (unsigned)-1").
That generates code, for i32, like:
  testl %edi, %edi
  setne %al
  cmpl  $-1, %edi
  setne %cl
  andb  %al, %cl

With this transform, we generate the simpler:
  incl  %edi
  cmpl  $1, %edi
  seta  %al

Similar improvements for other integer sizes and on other platforms. In
general, combining the two setcc instructions into one is better.

rdar://14689217

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

11 years agoOptions: Add new option kind that consumes remaining arguments
Hans Wennborg [Tue, 13 Aug 2013 21:09:50 +0000 (21:09 +0000)]
Options: Add new option kind that consumes remaining arguments

This adds KIND_REMAINING_ARGS, a class of options that consume
all remaining arguments on the command line.

This will be used to support /link in clang-cl, which is used
to forward all remaining arguments to the linker.

It also allows us to remove the hard-coded handling of "--",
allowing clients (clang and lld) to implement that functionality
themselves with this new option class.

Differential Revision: http://llvm-reviews.chandlerc.com/D1387

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

11 years ago[Mips][msa] Added initial MSA support.
Jack Carter [Tue, 13 Aug 2013 20:54:07 +0000 (20:54 +0000)]
[Mips][msa] Added initial MSA support.

* msa SubtargetFeature
* registers
* ld.[bhwd], and st.[bhwd] instructions

Does not correctly prohibit use of both 32-bit FPU registers and MSA together.

Patch by Daniel Sanders

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

11 years ago[Mips] Support for unaligned load/store microMips instructions
Jack Carter [Tue, 13 Aug 2013 20:19:16 +0000 (20:19 +0000)]
[Mips] Support for unaligned load/store microMips instructions

This includes instructions lwl, lwr, swl and swr.

Patch by Zoran Jovnovic

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

11 years ago[lit] Support use of setup.py from other directories.
Daniel Dunbar [Tue, 13 Aug 2013 19:08:48 +0000 (19:08 +0000)]
[lit] Support use of setup.py from other directories.

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

11 years agoUpdate makeLibCall to return both the call and the chain associated with the libcall...
Michael Gottesman [Tue, 13 Aug 2013 17:54:56 +0000 (17:54 +0000)]
Update makeLibCall to return both the call and the chain associated with the libcall instead of just the call. This allows us to specify libcalls that return void.

LowerCallTo returns a pair with the return value of the call as the first
element and the chain associated with the return value as the second element. If
we lower a call that has a void return value, LowerCallTo returns an SDValue
with a NULL SDNode and the chain for the call. Thus makeLibCall by just
returning the first value makes it impossible for you to set up the chain so
that the call is not eliminated as dead code.

I also updated all references to makeLibCall to reflect the new return type.

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

11 years agoOutput DW_AT_stmt_list dwarf debug info as DW_FORM_sec_offset instead of DW_FORM_data...
Carlo Kok [Tue, 13 Aug 2013 17:46:57 +0000 (17:46 +0000)]
Output DW_AT_stmt_list dwarf debug info as DW_FORM_sec_offset instead of DW_FORM_data4 as it is a section offset (fixes the coff/dwarf debug info statement locations)

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

11 years agoFor COFF only: dwarf debug info output a label reference as a section relative item...
Carlo Kok [Tue, 13 Aug 2013 17:45:53 +0000 (17:45 +0000)]
For COFF only: dwarf debug info output a label reference as a section relative item only when it's one of dw_from strp, sec_offset, ref_addr or op_call_ref instead of going by size.

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

11 years agodfsan: fix lint warnings
Dmitry Vyukov [Tue, 13 Aug 2013 16:52:41 +0000 (16:52 +0000)]
dfsan: fix lint warnings

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

11 years agoARMv8: SWP and SWPB are obsoleted on ARMv8.
Joey Gouly [Tue, 13 Aug 2013 16:40:47 +0000 (16:40 +0000)]
ARMv8: SWP and SWPB are obsoleted on ARMv8.

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

11 years agoAlso remove logic in LateVectorize
Arnold Schwaighofer [Tue, 13 Aug 2013 16:12:04 +0000 (16:12 +0000)]
Also remove logic in LateVectorize

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

11 years agoRemove logic that decides whether to vectorize or not depending on O-levels
Arnold Schwaighofer [Tue, 13 Aug 2013 15:51:25 +0000 (15:51 +0000)]
Remove logic that decides whether to vectorize or not depending on O-levels

I have moved this logic into clang and opt.

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

11 years agoFix compiler warnings.
Evgeniy Stepanov [Tue, 13 Aug 2013 14:04:20 +0000 (14:04 +0000)]
Fix compiler warnings.

../lib/Target/X86/X86ISelLowering.cpp:9715:7: error: unused variable 'OpVT' [-Werror,-Wunused-variable]
  EVT OpVT = Op0.getValueType();
      ^
../lib/Target/X86/X86ISelLowering.cpp:9763:14: error: unused variable 'NumElems' [-Werror,-Wunused-variable]
    unsigned NumElems = VT.getVectorNumElements();

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

11 years agoFix signed overflow in when computing encodings for ADR instructions
Mihai Popa [Tue, 13 Aug 2013 14:02:13 +0000 (14:02 +0000)]
Fix signed overflow in when computing encodings for ADR instructions

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

11 years agoAVX-512: Added CMP and BLEND instructions.
Elena Demikhovsky [Tue, 13 Aug 2013 13:24:07 +0000 (13:24 +0000)]
AVX-512: Added CMP and BLEND instructions.
Lowering for SETCC.

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

11 years agoThis patch introduces changes to MipsAsmParser register parsing routines. The code...
Vladimir Medic [Tue, 13 Aug 2013 13:07:09 +0000 (13:07 +0000)]
This patch introduces changes to MipsAsmParser register parsing routines. The code now follows more deterministic path and makes the code more efficient and easier to maintain.

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

11 years agoGCC warns about removing const with a c-style cast.
Benjamin Kramer [Tue, 13 Aug 2013 09:57:55 +0000 (09:57 +0000)]
GCC warns about removing const with a c-style cast.

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

11 years agoPass DIEHash::collectAttributes output argument by-pointer instead of by-value.
Evgeniy Stepanov [Tue, 13 Aug 2013 07:57:01 +0000 (07:57 +0000)]
Pass DIEHash::collectAttributes output argument by-pointer instead of by-value.

Before this, collectAttributes() was operating on a local object.

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

11 years ago[-cxx-abi microsoft] Stick zero initialized symbols into the .bss section for COFF
David Majnemer [Tue, 13 Aug 2013 01:23:53 +0000 (01:23 +0000)]
[-cxx-abi microsoft] Stick zero initialized symbols into the .bss section for COFF

Summary:
We need to do two things:

- Initialize BSSSection in MCObjectFileInfo::InitCOFFMCObjectFileInfo
- Teach TargetLoweringObjectFileCOFF::SelectSectionForGlobal what to do
  with it

This fixes PR16861.

Reviewers: rnk

Reviewed By: rnk

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1361

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

11 years agoAdd the start of DIE hashing for DWARF4 type units and split dwarf
Eric Christopher [Tue, 13 Aug 2013 01:21:55 +0000 (01:21 +0000)]
Add the start of DIE hashing for DWARF4 type units and split dwarf
CUs.

Currently only hashes the name of CUs and the names of any children,
but it's an obvious first step to show the framework. The testcase
should continue to be correct, however, as it's an empty TU.

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

11 years agoFix an oversight in isPotentiallyReachable where we wouldn't do any CFG-walking
Nick Lewycky [Tue, 13 Aug 2013 00:03:47 +0000 (00:03 +0000)]
Fix an oversight in isPotentiallyReachable where we wouldn't do any CFG-walking
to find loops if the From and To instructions were in the same block.

Refactor the code a little now that we need to fill to start the CFG-walking
algorithm with more than one starting basic block sometimes.

Special thanks to Andrew Trick for catching an error in my understanding of
natural loops in code review.

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

11 years agoAdd comment and source to testcase.
Eric Christopher [Mon, 12 Aug 2013 23:59:26 +0000 (23:59 +0000)]
Add comment and source to testcase.

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

11 years agoReflow comment.
Eric Christopher [Mon, 12 Aug 2013 23:59:24 +0000 (23:59 +0000)]
Reflow comment.

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

11 years agoRemove empty constructor.
Eric Christopher [Mon, 12 Aug 2013 23:59:18 +0000 (23:59 +0000)]
Remove empty constructor.

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

11 years agoSlightly simplify code with helper functions
Matt Arsenault [Mon, 12 Aug 2013 23:15:58 +0000 (23:15 +0000)]
Slightly simplify code with helper functions

e.g. Use Ty->getPointerElementType()
instead of cast<PointerType>(Ty)->getElementType()

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

11 years ago[FileCheck] Fix a bug that cause FileCheck to misidentify check-prefix
Rui Ueyama [Mon, 12 Aug 2013 23:05:59 +0000 (23:05 +0000)]
[FileCheck] Fix a bug that cause FileCheck to misidentify check-prefix

FileCheck should check to make sure the prefix was found, and not a word
containing it (e.g -check-prefix=BASEREL shouldn't match NOBASEREL).

Patch by Ron Ofir.

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

11 years ago[Object/ELF] sh_type is not a bitfield. Fixes RuntimeDyld test failure on ARM.
Michael J. Spencer [Mon, 12 Aug 2013 22:59:14 +0000 (22:59 +0000)]
[Object/ELF] sh_type is not a bitfield. Fixes RuntimeDyld test failure on ARM.

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

11 years agoAdd some braces, and spaces around operators
Matt Arsenault [Mon, 12 Aug 2013 22:56:15 +0000 (22:56 +0000)]
Add some braces, and spaces around operators

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

11 years agoFix a crash with X86 Mach-O and a subtraction expression where both symbols are
Kevin Enderby [Mon, 12 Aug 2013 22:45:44 +0000 (22:45 +0000)]
Fix a crash with X86 Mach-O and a subtraction expression where both symbols are
undefined and produce an error message instead as this is a non-relocatable
expression with X86 Mach-O.

rdar://8920876

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

11 years agoReapply r188119 now that the bug it exposed is fixed.
Peter Collingbourne [Mon, 12 Aug 2013 22:38:43 +0000 (22:38 +0000)]
Reapply r188119 now that the bug it exposed is fixed.

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

11 years agoDataFlowSanitizer: fix a use-after-free. Spotted by libgmalloc.
Peter Collingbourne [Mon, 12 Aug 2013 22:38:39 +0000 (22:38 +0000)]
DataFlowSanitizer: fix a use-after-free.  Spotted by libgmalloc.

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

11 years agoR600: Set scheduling preference to Sched::Source
Tom Stellard [Mon, 12 Aug 2013 22:33:21 +0000 (22:33 +0000)]
R600: Set scheduling preference to Sched::Source

R600 doesn't need to do any scheduling on the SelectionDAG now that it
has a very good MachineScheduler.  Also, using the VLIW SelectionDAG
scheduler was having a major impact on compile times. For example with
the phatk kernel here are the LLVM IR to machine code compile times:

With Sched::VLIW

Total Compile Time:                  1.4890 Seconds (User + System)
SelectionDAG Instruction Scheduling: 1.1670 Seconds (User + System)

With Sched::Source

Total Compile Time:                  0.3330 Seconds (User + System)
SelectionDAG Instruction Scheduling: 0.0070 Seconds (User + System)

The code ouput was identical with both schedulers.  This may not be true
for all programs, but it gives me confidence that there won't be much
reduction, if any, in code quality by using Sched::Source.

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

11 years agoAdd editor C++ filetype declaration no functionality change.
Michael Gottesman [Mon, 12 Aug 2013 21:10:23 +0000 (21:10 +0000)]
Add editor C++ filetype declaration no functionality change.

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

11 years agoRevert r188188 and r188200.
Shuxin Yang [Mon, 12 Aug 2013 21:07:31 +0000 (21:07 +0000)]
Revert r188188 and r188200.

In order to appease people (in Apple) who accuse me for committing "huge change" (?) without proper review.

Thank Eric for fixing a compile-warning.

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

11 years agoFixed SelectionDAGBuilder.h C++ filetype declaration to use the canonical C++ instead...
Michael Gottesman [Mon, 12 Aug 2013 21:02:02 +0000 (21:02 +0000)]
Fixed SelectionDAGBuilder.h C++ filetype declaration to use the canonical C++ instead of c++.

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

11 years agoFixed another place in CodeGen where we had a typo in our editor C++ filetype declara...
Michael Gottesman [Mon, 12 Aug 2013 20:52:06 +0000 (20:52 +0000)]
Fixed another place in CodeGen where we had a typo in our editor C++ filetype declaration.

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

11 years ago[branchfolding] Fix typo in C++ editor declaration.
Michael Gottesman [Mon, 12 Aug 2013 20:49:27 +0000 (20:49 +0000)]
[branchfolding] Fix typo in C++ editor declaration.

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

11 years agoFix warning about unused member.
Eric Christopher [Mon, 12 Aug 2013 20:27:50 +0000 (20:27 +0000)]
Fix warning about unused member.

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