oota-llvm.git
11 years agoDisable inlining between sanitized and non-sanitized functions.
Evgeniy Stepanov [Thu, 8 Aug 2013 08:22:39 +0000 (08:22 +0000)]
Disable inlining between sanitized and non-sanitized functions.

Inlining between functions with different values of sanitize_* attributes
leads to over- or under-sanitizing, which is always bad.

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

11 years agoFor DW_TAG_template_type_parameter the actual passed in type could
Eric Christopher [Thu, 8 Aug 2013 08:09:43 +0000 (08:09 +0000)]
For DW_TAG_template_type_parameter the actual passed in type could
be void and therefore not have a type entry. Only add the type if
it is non-void and provide a testcase.

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

11 years agoRemove AllUndef check from one of the loops in getVectorShuffle. It was already handl...
Craig Topper [Thu, 8 Aug 2013 08:03:12 +0000 (08:03 +0000)]
Remove AllUndef check from one of the loops in getVectorShuffle. It was already handled by the 'AllLHS && AllRHS' check after the previous loop.

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

11 years agoThe conversion to bool is fine here, no need to check isType.
Eric Christopher [Thu, 8 Aug 2013 07:40:42 +0000 (07:40 +0000)]
The conversion to bool is fine here, no need to check isType.

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

11 years agoMake sure that if we're going to attempt to add a type to a DIE that
Eric Christopher [Thu, 8 Aug 2013 07:40:37 +0000 (07:40 +0000)]
Make sure that if we're going to attempt to add a type to a DIE that
the type exists.

Fix up cases where we weren't checking for optional types and add
an assert to addType to make sure we catch this in the future.

Fix up a testcase that was using the tag for DW_TAG_array_type
when it meant DW_TAG_enumeration_type.

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

11 years agoChange variable name and reflow formatting.
Eric Christopher [Thu, 8 Aug 2013 07:40:31 +0000 (07:40 +0000)]
Change variable name and reflow formatting.

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

11 years agoOptimize mask generation for one of the DAG combiner shufflevector cases.
Craig Topper [Thu, 8 Aug 2013 07:38:55 +0000 (07:38 +0000)]
Optimize mask generation for one of the DAG combiner shufflevector cases.

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

11 years agoPPC: Map frin to round() not nearbyint() and rint()
Hal Finkel [Thu, 8 Aug 2013 04:31:34 +0000 (04:31 +0000)]
PPC: Map frin to round() not nearbyint() and rint()

Making use of the recently-added ISD::FROUND, which allows for custom lowering
of round(), the PPC backend will now map frin to round(). Previously, we had
been using frin to lower nearbyint() (and rint() via some custom lowering to
handle the extra fenv flags requirements), but only in fast-math mode because
frin does not tie-to-even. Several users had complained about this behavior,
and this new mapping of frin to round is certainly more appropriate (and does
not require fast-math mode).

In effect, this reverts r178362 (and part of r178337, replacing the nearbyint
mapping with the round mapping).

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

11 years agoRevert "coff also doesn't have a ReadOnlySection yet, (!)"
David Majnemer [Thu, 8 Aug 2013 01:50:52 +0000 (01:50 +0000)]
Revert "coff also doesn't have a ReadOnlySection yet, (!)"

This reverts commit r77814.

We were sticking global constants in the .data section instead of in the
.rdata section when emitting for COFF.

This fixes PR16831.

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

11 years agoReflow for loop.
Eric Christopher [Thu, 8 Aug 2013 01:41:05 +0000 (01:41 +0000)]
Reflow for loop.

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

11 years agoBe more rigorous about the sizes of forms and attributes.
Eric Christopher [Thu, 8 Aug 2013 01:41:00 +0000 (01:41 +0000)]
Be more rigorous about the sizes of forms and attributes.

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

11 years agoAdd three missing CMake variables that need to make it to the
Chandler Carruth [Thu, 8 Aug 2013 01:15:37 +0000 (01:15 +0000)]
Add three missing CMake variables that need to make it to the
LLVMConfig.cmake file that is (I think) used in the stand-alone Clang
build, and causing link errors there w.r.t. curses.

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

11 years agoChanged isPrint for U+00AD SOFT HYPHEN to return true.
Alexander Kornienko [Thu, 8 Aug 2013 01:10:50 +0000 (01:10 +0000)]
Changed isPrint for U+00AD SOFT HYPHEN to return true.

Summary:
This is consistent with MacOSX implementation, and most terminals
actually display this character (checked on gnome-terminal, lxterminal, lxterm,
Terminal.app, iterm2). Actually, this is in line with the ISO Latin 1 standard
(ISO 8859-1), which defines it differently from the Unicode Standard. More
information here: http://www.cs.tut.fi/~jkorpela/shy.html

Reviewers: gribozavr, jordan_rose

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

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

11 years agoForward resetColor() et al to the underlying stream.
Ted Kremenek [Thu, 8 Aug 2013 00:43:30 +0000 (00:43 +0000)]
Forward resetColor() et al to the underlying stream.

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

11 years agoRevert "[objc-arc] Track if we encountered an additive overflow while computing ...
Michael Gottesman [Thu, 8 Aug 2013 00:41:18 +0000 (00:41 +0000)]
Revert "[objc-arc] Track if we encountered an additive overflow while computing {TopDown,BottomUp}PathCounts and do nothing if it occured."

This reverts commit r187941.

The commit was passing on my os x box, but it is failing on some non-osx
platforms. I do not have time to look into it now, so I am reverting and will
recommit after I figure this out.

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

11 years agoFix ARM build.
Peter Collingbourne [Thu, 8 Aug 2013 00:15:27 +0000 (00:15 +0000)]
Fix ARM build.

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

11 years ago[objc-arc] Track if we encountered an additive overflow while computing {TopDown...
Michael Gottesman [Wed, 7 Aug 2013 23:56:41 +0000 (23:56 +0000)]
[objc-arc] Track if we encountered an additive overflow while computing {TopDown,BottomUp}PathCounts and do nothing if it occured.

rdar://14590914

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

11 years ago[objc-arc] Change 4 iterator methods which return const_iterators to be const methods.
Michael Gottesman [Wed, 7 Aug 2013 23:56:34 +0000 (23:56 +0000)]
[objc-arc] Change 4 iterator methods which return const_iterators to be const methods.

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

11 years agoReapply r185872 now that the address sanitizer has been changed to support this.
Bill Wendling [Wed, 7 Aug 2013 23:42:09 +0000 (23:42 +0000)]
Reapply r185872 now that the address sanitizer has been changed to support this.

Original commit message:

Stop emitting weak symbols into the "coal" sections.

The Mach-O linker has been able to support the weak-def bit on any symbol for
quite a while now. The compiler however continued to place these symbols into a
"coal" section, which required the linker to map them back to the base section
name.

Replace the sections like this:

  __TEXT/__textcoal_nt   instead use  __TEXT/__text
  __TEXT/__const_coal    instead use  __TEXT/__const
  __DATA/__datacoal_nt   instead use  __DATA/__data

<rdar://problem/14265330>

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

11 years agoReally unbreak Mac build.
Peter Collingbourne [Wed, 7 Aug 2013 23:41:13 +0000 (23:41 +0000)]
Really unbreak Mac build.

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

11 years agoUnbreak Mac build.
Peter Collingbourne [Wed, 7 Aug 2013 23:29:46 +0000 (23:29 +0000)]
Unbreak Mac build.

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

11 years ago[lit] Remove unnecessary list copy.
Daniel Dunbar [Wed, 7 Aug 2013 23:10:20 +0000 (23:10 +0000)]
[lit] Remove unnecessary list copy.

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

11 years ago[lit] Always list individual UNRESOLVED tests.
Daniel Dunbar [Wed, 7 Aug 2013 23:10:05 +0000 (23:10 +0000)]
[lit] Always list individual UNRESOLVED tests.

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

11 years ago[lit] Explicitly convert dict items() result to a list.
Daniel Dunbar [Wed, 7 Aug 2013 23:10:01 +0000 (23:10 +0000)]
[lit] Explicitly convert dict items() result to a list.

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

11 years ago[lit] Make string encoding issues explicit.
Daniel Dunbar [Wed, 7 Aug 2013 23:09:55 +0000 (23:09 +0000)]
[lit] Make string encoding issues explicit.

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

11 years ago[tests] Make string encoding issues explicit.
Daniel Dunbar [Wed, 7 Aug 2013 23:09:24 +0000 (23:09 +0000)]
[tests] Make string encoding issues explicit.

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

11 years ago[tests] Avoid deprecated except syntax.
Daniel Dunbar [Wed, 7 Aug 2013 23:09:10 +0000 (23:09 +0000)]
[tests] Avoid deprecated except syntax.

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

11 years agoAdd ISD::FROUND for libm round()
Hal Finkel [Wed, 7 Aug 2013 22:49:12 +0000 (22:49 +0000)]
Add ISD::FROUND for libm round()

All libm floating-point rounding functions, except for round(), had their own
ISD nodes. Recent PowerPC cores have an instruction for round(), and so here I'm
adding ISD::FROUND so that round() can be custom lowered as well.

For the most part, this is straightforward. I've added an intrinsic
and a matching ISD node just like those for nearbyint() and friends. The
SelectionDAG pattern I've named frnd (because ISD::FP_ROUND has already claimed
fround).

This will be used by the PowerPC backend in a follow-up commit.

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

11 years agoDataFlowSanitizer; LLVM changes.
Peter Collingbourne [Wed, 7 Aug 2013 22:47:18 +0000 (22:47 +0000)]
DataFlowSanitizer; LLVM changes.

DataFlowSanitizer is a generalised dynamic data flow analysis.

Unlike other Sanitizer tools, this tool is not designed to detect a
specific class of bugs on its own.  Instead, it provides a generic
dynamic data flow analysis framework to be used by clients to help
detect application-specific issues within their own code.

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

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

11 years ago[lit] Report the traceback when config import fails.
Daniel Dunbar [Wed, 7 Aug 2013 21:43:34 +0000 (21:43 +0000)]
[lit] Report the traceback when config import fails.

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

11 years ago[lit] Avoid comparisons with None.
Daniel Dunbar [Wed, 7 Aug 2013 21:43:23 +0000 (21:43 +0000)]
[lit] Avoid comparisons with None.

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

11 years ago[lit] Use list comprehensions instead of map().
Daniel Dunbar [Wed, 7 Aug 2013 21:43:17 +0000 (21:43 +0000)]
[lit] Use list comprehensions instead of map().

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

11 years ago[lit] Avoid deprecated dict.has_key() method.
Daniel Dunbar [Wed, 7 Aug 2013 21:43:12 +0000 (21:43 +0000)]
[lit] Avoid deprecated dict.has_key() method.

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

11 years agoUsing the integrated assembler we'd fail to change section to the
Eric Christopher [Wed, 7 Aug 2013 21:13:06 +0000 (21:13 +0000)]
Using the integrated assembler we'd fail to change section to the
.tbss section for zerofill thread locals. Make sure we do this
before emitting the zerofills.

Fixes PR15972.

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

11 years agoFix a FIXME, on darwin all virtual sections have a zerofill type.
Eric Christopher [Wed, 7 Aug 2013 21:13:01 +0000 (21:13 +0000)]
Fix a FIXME, on darwin all virtual sections have a zerofill type.

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

11 years agoOn Windows, autolink advapi32 from Path.inc for CryptAcquireContextW
Reid Kleckner [Wed, 7 Aug 2013 20:19:31 +0000 (20:19 +0000)]
On Windows, autolink advapi32 from Path.inc for CryptAcquireContextW

This allows llvm-tblgen to link successfully when compiling with clang.

Both MSBuild and CMake will automatically add advapi32 as part of a set
of other dlls comprising the win32 API to the link line, but CMake
doesn't do that when compiling with clang.  Until someone adds that info
to cmake upstream, this seems like a reasonable work around.

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

11 years agoAdd the common begin/end naming convention to the coding standard.
Rafael Espindola [Wed, 7 Aug 2013 19:34:37 +0000 (19:34 +0000)]
Add the common begin/end naming convention to the coding standard.

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

11 years agoMove assert above first use of variable that we'd be asserting on.
Eric Christopher [Wed, 7 Aug 2013 18:51:09 +0000 (18:51 +0000)]
Move assert above first use of variable that we'd be asserting on.

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

11 years agolit/LitConfig.py: Fixup for msys bash.
NAKAMURA Takumi [Wed, 7 Aug 2013 17:21:23 +0000 (17:21 +0000)]
lit/LitConfig.py: Fixup for msys bash.

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

11 years agoConfusing comment typo.
Andrew Trick [Wed, 7 Aug 2013 17:20:32 +0000 (17:20 +0000)]
Confusing comment typo.

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

11 years agoLit: Fixup in r187886.
NAKAMURA Takumi [Wed, 7 Aug 2013 12:53:53 +0000 (12:53 +0000)]
Lit: Fixup in r187886.

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

11 years agoLit: Resurrect --no-execute dropped in r187852.
NAKAMURA Takumi [Wed, 7 Aug 2013 12:44:29 +0000 (12:44 +0000)]
Lit: Resurrect --no-execute dropped in r187852.

For now, builders in bb.pgr.jp are using it.

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

11 years agoAVX-512 set: Added BROADCAST instructions
Elena Demikhovsky [Wed, 7 Aug 2013 12:34:55 +0000 (12:34 +0000)]
AVX-512 set: Added BROADCAST instructions
with lowering logic and a test.

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

11 years ago[SystemZ] Optimize floating-point comparisons with zero
Richard Sandiford [Wed, 7 Aug 2013 11:10:06 +0000 (11:10 +0000)]
[SystemZ] Optimize floating-point comparisons with zero

This follows the same lines as the integer code.  In the end it seemed
easier to have a second 4-bit mask in TSFlags to specify the compare-like
CC values.  That eats one more TSFlags bit than adding a CCHasUnordered
would have done, but it feels more concise.

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

11 years ago[SystemZ] Add floating-point load-and-test instructions
Richard Sandiford [Wed, 7 Aug 2013 11:03:34 +0000 (11:03 +0000)]
[SystemZ] Add floating-point load-and-test instructions

These instructions can also be used as comparisons with zero.

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

11 years agoJumpThreading: Turn a select instruction into branching if it allows to thread one...
Benjamin Kramer [Wed, 7 Aug 2013 10:29:38 +0000 (10:29 +0000)]
JumpThreading: Turn a select instruction into branching if it allows to thread one half of the select.

This is a common pattern coming out of simplifycfg generating gross code.

a:                                       ; preds = %entry
  %sel = select i1 %cmp1, double %add, double 0.000000e+00
  br label %b

b:
  %cond5 = phi double [ %sel, %a ], [ %sub, %entry ]
  %cmp6 = fcmp oeq double %cond5, 0.000000e+00
  br i1 %cmp6, label %if.then, label %if.end

becomes

a:
  br i1 %cmp1, label %b, label %if.then

b:
  %cond5 = phi double [ %sub, %entry ], [ %add, %a ]
  %cmp6 = fcmp oeq double %cond5, 0.000000e+00
  br i1 %cmp6, label %if.then, label %if.end

Skipping block b completely if possible.

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

11 years agoCommit a no-op change to StringRef to (hopefully) trigger build bots.
Chandler Carruth [Wed, 7 Aug 2013 09:52:34 +0000 (09:52 +0000)]
Commit a no-op change to StringRef to (hopefully) trigger build bots.
r187874 seems to have been missed by the build bot infrastructure, and
the subsequent commits to compiler-rt don't seem to be queuing up new
build requsets. Hopefully this will.

As it happens, having the space here is the more common formatting. =]

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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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