oota-llvm.git
10 years agoAdd support for linking against a curses library when available and
Chandler Carruth [Wed, 7 Aug 2013 08:47:36 +0000 (08:47 +0000)]
Add support for linking against a curses library when available and
using it to detect whether or not a terminal supports colors. This
replaces a particularly egregious hack that merely compared the TERM
environment variable to "dumb". That doesn't really translate to
a reasonable experience for users that have actually ensured their
terminal's capabilities are accurately reflected.

This makes testing a terminal for color support somewhat more expensive,
but it is called very rarely anyways. The important fast path when the
output is being piped somewhere is already in place.

The global lock may seem excessive, but the spec for calling into curses
is *terrible*. The whole library is terrible, and I spent quite a bit of
time looking for a better way of doing this before convincing myself
that this was the fundamentally correct way to behave. The damage of the
curses library is very narrowly confined, and we continue to use raw
escape codes for actually manipulating the colors which is a much sane
system than directly using curses here (IMO).

If this causes trouble for folks, please let me know. I've tested it on
Linux and will watch the bots carefully. I've also worked to account for
the variances of curses interfaces that I could finde documentation for,
but that may not have been sufficient.

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

10 years agoRemove some parens. No functional change.
Eric Christopher [Wed, 7 Aug 2013 08:35:10 +0000 (08:35 +0000)]
Remove some parens. No functional change.

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

10 years agoSimplify code. No functional change intended.
Craig Topper [Wed, 7 Aug 2013 08:16:07 +0000 (08:16 +0000)]
Simplify code. No functional change intended.

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

10 years agoInitialize SIInsertWaits::ExpInstrTypesSeen in the pass constructor.
Evgeniy Stepanov [Wed, 7 Aug 2013 07:47:41 +0000 (07:47 +0000)]
Initialize SIInsertWaits::ExpInstrTypesSeen in the pass constructor.

This value may be used uninitialized in SIInsertWaits::insertWait.
Found with MemorySanitizer.

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

10 years agoRemove the assertion for now. This breaks lld.
Dmitri Gribenko [Wed, 7 Aug 2013 07:12:08 +0000 (07:12 +0000)]
Remove the assertion for now.  This breaks lld.

lld has a hashtable with StringRef keys; it needs to iterate over the keys in
*insertion* order.  This is currently implemented as std::vector<StringRef> +
DenseMap<StringRef, T>.  This will probably need a proper
DenseMapInfo<StringRef> if we don't want to lose memory/performance by
migrating to a different data structure.

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

10 years agoLLVM Interpreter: MIPS tests should pass
Elena Demikhovsky [Wed, 7 Aug 2013 06:13:21 +0000 (06:13 +0000)]
LLVM Interpreter: MIPS tests should pass

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

10 years agoYAMLTraits.h: replace DenseMap that used a bad implementation of DenseMapInfo
Dmitri Gribenko [Wed, 7 Aug 2013 05:51:27 +0000 (05:51 +0000)]
YAMLTraits.h: replace DenseMap that used a bad implementation of DenseMapInfo
for StringRef with a StringMap

The bug is that the empty key compares equal to the tombstone key.

Also added an assertion to DenseMap to catch similar bugs in future.

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

10 years agoChange public functions of LTOCodeGenerator from ret-false-on-succ to ret-true-on...
Shuxin Yang [Wed, 7 Aug 2013 05:19:23 +0000 (05:19 +0000)]
Change public functions of LTOCodeGenerator from ret-false-on-succ to ret-true-on-succ.

As of this revision, all functions of LTOCodeGenerator are consistent in
ret-true-on-succ.

Tested on multiple OSes.

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

10 years agoCreate a pattern for the "trap" instruction.
Reed Kotler [Wed, 7 Aug 2013 04:00:26 +0000 (04:00 +0000)]
Create a pattern for the "trap" instruction.

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

10 years ago[lit] Use py2&3 compatible exec() syntax.
Daniel Dunbar [Wed, 7 Aug 2013 03:25:28 +0000 (03:25 +0000)]
[lit] Use py2&3 compatible exec() syntax.

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

10 years ago[lit] Use newer StringIO class.
Daniel Dunbar [Wed, 7 Aug 2013 03:24:20 +0000 (03:24 +0000)]
[lit] Use newer StringIO class.

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

10 years ago[lit] Use modern absolute/relative import style.
Daniel Dunbar [Wed, 7 Aug 2013 03:23:12 +0000 (03:23 +0000)]
[lit] Use modern absolute/relative import style.

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

10 years ago[lit] Avoid __cmp__ and cmp().
Daniel Dunbar [Wed, 7 Aug 2013 03:22:02 +0000 (03:22 +0000)]
[lit] Avoid __cmp__ and cmp().

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

10 years ago[lit] Avoid use of iterator .next() method.
Daniel Dunbar [Wed, 7 Aug 2013 03:20:54 +0000 (03:20 +0000)]
[lit] Avoid use of iterator .next() method.

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

10 years ago[lit] Use .write() methods instead of print statement.
Daniel Dunbar [Wed, 7 Aug 2013 03:19:45 +0000 (03:19 +0000)]
[lit] Use .write() methods instead of print statement.

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

10 years ago[lit] Use dual-compatible print() syntax where possible.
Daniel Dunbar [Wed, 7 Aug 2013 03:18:36 +0000 (03:18 +0000)]
[lit] Use dual-compatible print() syntax where possible.

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

10 years ago[lit] Remove use of deprecated parameter tuple unpacking.
Daniel Dunbar [Wed, 7 Aug 2013 03:17:27 +0000 (03:17 +0000)]
[lit] Remove use of deprecated parameter tuple unpacking.

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

10 years ago[lit] Remove uses of deprecated except syntax.
Daniel Dunbar [Wed, 7 Aug 2013 03:16:19 +0000 (03:16 +0000)]
[lit] Remove uses of deprecated except syntax.

 - Since we only have a few of these, use the cumbersome method of getting the
   exception object from 'sys' to retain the current pre-2.6 compatibility.

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

10 years ago[lit] Use more modern syntax for constructing exceptions.
Daniel Dunbar [Wed, 7 Aug 2013 03:15:10 +0000 (03:15 +0000)]
[lit] Use more modern syntax for constructing exceptions.

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

10 years ago[lit] Drop --no-execute, which isn't generally useful.
Daniel Dunbar [Wed, 7 Aug 2013 03:14:00 +0000 (03:14 +0000)]
[lit] Drop --no-execute, which isn't generally useful.

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

10 years ago[lit] tests: Change discovery test to use --show-tests.
Daniel Dunbar [Wed, 7 Aug 2013 03:12:51 +0000 (03:12 +0000)]
[lit] tests: Change discovery test to use --show-tests.

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

10 years ago[lit] Add a --show-tests option.
Daniel Dunbar [Wed, 7 Aug 2013 03:11:42 +0000 (03:11 +0000)]
[lit] Add a --show-tests option.

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

10 years ago[lit] Remove dead ignoreStdError argument.
Daniel Dunbar [Wed, 7 Aug 2013 03:08:46 +0000 (03:08 +0000)]
[lit] Remove dead ignoreStdError argument.

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

10 years agoDisabled columnWidth test for OSX, need someone with Mac to deal with this effectively.
Alexander Kornienko [Wed, 7 Aug 2013 02:08:31 +0000 (02:08 +0000)]
Disabled columnWidth test for OSX, need someone with Mac to deal with this effectively.

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

10 years agoUse correct platform detection macro: __MACOSX__ -> __APPLE__
Alexander Kornienko [Wed, 7 Aug 2013 01:23:28 +0000 (01:23 +0000)]
Use correct platform detection macro: __MACOSX__ -> __APPLE__

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

10 years agoFix boolean logic in LockFileManager and test it
Reid Kleckner [Wed, 7 Aug 2013 01:22:04 +0000 (01:22 +0000)]
Fix boolean logic in LockFileManager and test it

This fixes a bug from r187826.

Reviewers: hans

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

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

10 years agoAvoid using alloca in Windows/Program.inc
Reid Kleckner [Wed, 7 Aug 2013 01:21:33 +0000 (01:21 +0000)]
Avoid using alloca in Windows/Program.inc

One use needs to copy the alloca into a std::string, and the other use
is before calling CreateProcess, which is very heavyweight anyway.

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

10 years agoAdd a way to grab a particular attribute out of a DIE.
Eric Christopher [Wed, 7 Aug 2013 01:18:33 +0000 (01:18 +0000)]
Add a way to grab a particular attribute out of a DIE.
Use it when we're looking for a string in particular. Update comments
as well.

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

10 years agoMove somewhat messy conditional out of line.
Eric Christopher [Wed, 7 Aug 2013 01:18:24 +0000 (01:18 +0000)]
Move somewhat messy conditional out of line.
No functional change.

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

10 years agoDisable tests on WIN32 (which has incorrect implementation of isPrint and
Alexander Kornienko [Wed, 7 Aug 2013 00:41:18 +0000 (00:41 +0000)]
Disable tests on WIN32 (which has incorrect implementation of isPrint and
columnWidth), and partially disable tests on MACOSX (which handles some
characters differently).

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

10 years agoCheck for _strtoi64 in the cmake build if strtoll is missing
Reid Kleckner [Wed, 7 Aug 2013 00:29:15 +0000 (00:29 +0000)]
Check for _strtoi64 in the cmake build if strtoll is missing

Previously this check was guarded by MSVC, which doesn't distinguish
between the compiler and the headers/library.  This enables clang to
compile more of LLVM on Windows with Microsoft headers.

Remove some unused macros while I'm here: error_t and LTDL stuff.

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

10 years agoRemove unused functions introduced in r172685 to unbreak the Clang -Werror build
David Blaikie [Wed, 7 Aug 2013 00:25:12 +0000 (00:25 +0000)]
Remove unused functions introduced in r172685 to unbreak the Clang -Werror build

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

10 years agoImplemented llvm::sys::locale::columnWidth and isPrint for the case of generic UTF8...
Alexander Kornienko [Wed, 7 Aug 2013 00:07:07 +0000 (00:07 +0000)]
Implemented llvm::sys::locale::columnWidth and isPrint for the case of generic UTF8-capable terminal.

Summary:
This is a second attempt to get this right. After reading the Unicode
Standard I came up with the code that uses definitions of "printable" and
"column width" more suitable for terminal output (i.e. fixed-width fonts and
special treatment of many control characters).
The implementation here can probably be used for Windows and MacOS if someone
can test it properly.
The patch addresses PR14910.

Reviewers: jordan_rose, gribozavr

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

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

10 years agoReplacing /GR with /GR- instead of applying both options to the project. This should...
Aaron Ballman [Tue, 6 Aug 2013 23:34:04 +0000 (23:34 +0000)]
Replacing /GR with /GR- instead of applying both options to the project.  This should reduce some build bot warnings (D9025: "overriding '/GR' with '/GR-'").

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

10 years agoR600: Add new file from r187831 to CMakeLists.txt
Tom Stellard [Tue, 6 Aug 2013 23:12:34 +0000 (23:12 +0000)]
R600: Add new file from r187831 to CMakeLists.txt

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

10 years ago[mips] Rename register classes CPURegs and CPU64Regs.
Akira Hatanaka [Tue, 6 Aug 2013 23:08:38 +0000 (23:08 +0000)]
[mips] Rename register classes CPURegs and CPU64Regs.

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

10 years agoR600/SI: Use VSrc_* register classes as the default classes for types
Tom Stellard [Tue, 6 Aug 2013 23:08:28 +0000 (23:08 +0000)]
R600/SI: Use VSrc_* register classes as the default classes for types

Since the VSrc_* register classes contain both VGPRs and SGPRs, copies
that used be emitted by isel like this:

SGPR = COPY VGPR

Will now be emitted like this:

VSrC = COPY VGPR

This patch also adds a pass that tries to identify and fix situations where
a VGPR to SGPR copy may occur.  Hopefully, these changes will make it
impossible for the compiler to generate illegal VGPR to SGPR copies.

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

10 years agoR600/SI: Add more special cases for opcodes to ensureSRegLimit()
Tom Stellard [Tue, 6 Aug 2013 23:08:18 +0000 (23:08 +0000)]
R600/SI: Add more special cases for opcodes to ensureSRegLimit()

Also factor out the register class lookup to its own function.

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

10 years ago[NVPTX] We dont have any target specific flags yet for generating symbol references...
Justin Holewinski [Tue, 6 Aug 2013 23:06:42 +0000 (23:06 +0000)]
[NVPTX] We dont have any target specific flags yet for generating symbol references, so get rid of the default-only switch statement.  Fixes an MSVC warning.

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

10 years ago[mips] Mark instructions defined in Mips64InstrInfo.td that are duplicates of
Akira Hatanaka [Tue, 6 Aug 2013 23:01:10 +0000 (23:01 +0000)]
[mips] Mark instructions defined in Mips64InstrInfo.td that are duplicates of
instructions defined in MipsInstrInfo.td as codegen-only instructions.

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

10 years agoChange the linkage of these global values to 'internal'.
Bill Wendling [Tue, 6 Aug 2013 22:52:42 +0000 (22:52 +0000)]
Change the linkage of these global values to 'internal'.

The globals being generated here were given the 'private' linkage type. However,
this caused them to end up in different sections with the wrong prefix. E.g.,
they would be in the __TEXT,__const section with an 'L' prefix instead of an 'l'
(lowercase ell) prefix.

The problem is that the linker will eat a literal label with 'L'. If a weak
symbol is then placed into the __TEXT,__const section near that literal, then it
cannot distinguish between the literal and the weak symbol.

Part of the problems here was introduced because the address sanitizer converted
some C strings into constant initializers with trailing nuls. (Thus putting them
in the __const section with the wrong prefix.) The others were variables that
the address sanitizer created but simply had the wrong linkage type.

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

10 years agoRemove some std stream usage from Support and TableGen
Reid Kleckner [Tue, 6 Aug 2013 22:51:21 +0000 (22:51 +0000)]
Remove some std stream usage from Support and TableGen

LLVM's coding standards recommend raw_ostream and MemoryBuffer for
reading and writing text.

This has the side effect of allowing clang to compile more of Support
and TableGen in the Microsoft C++ ABI.

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

10 years agoLoopVectorize: Allow vectorization of loops with lifetime markers
Arnold Schwaighofer [Tue, 6 Aug 2013 22:37:52 +0000 (22:37 +0000)]
LoopVectorize: Allow vectorization of loops with lifetime markers

Patch by Marc Jessome!

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

10 years ago[mips] Delete unnecessary InstAliases. Also, clear some of the InstAlias'
Akira Hatanaka [Tue, 6 Aug 2013 22:35:29 +0000 (22:35 +0000)]
[mips] Delete unnecessary InstAliases. Also, clear some of the InstAlias'
EmitAlias flag and have MipsInstPrinter::printAlias print the aliases.

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

10 years ago[mips] Replace usages of register classes with register operands. Also, remove
Akira Hatanaka [Tue, 6 Aug 2013 22:20:40 +0000 (22:20 +0000)]
[mips] Replace usages of register classes with register operands. Also, remove
unnecessary jalr InstAliases in Mips64InstrInfo.td and add the code to print
jalr InstAliases in MipsInstPrinter::printAlias.

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

10 years agoChange private functions of LTOCodeGenerator from ret-false-on-succ to ret-true-on...
Shuxin Yang [Tue, 6 Aug 2013 21:51:21 +0000 (21:51 +0000)]
Change private functions of LTOCodeGenerator from ret-false-on-succ to ret-true-on-succ.

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

10 years agoUse gnu style builtins in MathExtras.h with clang on Windows
Reid Kleckner [Tue, 6 Aug 2013 19:45:27 +0000 (19:45 +0000)]
Use gnu style builtins in MathExtras.h with clang on Windows

Clang does not provide BitScan* intrinsic implementations yet.

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

10 years agoDebug Info Finder|Verifier: handle DbgLoc attached to instructions.
Manman Ren [Tue, 6 Aug 2013 19:38:43 +0000 (19:38 +0000)]
Debug Info Finder|Verifier: handle DbgLoc attached to instructions.

Also remove checking of llvm.dbg.sp since it is not used in generating dwarf.

Current state of Finder:
DebugInfoFinder tries to list all debug info MDNodes used in a module. To
list debug info MDNodes used by an instruction, DebugInfoFinder provides
processDeclare, processValue and processLocation to handle DbgDeclareInst,
DbgValueInst and DbgLoc attached to instructions. processModule will go
through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
used by the CUs.

TODO:
1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We
need to add a list of variables that are used by DbgDeclareInst and
DbgValueInst.
2> MDString fields should be null or isa<MDString> and MDNode fields should be
null or isa<MDNode>. We currently use empty string or int 0 to represent null.
3> Go though Verify functions and make sure that they check field types.
4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each
testing case has a llvm.dbg.cu.

Re-apply r187609 with fix to pass ocaml binding. vmcore.ml generates a debug
location with scope being metadata !{}, in verifier we treat this as a null
scope.

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

10 years ago[LangRef] Alphabetize function attribute listing.
Sean Silva [Tue, 6 Aug 2013 19:34:37 +0000 (19:34 +0000)]
[LangRef] Alphabetize function attribute listing.

No content change.

Patch by Andrea Di Biagio!

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

10 years agoAdjust file to the coding standard.
Jakub Staszak [Tue, 6 Aug 2013 17:03:42 +0000 (17:03 +0000)]
Adjust file to the coding standard.

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

10 years agoAdd PPC64 mulli pattern
Hal Finkel [Tue, 6 Aug 2013 17:03:03 +0000 (17:03 +0000)]
Add PPC64 mulli pattern

The PPC backend had been missing a pattern to generate mulli for 64-bit
multiples. We had been generating it only for 32-bit multiplies. Unfortunately,
generating li + mulld unnecessarily increases register pressure.

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

10 years agoRemove extraneous semicolon.
Jakub Staszak [Tue, 6 Aug 2013 16:40:40 +0000 (16:40 +0000)]
Remove extraneous semicolon.

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

10 years agoThis corrects creation of operands for t2PLDW. It also removes the definition of...
Mihai Popa [Tue, 6 Aug 2013 16:07:46 +0000 (16:07 +0000)]
This corrects creation of operands for t2PLDW. It also removes the definition of t2PLDWpci,
as pldw does not have a literal variant (i.e. pc relative version)

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

10 years agoSupport APSR_nzcv as operand for Thumb2 mrc. Deprecate pre-UAL syntax (pc instead...
Mihai Popa [Tue, 6 Aug 2013 15:52:36 +0000 (15:52 +0000)]
Support APSR_nzcv as operand for Thumb2 mrc. Deprecate pre-UAL syntax (pc instead of apsr_nzcv)

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

10 years ago[NVPTX] Add missing patterns for i1 [s,u]int_to_fp
Justin Holewinski [Tue, 6 Aug 2013 14:13:34 +0000 (14:13 +0000)]
[NVPTX] Add missing patterns for i1 [s,u]int_to_fp

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

10 years ago[NVPTX] Fix bug in stack code generation causes by MC conversion
Justin Holewinski [Tue, 6 Aug 2013 14:13:31 +0000 (14:13 +0000)]
[NVPTX] Fix bug in stack code generation causes by MC conversion

We do use a very small set of physical registers, so account for
them in the virtual register encoding between MachineInstr and MC

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

10 years ago[NVPTX] Start conversion to MC infrastructure
Justin Holewinski [Tue, 6 Aug 2013 14:13:27 +0000 (14:13 +0000)]
[NVPTX] Start conversion to MC infrastructure

This change converts the NVPTX target to use the MC infrastructure
instead of directly emitting MachineInstr instances. This brings
the target more up-to-date with LLVM TOT, and should fix PR15175
and PR15958 (libNVPTXInstPrinter is empty) as a side-effect.

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

10 years agoARM: implement allowTruncateForTailCall
Tim Northover [Tue, 6 Aug 2013 13:58:03 +0000 (13:58 +0000)]
ARM: implement allowTruncateForTailCall

Now that it's in place, it seems silly not to let ARM make use of the extra
tail call opportunities.

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

10 years agoAdd a release not about llvm-ar.
Rafael Espindola [Tue, 6 Aug 2013 13:16:28 +0000 (13:16 +0000)]
Add a release not about llvm-ar.

Thanks to Bill Wendling for the reminder.

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

10 years agoRemove oddly named libraries with "make uninstall-local"
Tim Northover [Tue, 6 Aug 2013 12:50:45 +0000 (12:50 +0000)]
Remove oddly named libraries with "make uninstall-local"

Patch by Edward-san.

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

10 years agoStore compile unit corresponding to each chain of inlined debug info entries. No...
Alexey Samsonov [Tue, 6 Aug 2013 10:49:15 +0000 (10:49 +0000)]
Store compile unit corresponding to each chain of inlined debug info entries. No functionality change.

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

10 years agoLLVM Interpreter: fixed bug 16694
Elena Demikhovsky [Tue, 6 Aug 2013 10:40:45 +0000 (10:40 +0000)]
LLVM Interpreter: fixed bug 16694
fix for: Bug 16694 - ExecutionEngine/test-interp-vec-loadstore.ll failing on powerpc-darwin8 (http://llvm.org/bugs/show_bug.cgi?id=16694)
The ExecutionEngine/test-interp-vec-loadstore.ll test has been failing on powerpc-darwin8 (on other platforms it passed)

the reason of fail was wrong output by printf. this output is checked by FileCheck, but on little-endian powerpc the output numeric data were printed inside out and FileCheck reported fail.
the printfs have been replaced by checking data inside test and numeric output has been replaced by the text output like : "int test passed, float test passed". The text output is checked by FileCheck.
the dependency on data layout has been removed.

done by Yuri Veselov (Intel)

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

10 years agoAdd LLVM-style RTTI to DIContext/DWARFContext classes
Alexey Samsonov [Tue, 6 Aug 2013 10:32:39 +0000 (10:32 +0000)]
Add LLVM-style RTTI to DIContext/DWARFContext classes

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

10 years agoRefactor isInTailCallPosition handling
Tim Northover [Tue, 6 Aug 2013 09:12:35 +0000 (09:12 +0000)]
Refactor isInTailCallPosition handling

This change came about primarily because of two issues in the existing code.
Niether of:

define i64 @test1(i64 %val) {
  %in = trunc i64 %val to i32
  tail call i32 @ret32(i32 returned %in)
  ret i64 %val
}

define i64 @test2(i64 %val) {
  tail call i32 @ret32(i32 returned undef)
  ret i32 42
}

should be tail calls, and the function sameNoopInput is responsible. The main
problem is that it is completely symmetric in the "tail call" and "ret" value,
but in reality different things are allowed on each side.

For these cases:
1. Any truncation should lead to a larger value being generated by "tail call"
   than needed by "ret".
2. Undef should only be allowed as a source for ret, not as a result of the
   call.

Along the way I noticed that a mismatch between what this function treats as a
valid truncation and what the backends see can lead to invalid calls as well
(see x86-32 test case).

This patch refactors the code so that instead of being based primarily on
values which it recurses into when necessary, it starts by inspecting the type
and considers each fundamental slot that the backend will see in turn. For
example, given a pathological function that returned {{}, {{}, i32, {}}, i32}
we would consider each "real" i32 in turn, and ask if it passes through
unchanged. This is much closer to what the backend sees as a result of
ComputeValueVTs.

Aside from the bug fixes, this eliminates the recursion that's going on and, I
believe, makes the bulk of the code significantly easier to understand. The
trade-off is the nasty iterators needed to find the real types inside a
returned value.

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

10 years agoUnbreak Debug build on Windows
Serge Pavlov [Tue, 6 Aug 2013 08:44:18 +0000 (08:44 +0000)]
Unbreak Debug build on Windows

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

10 years agoSimplify vector lane handling math a bit. No functional change intended.
Craig Topper [Tue, 6 Aug 2013 07:23:12 +0000 (07:23 +0000)]
Simplify vector lane handling math a bit. No functional change intended.

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

10 years agoSimplify math a little bit.
Craig Topper [Tue, 6 Aug 2013 06:54:25 +0000 (06:54 +0000)]
Simplify math a little bit.

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

10 years agoTarget/*/CMakeLists.txt: Add the dependency to CommonTableGen explicitly for each...
NAKAMURA Takumi [Tue, 6 Aug 2013 06:38:37 +0000 (06:38 +0000)]
Target/*/CMakeLists.txt: Add the dependency to CommonTableGen explicitly for each corresponding CodeGen.

Without explicit dependencies, both per-file action and in-CommonTableGen action could run in parallel.
It races to emit *.inc files simultaneously.

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

10 years agoReplace EVT with MVT in isHorizontalBinOp as it is only called with legal types.
Craig Topper [Tue, 6 Aug 2013 06:05:05 +0000 (06:05 +0000)]
Replace EVT with MVT in isHorizontalBinOp as it is only called with legal types.

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

10 years agoAsmPrinter/CMakeLists.txt: Add explicit dependency to intrinsics_gen here.
NAKAMURA Takumi [Tue, 6 Aug 2013 05:56:39 +0000 (05:56 +0000)]
AsmPrinter/CMakeLists.txt: Add explicit dependency to intrinsics_gen here.

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

10 years agoOption/CMakeLists.txt: Don't use target_link_libraries. LLVMBuild knows dependencies.
NAKAMURA Takumi [Tue, 6 Aug 2013 05:56:32 +0000 (05:56 +0000)]
Option/CMakeLists.txt: Don't use target_link_libraries. LLVMBuild knows dependencies.

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

10 years agoPut an llvm_unreachable at the end of getSplatIndex as its loop should never find...
Craig Topper [Tue, 6 Aug 2013 05:41:22 +0000 (05:41 +0000)]
Put an llvm_unreachable at the end of getSplatIndex as its loop should never find all undef elements.

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

10 years agoCheck against >= 0 instead of != -1 in getSplatIndex because it generally compiles...
Craig Topper [Tue, 6 Aug 2013 05:07:37 +0000 (05:07 +0000)]
Check against >= 0 instead of != -1 in getSplatIndex because it generally compiles to better code and is equivalent for shuffle indices.

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

10 years agoRemove trailing whitespace and fix an 80-column violation. No functional change.
Craig Topper [Tue, 6 Aug 2013 05:01:21 +0000 (05:01 +0000)]
Remove trailing whitespace and fix an 80-column violation. No functional change.

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

10 years agoSimplify code slightly. No functional change.
Craig Topper [Tue, 6 Aug 2013 04:12:40 +0000 (04:12 +0000)]
Simplify code slightly. No functional change.

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

10 years agoFactor FlattenCFG out from SimplifyCFG
Tom Stellard [Tue, 6 Aug 2013 02:43:45 +0000 (02:43 +0000)]
Factor FlattenCFG out from SimplifyCFG

Patch by: Mei Ye

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

10 years agoAllow 4 as a valid debug info version.
Eric Christopher [Tue, 6 Aug 2013 01:38:27 +0000 (01:38 +0000)]
Allow 4 as a valid debug info version.

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

10 years agoAdd some comment to LTOCodeGenerator class
Shuxin Yang [Tue, 6 Aug 2013 00:45:32 +0000 (00:45 +0000)]
Add some comment to LTOCodeGenerator class

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

10 years agoFix missing -*- C++ -*-s
Matt Arsenault [Tue, 6 Aug 2013 00:16:21 +0000 (00:16 +0000)]
Fix missing -*- C++ -*-s

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

10 years agoFileCheckize some of the testcases.
Bill Wendling [Mon, 5 Aug 2013 23:43:18 +0000 (23:43 +0000)]
FileCheckize some of the testcases.

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

10 years agoFix grammar.
Bill Wendling [Mon, 5 Aug 2013 23:29:16 +0000 (23:29 +0000)]
Fix grammar.

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

10 years agoR600/SI: Add missing test for r187749
Tom Stellard [Mon, 5 Aug 2013 22:45:56 +0000 (22:45 +0000)]
R600/SI: Add missing test for r187749

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

10 years agoRecommit previous cleanup with a fix for c++98 ambiguity.
Eric Christopher [Mon, 5 Aug 2013 22:32:28 +0000 (22:32 +0000)]
Recommit previous cleanup with a fix for c++98 ambiguity.

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

10 years agoR600: Implement TargetLowering::getVectorIdxTy()
Tom Stellard [Mon, 5 Aug 2013 22:22:07 +0000 (22:22 +0000)]
R600: Implement TargetLowering::getVectorIdxTy()

We use MVT::i32 for the vector index type, because we use 32-bit
operations to caculate offsets when dynamically indexing vectors.

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

10 years agoTargetLowering: Add getVectorIdxTy() function v2
Tom Stellard [Mon, 5 Aug 2013 22:22:01 +0000 (22:22 +0000)]
TargetLowering: Add getVectorIdxTy() function v2

This virtual function can be implemented by targets to specify the type
to use for the index operand of INSERT_VECTOR_ELT, EXTRACT_VECTOR_ELT,
INSERT_SUBVECTOR, EXTRACT_SUBVECTOR.  The default implementation returns
the result from TargetLowering::getPointerTy()

The previous code was using TargetLowering::getPointerTy() for vector
indices, because this is guaranteed to be legal on all targets.  However,
using TargetLowering::getPointerTy() can be a problem for targets with
pointer sizes that differ across address spaces.  On such targets,
when vectors need to be loaded or stored to an address space other than the
default 'zero' address space (which is the address space assumed by
TargetLowering::getPointerTy()), having an index that
is a different size than the pointer can lead to inefficient
pointer calculations, (e.g. 64-bit adds for a 32-bit address space).

There is no intended functionality change with this patch.

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

10 years agoRevert "Use existing builtin hashing functions to make this routine more"
Eric Christopher [Mon, 5 Aug 2013 22:07:30 +0000 (22:07 +0000)]
Revert "Use existing builtin hashing functions to make this routine more"

This reverts commit r187745.

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

10 years agoUse existing builtin hashing functions to make this routine more
Eric Christopher [Mon, 5 Aug 2013 22:00:50 +0000 (22:00 +0000)]
Use existing builtin hashing functions to make this routine more
simple.

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

10 years agoChange parent hashing algorithm to be non-recursive and elaborate
Eric Christopher [Mon, 5 Aug 2013 21:40:57 +0000 (21:40 +0000)]
Change parent hashing algorithm to be non-recursive and elaborate
greatly on many comments in the code.

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

10 years ago[bugpoint] Allow the user to specify the path to opt on the commandline.
Michael Gottesman [Mon, 5 Aug 2013 21:07:07 +0000 (21:07 +0000)]
[bugpoint] Allow the user to specify the path to opt on the commandline.

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

10 years agoIntroduce an optimisation for special case lists with large numbers of literal entries.
Peter Collingbourne [Mon, 5 Aug 2013 17:48:04 +0000 (17:48 +0000)]
Introduce an optimisation for special case lists with large numbers of literal entries.

Our internal regex implementation does not cope with large numbers
of anchors very efficiently.  Given a ~3600-entry special case list,
regex compilation can take on the order of seconds.  This patch solves
the problem for the special case of patterns matching literal global
names (i.e. patterns with no regex metacharacters).  Rather than
forming regexes from literal global name patterns, add them to
a StringSet which is checked before matching against the regex.
This reduces regex compilation time by an order of roughly thousands
when reading the aforementioned special case list, according to a
completely unscientific study.

No test cases.  I figure that any new tests for this code should
check that regex metacharacters are properly recognised.  However,
I could not find any documentation which documents the fact that the
syntax of global names in special case lists is based on regexes.
The extent to which regex syntax is supported in special case lists
should probably be decided on/documented before writing tests.

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

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

10 years agoIntroduce Regex::isLiteralERE function.
Peter Collingbourne [Mon, 5 Aug 2013 17:47:59 +0000 (17:47 +0000)]
Introduce Regex::isLiteralERE function.

This will be used to implement an optimisation for literal entries
in special case lists.

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

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

10 years agoSilencing an MSVC11 type conversion warning.
Aaron Ballman [Mon, 5 Aug 2013 13:47:03 +0000 (13:47 +0000)]
Silencing an MSVC11 type conversion warning.

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

10 years ago80-cols
Alexey Samsonov [Mon, 5 Aug 2013 13:19:49 +0000 (13:19 +0000)]
80-cols

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

10 years agoLLVM Interpreter: This patch implements vector support for cast operations (zext...
Elena Demikhovsky [Mon, 5 Aug 2013 12:17:06 +0000 (12:17 +0000)]
LLVM Interpreter: This patch implements vector support for cast operations (zext, sext, uitofp, sitofp, trunc, fpext, fptosi, fptrunc, bitcast) and shift operations (shl, ashr, lshr) for integer and floating point data types.
Added tests.

Done by Yuri Veselov (mailto:Yuri.Veselov@intel.com).

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

10 years ago[SystemZ] Use BRCT and BRCTG to eliminate add-&-compare sequences
Richard Sandiford [Mon, 5 Aug 2013 11:23:46 +0000 (11:23 +0000)]
[SystemZ] Use BRCT and BRCTG to eliminate add-&-compare sequences

This patch just uses a peephole test for "add; compare; branch" sequences
within a single block.  The IR optimizers already convert loops to
decrement-and-branch-on-nonzero form in some cases, so even this
simplistic test triggers many times during a clang bootstrap and
projects/test-suite run.  It looks like there are still cases where we
need to more strongly prefer branches on nonzero though.  E.g. I saw a
case where a loop that started out with a check for 0 ended up with a
check for -1.  I'll try to look at that sometime.

I ended up adding the Reference class because MachineInstr::readsRegister()
doesn't check for subregisters (by design, as far as I could tell).

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

10 years agoDon't leak passes if added outside of the area determined by Started/Stopped flags.
Benjamin Kramer [Mon, 5 Aug 2013 11:11:11 +0000 (11:11 +0000)]
Don't leak passes if added outside of the area determined by Started/Stopped flags.

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

10 years ago[SystemZ] Add definitions for BRCT and BRCTG
Richard Sandiford [Mon, 5 Aug 2013 11:07:38 +0000 (11:07 +0000)]
[SystemZ] Add definitions for BRCT and BRCTG

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

10 years ago[SystemZ] Use LOAD AND TEST to eliminate comparisons against zero
Richard Sandiford [Mon, 5 Aug 2013 11:03:20 +0000 (11:03 +0000)]
[SystemZ] Use LOAD AND TEST to eliminate comparisons against zero

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

10 years ago[SystemZ] Add LOAD AND TEST instructions
Richard Sandiford [Mon, 5 Aug 2013 11:00:53 +0000 (11:00 +0000)]
[SystemZ] Add LOAD AND TEST instructions

Just the definitions and MC support.  The next patch uses them for codegen.

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

10 years ago[SystemZ] Split out comparison elimination into a separate pass
Richard Sandiford [Mon, 5 Aug 2013 10:58:53 +0000 (10:58 +0000)]
[SystemZ] Split out comparison elimination into a separate pass

Perhaps predictably, doing comparison elimination on the fly during
SystemZLongBranch turned out to be a bad idea.  The next patches make
use of LOAD AND TEST and BRANCH ON COUNT, both of which require
changes to earlier instructions.

No functionality change intended.

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