platform/upstream/llvm.git
10 years agoFix getting IP, BP and SP for address sanitizer's needs on FreeBSD in 32-bit mode
Viktor Kutuzov [Sun, 15 Jun 2014 13:56:28 +0000 (13:56 +0000)]
Fix getting IP, BP and SP for address sanitizer's needs on FreeBSD in 32-bit mode

llvm-svn: 210988

10 years ago[Mips] Make gp-sym-2.test test case independent from external input files.
Simon Atanasyan [Sun, 15 Jun 2014 12:04:40 +0000 (12:04 +0000)]
[Mips] Make gp-sym-2.test test case independent from external input files.

llvm-svn: 210987

10 years agoLegalizeDAG: make sure cast is unsigned before using FP_TO_UINT.
Tim Northover [Sun, 15 Jun 2014 09:27:20 +0000 (09:27 +0000)]
LegalizeDAG: make sure cast is unsigned before using FP_TO_UINT.

It's valid to use FP_TO_SINT when asking for a smaller type (e.g. all
"unsigned int16" values fit into a "signed int32"), but the reverse
isn't true.

Unfortunately, I'm not actually aware of any architecture with
asymmetric FP_TO_SINT and FP_TO_UINT handling and the logic happens to
work in the symmetric case, so I can't actually write a test for this.

llvm-svn: 210986

10 years agoAArch64: improve handling & modelling of FP_TO_XINT nodes.
Tim Northover [Sun, 15 Jun 2014 09:27:15 +0000 (09:27 +0000)]
AArch64: improve handling & modelling of FP_TO_XINT nodes.

There's probably no acatual change in behaviour here, just updating
the LowerFP_TO_INT function to be more similar to the reverse
implementation and updating costs to current CodeGen.

llvm-svn: 210985

10 years agoAArch64: improve vector [su]itofp handling.
Tim Northover [Sun, 15 Jun 2014 09:27:06 +0000 (09:27 +0000)]
AArch64: improve vector [su]itofp handling.

This somehow got missed in the AArch64 merge, so should fix a
performance regression since 3.4.

llvm-svn: 210984

10 years agoDon't expect tests always crashing. Add "REQUIRES:asserts".
NAKAMURA Takumi [Sun, 15 Jun 2014 01:01:11 +0000 (01:01 +0000)]
Don't expect tests always crashing. Add "REQUIRES:asserts".

llvm-svn: 210983

10 years agoAdded several gdb-remote tests around QListThreadsInStopReply.
Todd Fiala [Sat, 14 Jun 2014 22:00:36 +0000 (22:00 +0000)]
Added several gdb-remote tests around QListThreadsInStopReply.

llvm-svn: 210982

10 years ago[Mips] Make gp-sym-1.test test case independent from external input files.
Simon Atanasyan [Sat, 14 Jun 2014 21:18:50 +0000 (21:18 +0000)]
[Mips] Make gp-sym-1.test test case independent from external input files.

llvm-svn: 210981

10 years agoReplacing the private implementations of SwapValue with calls to sys::swapByteOrder()
Artyom Skrobov [Sat, 14 Jun 2014 13:49:57 +0000 (13:49 +0000)]
Replacing the private implementations of SwapValue with calls to sys::swapByteOrder()

llvm-svn: 210980

10 years agoUsing llvm::sys::swapByteOrder() for the common case of byte-swapping a value in...
Artyom Skrobov [Sat, 14 Jun 2014 13:26:14 +0000 (13:26 +0000)]
Using llvm::sys::swapByteOrder() for the common case of byte-swapping a value in place

llvm-svn: 210979

10 years agoUsing llvm::sys::swapByteOrder() for the common case of byte-swapping a value in...
Artyom Skrobov [Sat, 14 Jun 2014 13:18:07 +0000 (13:18 +0000)]
Using llvm::sys::swapByteOrder() for the common case of byte-swapping a value in place

llvm-svn: 210978

10 years ago[Mips] Make exe-got.test test case independent from external input files.
Simon Atanasyan [Sat, 14 Jun 2014 12:55:03 +0000 (12:55 +0000)]
[Mips] Make exe-got.test test case independent from external input files.

llvm-svn: 210977

10 years agoAdding llvm::sys::swapByteOrder() for the common use-case of byte-swapping a value...
Artyom Skrobov [Sat, 14 Jun 2014 12:52:55 +0000 (12:52 +0000)]
Adding llvm::sys::swapByteOrder() for the common use-case of byte-swapping a value in place

llvm-svn: 210976

10 years agoLeft two files out of the previous commit
Artyom Skrobov [Sat, 14 Jun 2014 12:40:04 +0000 (12:40 +0000)]
Left two files out of the previous commit

llvm-svn: 210975

10 years agollvm::sys::SwapByteOrder() renamed to llvm::sys::getSwappedBytes()
Artyom Skrobov [Sat, 14 Jun 2014 12:14:25 +0000 (12:14 +0000)]
llvm::sys::SwapByteOrder() renamed to llvm::sys::getSwappedBytes()

Further to this, llvm::sys::swapByteOrder() will be added, acting in-place

llvm-svn: 210974

10 years agoRenaming SwapByteOrder() to getSwappedBytes()
Artyom Skrobov [Sat, 14 Jun 2014 11:36:01 +0000 (11:36 +0000)]
Renaming SwapByteOrder() to getSwappedBytes()

The next commit will add swapByteOrder(), acting in-place

llvm-svn: 210973

10 years agoOne of our buildbot for FreeBSD does not support std::to_string.
Sylvestre Ledru [Sat, 14 Jun 2014 09:28:27 +0000 (09:28 +0000)]
One of our buildbot for FreeBSD does not support std::to_string.
Use stringstream instead to convert int to string

llvm-svn: 210972

10 years agoList the function/method name in the index page of scan-build
Sylvestre Ledru [Sat, 14 Jun 2014 08:49:40 +0000 (08:49 +0000)]
List the function/method name in the index page of scan-build

llvm-svn: 210971

10 years agoWith the option '-analyzer-config stable-report-filename=true',
Sylvestre Ledru [Sat, 14 Jun 2014 08:45:32 +0000 (08:45 +0000)]
With the option '-analyzer-config stable-report-filename=true',
instead of report-XXXXXX.html, scan-build/clang analyzer generate
report-<filename>-<function, method name>-<function position>-<id>.html.
(id = i++ for several issues found in the same function/method)

llvm-svn: 210970

10 years agoR600: Add failing testcases.
Matt Arsenault [Sat, 14 Jun 2014 04:26:09 +0000 (04:26 +0000)]
R600: Add failing testcases.

These are reduced from assert in the
OpenCV CvtColor8u.BGR5652GRAY test.

llvm-svn: 210969

10 years agoFix typo
Matt Arsenault [Sat, 14 Jun 2014 04:26:07 +0000 (04:26 +0000)]
Fix typo

llvm-svn: 210968

10 years agoR600: Fix asserts related to constant initializers
Matt Arsenault [Sat, 14 Jun 2014 04:26:05 +0000 (04:26 +0000)]
R600: Fix asserts related to constant initializers

This would assert if a constant address space was extern
and therefore didn't have an initializer. If the initializer
was undef, it would hit the unreachable unhandled initializer case.

An extern global should never really occur since we don't have
machine linking, but bugpoint likes to remove initializers.

llvm-svn: 210967

10 years agoR600: Use address space enum instead of value
Matt Arsenault [Sat, 14 Jun 2014 04:26:01 +0000 (04:26 +0000)]
R600: Use address space enum instead of value

llvm-svn: 210966

10 years agoRemove extra whitespace in function declaration. No functionality change.
Nick Lewycky [Sat, 14 Jun 2014 03:48:29 +0000 (03:48 +0000)]
Remove extra whitespace in function declaration. No functionality change.

llvm-svn: 210965

10 years agoProperly terminated POSIX register sets with LLDB_INVALID_REGNUM.
Todd Fiala [Sat, 14 Jun 2014 03:13:01 +0000 (03:13 +0000)]
Properly terminated POSIX register sets with LLDB_INVALID_REGNUM.

RegisterSets are assumed to be terminated by this value.  Loops over
register set values would fail without LLDB_INVALID_REGNUM terminating
the list.  This change adjusts the static check to account for the
size of the register set regnum list being one larger than the expected
valid register set count.

llvm-svn: 210964

10 years agoAdded gdb-remote expedited register dupe check.
Todd Fiala [Sat, 14 Jun 2014 03:03:23 +0000 (03:03 +0000)]
Added gdb-remote expedited register dupe check.

The llgs branch had a bug where register sets were not terminated with
LLDB_INVALID_REGNUM so the expedite register loop was issuing duplicate
registers.  This test was added to catch the problem.

Enhanced the key-val collection method to optionally (and by default)
support capturing duplicate values for a given key.  When that happens
and if permitted, it promotes a single key to a list and appends values
to it.

llvm-svn: 210963

10 years agoExclude Android from the tests for valloc/pvalloc.
Dan Albert [Sat, 14 Jun 2014 00:50:03 +0000 (00:50 +0000)]
Exclude Android from the tests for valloc/pvalloc.

These functions are being removed from Android because they were removed
from POSIX 2004.

llvm-svn: 210962

10 years agoDebugInfo: Remove some extra handling of abstract variables and instead rely solely...
David Blaikie [Fri, 13 Jun 2014 23:52:55 +0000 (23:52 +0000)]
DebugInfo: Remove some extra handling of abstract variables and instead rely solely on the delayed handling introduced in r210946

Now that we handle finding abstract variables at the end of the module,
remove the upfront handling and just ensure the abstract variable is
built when necessary.

In theory we could have a split implementation, where inlined variables
are immediately constructed referencing the abstract definition, and
concrete variables are delayed - but let's go with one solution for now
unless there's a reason not to.

llvm-svn: 210961

10 years agoFix a crash in Retain Count checker error reporting
Anna Zaks [Fri, 13 Jun 2014 23:47:38 +0000 (23:47 +0000)]
Fix a crash in Retain Count checker error reporting

Fixes a crash in Retain Count checker error reporting logic by handing
the allocation statement retrieval from a BlockEdge program point.

Also added a simple CFG dump routine for debugging.

llvm-svn: 210960

10 years ago[Sanitizer] Merge AnsiColorDecorator and SanitizerCommonDecorator, use the latter...
Alexey Samsonov [Fri, 13 Jun 2014 23:46:37 +0000 (23:46 +0000)]
[Sanitizer] Merge AnsiColorDecorator and SanitizerCommonDecorator, use the latter in UBSan

llvm-svn: 210959

10 years agoDocument Darwin-specific defaults.
Adrian Prantl [Fri, 13 Jun 2014 23:35:54 +0000 (23:35 +0000)]
Document Darwin-specific defaults.

llvm-svn: 210958

10 years agoSync accumulated minor diffs in llgs branch gdb-remote tests.
Todd Fiala [Fri, 13 Jun 2014 23:34:17 +0000 (23:34 +0000)]
Sync accumulated minor diffs in llgs branch gdb-remote tests.

I've been making some subtle changes to the gdb-remote tests as I implement
them in the llgs branch.  This check-in rectifies the set of diffs that
have accumulated in the llgs branch that were not present upstream.

llvm-svn: 210957

10 years agoRemove InstrItineraryData off of the TargetMachine - it's already
Eric Christopher [Fri, 13 Jun 2014 23:11:13 +0000 (23:11 +0000)]
Remove InstrItineraryData off of the TargetMachine - it's already
on the subtarget and just forward the accessor.

llvm-svn: 210955

10 years agoA non-trivial array-fill expression isn't necessarily a CXXConstructExpr. It
Richard Smith [Fri, 13 Jun 2014 23:04:49 +0000 (23:04 +0000)]
A non-trivial array-fill expression isn't necessarily a CXXConstructExpr. It
could be an InitListExpr that runs constructors in C++11 onwards. Fixes a
recent regression (introduced in r210091).

llvm-svn: 210954

10 years agoMove ARMJITInfo off of the TargetMachine and down onto the subtarget.
Eric Christopher [Fri, 13 Jun 2014 23:04:46 +0000 (23:04 +0000)]
Move ARMJITInfo off of the TargetMachine and down onto the subtarget.
This required untangling a mess of headers that included around.

llvm-svn: 210953

10 years agoComplete remove test/Transforms/GlobalMerge.
Jiangning Liu [Fri, 13 Jun 2014 23:00:36 +0000 (23:00 +0000)]
Complete remove test/Transforms/GlobalMerge.

llvm-svn: 210952

10 years agoMove GlobalMerge from Transform to CodeGen.
Jiangning Liu [Fri, 13 Jun 2014 22:57:59 +0000 (22:57 +0000)]
Move GlobalMerge from Transform to CodeGen.

This patch is to move GlobalMerge pass from Transform/Scalar
to CodeGen, because GlobalMerge depends on TargetMachine.
In the mean time, the macro INITIALIZE_TM_PASS is also moved
to CodeGen/Passes.h. With this fix we can avoid making
libScalarOpts depend on libCodeGen.

llvm-svn: 210951

10 years ago[UBSan] Respect runtime flag for colorizing reports
Alexey Samsonov [Fri, 13 Jun 2014 22:48:40 +0000 (22:48 +0000)]
[UBSan] Respect runtime flag for colorizing reports

llvm-svn: 210950

10 years agoAdd documentation about the jThreadExtendedInfo packet.
Jason Molenda [Fri, 13 Jun 2014 22:40:47 +0000 (22:40 +0000)]
Add documentation about the jThreadExtendedInfo packet.

llvm-svn: 210949

10 years agoThe hazard recognizer only needs a subtarget, not a target machine
Eric Christopher [Fri, 13 Jun 2014 22:38:52 +0000 (22:38 +0000)]
The hazard recognizer only needs a subtarget, not a target machine
so make it take one. Fix up all users accordingly.

llvm-svn: 210948

10 years agoFix typo.
Eric Christopher [Fri, 13 Jun 2014 22:38:48 +0000 (22:38 +0000)]
Fix typo.

llvm-svn: 210947

10 years agoDebugInfo: Reference abstract definitions from variables in concrete definitions...
David Blaikie [Fri, 13 Jun 2014 22:35:44 +0000 (22:35 +0000)]
DebugInfo: Reference abstract definitions from variables in concrete definitions that preceed their first inline definition.

Rather than relying on abstract variables looked up at the time the
concrete variable is created, look them up at the end of the module to
ensure they're referenced even if they're created after the concrete
definition. This completes/matches the work done in r209677 to handle
this for the subprograms themselves.

llvm-svn: 210946

10 years ago[DWARF parser] Use distinction between DW_AT_ranges_base and DW_AT_GNU_ranges_base...
Alexey Samsonov [Fri, 13 Jun 2014 22:31:03 +0000 (22:31 +0000)]
[DWARF parser] Use distinction between DW_AT_ranges_base and DW_AT_GNU_ranges_base instead of DWARF version

llvm-svn: 210945

10 years agoDwarfDebug::getExistingAbstractVariable: constify an existing reference parameter...
David Blaikie [Fri, 13 Jun 2014 22:29:31 +0000 (22:29 +0000)]
DwarfDebug::getExistingAbstractVariable: constify an existing reference parameter that didn't need to be mutated.

llvm-svn: 210944

10 years agoDebugInfo: Following up to r209677, refactor local variable emission to delay the...
David Blaikie [Fri, 13 Jun 2014 22:18:23 +0000 (22:18 +0000)]
DebugInfo: Following up to r209677, refactor local variable emission to delay the choice between emitting the definition attributes or using DW_AT_abstract_definition

This doesn't fix the abstract variable handling yet, but it introduces a
similar delay mechanism as was added for subprograms, causing
DW_AT_location to be reordered to the beginning of the attribute list
for local variables, and fixes all the test fallout for that.

A subsequent commit will remove the abstract variable handling in
DbgVariable and just do the abstract variable lookup at module end to
ensure that abstract variables introduced after their concrete
counterparts are appropriately referenced by the concrete variable.

llvm-svn: 210943

10 years agoAdd a check that we found an ABI plugin before calling a method on it.
Jason Molenda [Fri, 13 Jun 2014 22:04:15 +0000 (22:04 +0000)]
Add a check that we found an ABI plugin before calling a method on it.

llvm-svn: 210942

10 years agoDon't dereference target if it is NULL.
Greg Clayton [Fri, 13 Jun 2014 21:57:58 +0000 (21:57 +0000)]
Don't dereference target if it is NULL.

Caught by the clang static analyzer by Jason Molenda.

llvm-svn: 210941

10 years agoDebugInfo: Refactor some tests to allow DW_AT_name to not be the first attribute...
David Blaikie [Fri, 13 Jun 2014 21:52:33 +0000 (21:52 +0000)]
DebugInfo: Refactor some tests to allow DW_AT_name to not be the first attribute in a local variable.

In an effort to fix concrete variables referencing abstract origins
where the concrete variable preceeds the first inlined usage, the
addition of attributes such as name, file, etc will be delayed until the
end of the module (to wait to see if any inlined instances have
occurred, thus necessitating an abstract definition that the concrete
definition should also reference).

These test cases don't actually need to care about this ordering of
attributes, so update them to be more resilient to such changes coming
in the near future.

llvm-svn: 210940

10 years agotest/DebugInfo/X86/dbg-value-isel.s: correct lexical block descriptor to match schema
David Blaikie [Fri, 13 Jun 2014 21:52:28 +0000 (21:52 +0000)]
test/DebugInfo/X86/dbg-value-isel.s: correct lexical block descriptor to match schema

This silently broke a long time ago when I unified some aspects of the
debug info schema. I'm just cleaning these up if/when they become a
problem.

llvm-svn: 210939

10 years agoMake these two words equally bold.
Adrian Prantl [Fri, 13 Jun 2014 21:31:55 +0000 (21:31 +0000)]
Make these two words equally bold.

llvm-svn: 210938

10 years agoMake the error-handling functions thread-safe.
Zachary Turner [Fri, 13 Jun 2014 21:20:44 +0000 (21:20 +0000)]
Make the error-handling functions thread-safe.

Prior to this change, error handling functions must be installed
and removed only inside of an llvm_[start/stop]_multithreading
pair.  This change allows error handling functions to be installed
any time, and from any thread.

Reviewed by: chandlerc

Differential Revision: http://reviews.llvm.org/D4140

llvm-svn: 210937

10 years agoCopy the documentation of -fstandalone-debug from the man page to the user
Adrian Prantl [Fri, 13 Jun 2014 21:12:31 +0000 (21:12 +0000)]
Copy the documentation of -fstandalone-debug from the man page to the user
manual.

rdar://problem/17307006

llvm-svn: 210936

10 years agoAdd support for the /EP argument to clang-cl
Hans Wennborg [Fri, 13 Jun 2014 20:59:54 +0000 (20:59 +0000)]
Add support for the /EP argument to clang-cl

This maps the /EP argument to both -E and -P.

Patch by Ehsan Akhgari!

Differential Reviion: http://reviews.llvm.org/D4133

llvm-svn: 210935

10 years agoFix test for release builds.
Tim Northover [Fri, 13 Jun 2014 20:00:38 +0000 (20:00 +0000)]
Fix test for release builds.

llvm-svn: 210934

10 years agoAdd intptr types
Jan Vesely [Fri, 13 Jun 2014 19:43:18 +0000 (19:43 +0000)]
Add intptr types

Based on clang's stdint.h

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 210933

10 years agoAtomics: emit "cmpxchg weak" where possible
Tim Northover [Fri, 13 Jun 2014 19:43:04 +0000 (19:43 +0000)]
Atomics: emit "cmpxchg weak" where possible

Most builtins date from before the "cmpxchg weak" was a gleam in the
C++ committee's eye, so fortunately not much needs to change. But a
few of them *do* acknowledge that failure is possible.

For these, we'll emit the usual cartesian product of cmpxchg
operations if we can't statically determine weakness.  CodeGen can
sort it out later if the function gets inlined.

The only other non-trivial aspect of this is (I think) that we emit
the scalar expression for "IsWeak" once, at the beginning, and
propagate its value through the successive blocks. There's not much in
it, but it's slightly more consistent with the existing handling of
FailureOrder.

llvm-svn: 210932

10 years agoAdded gdb-remote stop packet expedited register tests.
Todd Fiala [Fri, 13 Jun 2014 19:11:33 +0000 (19:11 +0000)]
Added gdb-remote stop packet expedited register tests.

Expedited registers currently checked for are pc, fp and sp.

Also broke out the gdb-remote base test case logic into
class gdbremote_testcase.GdbRemoteTestCaseBase in the new
gdbremote_testcase.py file.

TestGdbRemoteExpeditedRegisters.py is the first gdb-remote area
to be contained in its own test case class file.

The monolithic TestLldbGdbServer.py has been modified to derive
from gdbremote_testcase.GdbRemoteTestCaseBase.  Soon I will
pull out all the gdb-remote functional area tests from that class
into separate classes.

I'm intending to start all GdbRemote test cases with GdbRemote
so it is easy to run them all with a -p pattern match on the
test run infrastructure.

Also scanned and removed all cases of whitespace-only lines in
the files I touched.

llvm-svn: 210931

10 years ago[PPC64LE] Run some existing Altivec tests on powerpc64le as well
Bill Schmidt [Fri, 13 Jun 2014 18:30:06 +0000 (18:30 +0000)]
[PPC64LE] Run some existing Altivec tests on powerpc64le as well

There are several Altivec tests that formerly ran only on big-endian
targets (and in some cases only on 32-bit targets).  It is useful to
verify these on little-endian targets as well.

While testing these, I discovered a typo in <altivec.h>.  This is also
fixed by this patch.

llvm-svn: 210928

10 years ago[Refactor] C++11 Memory access iterators in SCoP stmts
Johannes Doerfert [Fri, 13 Jun 2014 18:01:45 +0000 (18:01 +0000)]
[Refactor] C++11 Memory access iterators in SCoP stmts

+ Added const iterator version
+ Changed name to begin/end to allow range loops
+ Changed call sites to range loops
+ Changed typename to (const_)iterator

llvm-svn: 210927

10 years ago[Refactor] Simplify dependency map dump
Johannes Doerfert [Fri, 13 Jun 2014 18:00:22 +0000 (18:00 +0000)]
[Refactor] Simplify dependency map dump

llvm-svn: 210926

10 years agoAdds a Pragma spelling for attributes to tablegen and makes use of it for loop
Tyler Nowicki [Fri, 13 Jun 2014 17:57:25 +0000 (17:57 +0000)]
Adds a Pragma spelling for attributes to tablegen and makes use of it for loop
hint attributes. Includes tests for pragma printing and for attribute order
which is incorrectly reversed by ParsedAttributes.

Reviewed by Aaron Ballman

llvm-svn: 210925

10 years agoRemove top-level Clang -fsanitize= flags for optional ASan features.
Alexey Samsonov [Fri, 13 Jun 2014 17:53:44 +0000 (17:53 +0000)]
Remove top-level Clang -fsanitize= flags for optional ASan features.

Init-order and use-after-return modes can currently be enabled
by runtime flags. use-after-scope mode is not really working at the
moment.

The only problem I see is that users won't be able to disable extra
instrumentation for init-order and use-after-scope by a top-level Clang flag.
But this instrumentation was implicitly enabled for quite a while and
we didn't hear from users hurt by it.

llvm-svn: 210924

10 years agoX86: lower ATOMIC_CMP_SWAP_WITH_SUCCESS directly
Tim Northover [Fri, 13 Jun 2014 17:29:39 +0000 (17:29 +0000)]
X86: lower ATOMIC_CMP_SWAP_WITH_SUCCESS directly

Lowering this new node allows us to fold the almost universal
comparison for success before it's even formed. Instead we can create
a copy from EFLAGS and an X86ISD::SETCC operation since all "cmpxchg"
instructions set the zero-flag to the correct value.

rdar://problem/13201607

llvm-svn: 210923

10 years agoR600: Cleanup some old AMDIL stuff.
Matt Arsenault [Fri, 13 Jun 2014 17:20:53 +0000 (17:20 +0000)]
R600: Cleanup some old AMDIL stuff.

Move / delete some of the more obviously wrong
setOperationAction calls. Most of these are setting Expand
for types that aren't legal which is the default anyway.
Leave stuff that might require more thought on whether it's
junk or not as it is.

No functionality change.

llvm-svn: 210922

10 years agoUpdate for llvm api change.
Rafael Espindola [Fri, 13 Jun 2014 17:20:50 +0000 (17:20 +0000)]
Update for llvm api change.

llvm-svn: 210921

10 years agoFinishing touch for the std::error_code transition.
Rafael Espindola [Fri, 13 Jun 2014 17:20:48 +0000 (17:20 +0000)]
Finishing touch for the std::error_code transition.

While std::error_code itself seems to work OK in all platforms, there
are few annoying differences with regards to the std::errc enumeration.

This patch adds a simple llvm enumeration, which will hopefully avoid build
breakages in other platforms and surprises as we get more uses of
std::error_code.

llvm-svn: 210920

10 years agoUpdate for llvm api change.
Rafael Espindola [Fri, 13 Jun 2014 17:20:48 +0000 (17:20 +0000)]
Update for llvm api change.

llvm-svn: 210919

10 years agoFirst commit. Modified FIXME comment.
Tyler Nowicki [Fri, 13 Jun 2014 17:15:27 +0000 (17:15 +0000)]
First commit. Modified FIXME comment.

llvm-svn: 210918

10 years agoAtomics: make use of the "cmpxchg weak" instruction.
Tim Northover [Fri, 13 Jun 2014 16:45:52 +0000 (16:45 +0000)]
Atomics: make use of the "cmpxchg weak" instruction.

This also simplifies the IR we create slightly: instead of working out
where success & failure should go manually, it turns out we can just
always jump to a success/failure block created for the purpose. Later
phases will sort out the mess without much difficulty.

llvm-svn: 210917

10 years agoAtomics: switch direction of cmpxchg comparison
Tim Northover [Fri, 13 Jun 2014 16:45:36 +0000 (16:45 +0000)]
Atomics: switch direction of cmpxchg comparison

This has two benefits: it makes the result more suitable for direct
insertaion into the struct to emulate the new cmpxchg, and it means
the name we give the instruction matches its actual effect better.

llvm-svn: 210916

10 years agoR600: Remove AMDIL instruction and register definitions
Tom Stellard [Fri, 13 Jun 2014 16:38:59 +0000 (16:38 +0000)]
R600: Remove AMDIL instruction and register definitions

Most of these are no longer used any more.

llvm-svn: 210915

10 years agoopt: Initialize asm printers
Tobias Grosser [Fri, 13 Jun 2014 16:12:08 +0000 (16:12 +0000)]
opt: Initialize asm printers

Without initializing the assembly printers a shared library build of opt is
linked with these libraries whereas for a static build these libraries are dead
code eliminated. This is unfortunate for plugins in case they want to use them,
as they neither can rely on opt to provide this functionality nor can they link
the printers in themselves as this breaks with a shared object build of opt.

This patch calls InitializeAllAsmPrinters() from opt, which increases the static
binary size from 50MB -> 52MB on my system (all backends compiled) and causes no
measurable increase in the time needed to run 'make check'.

llvm-svn: 210914

10 years agoRemove unused and odd code.
Rafael Espindola [Fri, 13 Jun 2014 15:36:45 +0000 (15:36 +0000)]
Remove unused and odd code.

This code was never being used and any use of it would look fairly strange.
For example, it would try to map a NativeReaderError::file_malformed to
std::errc::invalid_argument.

llvm-svn: 210913

10 years agoRemove unused and odd code.
Rafael Espindola [Fri, 13 Jun 2014 15:36:17 +0000 (15:36 +0000)]
Remove unused and odd code.

This code was never being used and any use of it would look fairly strange.
For example, it would try to map a object_error::parse_failed to
std::errc::invalid_argument.

llvm-svn: 210912

10 years agoRemove broken include.
Rafael Espindola [Fri, 13 Jun 2014 15:21:50 +0000 (15:21 +0000)]
Remove broken include.

Looks like I got some git merge wrong.

llvm-svn: 210911

10 years agoFix KillTheDoctor after r210725.
Rafael Espindola [Fri, 13 Jun 2014 15:01:11 +0000 (15:01 +0000)]
Fix KillTheDoctor after r210725.

We don't map these windows errors to generic ones since errc::timed_out is
not defined on mingw. Just use the raw windows error value.

llvm-svn: 210910

10 years agoSCCP: update for cmpxchg returning { iN, i1 } now.
Tim Northover [Fri, 13 Jun 2014 14:54:09 +0000 (14:54 +0000)]
SCCP: update for cmpxchg returning { iN, i1 } now.

I accidentally missed this one since its use looked OK locally.

llvm-svn: 210909

10 years ago[mips][mips64r6] Relocation R_MIPS_PC18_S3
Zoran Jovanovic [Fri, 13 Jun 2014 14:26:47 +0000 (14:26 +0000)]
[mips][mips64r6] Relocation R_MIPS_PC18_S3
Differential Revision: http://reviews.llvm.org/D3890

llvm-svn: 210908

10 years agoIR-change: cmpxchg operations now return { iN, i1 }.
Tim Northover [Fri, 13 Jun 2014 14:24:59 +0000 (14:24 +0000)]
IR-change: cmpxchg operations now return { iN, i1 }.

This is a minimal fix for clang. I'll soon add support for generating
weak variants when requested, but that's not really necessary for the
LLVM change in isolation.

llvm-svn: 210907

10 years agoTests: use CHECK-LABEL to help debugging failures
Tim Northover [Fri, 13 Jun 2014 14:24:48 +0000 (14:24 +0000)]
Tests: use CHECK-LABEL to help debugging failures

llvm-svn: 210906

10 years agoDocs: remove extra {} around result types.
Tim Northover [Fri, 13 Jun 2014 14:24:23 +0000 (14:24 +0000)]
Docs: remove extra {} around result types.

It makes the types look like they're single-element structures. And
when we have instructions that *do* result in a struct, that can get
confusing rather quickly.

llvm-svn: 210905

10 years agoDocs: fix grammar error in description
Tim Northover [Fri, 13 Jun 2014 14:24:16 +0000 (14:24 +0000)]
Docs: fix grammar error in description

llvm-svn: 210904

10 years agoIR: add "cmpxchg weak" variant to support permitted failure.
Tim Northover [Fri, 13 Jun 2014 14:24:07 +0000 (14:24 +0000)]
IR: add "cmpxchg weak" variant to support permitted failure.

This commit adds a weak variant of the cmpxchg operation, as described
in C++11. A cmpxchg instruction with this modifier is permitted to
fail to store, even if the comparison indicated it should.

As a result, cmpxchg instructions must return a flag indicating
success in addition to their original iN value loaded. Thus, for
uniformity *all* cmpxchg instructions now return "{ iN, i1 }". The
second flag is 1 when the store succeeded.

At the DAG level, a new ATOMIC_CMP_SWAP_WITH_SUCCESS node has been
added as the natural representation for the new cmpxchg instructions.
It is a strong cmpxchg.

By default this gets Expanded to the existing ATOMIC_CMP_SWAP during
Legalization, so existing backends should see no change in behaviour.
If they wish to deal with the enhanced node instead, they can call
setOperationAction on it. Beware: as a node with 2 results, it cannot
be selected from TableGen.

Currently, no use is made of the extra information provided in this
patch. Test updates are almost entirely adapting the input IR to the
new scheme.

Summary for out of tree users:
------------------------------

+ Legacy Bitcode files are upgraded during read.
+ Legacy assembly IR files will be invalid.
+ Front-ends must adapt to different type for "cmpxchg".
+ Backends should be unaffected by default.

llvm-svn: 210903

10 years agoDo not store duplicate parents when memoization data is available.
Samuel Benzaquen [Fri, 13 Jun 2014 13:31:40 +0000 (13:31 +0000)]
Do not store duplicate parents when memoization data is available.

Summary:
Do not store duplicate parents when memoization data is available.
This does not solve the duplication problem, but ameliorates it.

Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D4124

llvm-svn: 210902

10 years agoFix bad copy-and-paste from r210652. AVX512 masked leading zero intrinsics.
Cameron McInally [Fri, 13 Jun 2014 13:20:01 +0000 (13:20 +0000)]
Fix bad copy-and-paste from r210652. AVX512 masked leading zero intrinsics.

llvm-svn: 210901

10 years ago[mips] Add cache and pref instructions
Daniel Sanders [Fri, 13 Jun 2014 13:15:59 +0000 (13:15 +0000)]
[mips] Add cache and pref instructions

Summary:
cache and pref were added in MIPS-III, and MIPS32 but were re-encoded in
MIPS32r6/MIPS64r6 to use a 9-bit offset rather than the 16-bit offset
available to earlier cores.

Resolved the decoding conflict between pref and lwc3.

Depends on D4115

Reviewers: zoran.jovanovic, jkolek, vmedic

Reviewed By: vmedic

Differential Revision: http://reviews.llvm.org/D4116

llvm-svn: 210900

10 years ago[mips][mips64r6] bc1any[24] are not available on MIPS32r6/MIPS64r6
Daniel Sanders [Fri, 13 Jun 2014 13:08:38 +0000 (13:08 +0000)]
[mips][mips64r6] bc1any[24] are not available on MIPS32r6/MIPS64r6

Summary:
These MIPS-3D instructions have never been implemented in LLVM so we only
add testcases.

Reviewers: zoran.jovanovic, jkolek, vmedic

Reviewed By: vmedic

Differential Revision: http://reviews.llvm.org/D4115

llvm-svn: 210899

10 years ago[mips][mips64r6] b(ge|lt)zal are not available on MIPS32r6/MIPS64r6 and bal is a...
Daniel Sanders [Fri, 13 Jun 2014 13:02:52 +0000 (13:02 +0000)]
[mips][mips64r6] b(ge|lt)zal are not available on MIPS32r6/MIPS64r6 and bal is a normal instruction

Summary:
b(ge|lt)zal have been removed in MIPS32r6/MIPS64r6. However, bal (an alias
for 'bgezal $zero, $offset') still remains with the same encoding it had
prior to MIPS32r6/MIPS64r6.

Updated the MipsNaCLELFStreamer, and MipsLongBranch to correctly handle the
MIPS32r6/MIPS64r6 BAL instruction in addition to the existing BAL_BR pseudo.

No changes were required to the CodeGen test that looks for BAL
(test/CodeGen/Mips/longbranch.ll) since the new instruction has the same
syntax.

Depends on D4113

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

Differential Revision: http://reviews.llvm.org/D4114

llvm-svn: 210898

10 years ago[mips][mips64r6] daddi is not available on MIPS64r6
Daniel Sanders [Fri, 13 Jun 2014 12:49:06 +0000 (12:49 +0000)]
[mips][mips64r6] daddi is not available on MIPS64r6

Summary:
It's not emitted by the code generator so we only need assembler tests.

Also added missing daddi aliases from dsub mnemonics, and removed a couple
duplicate dsub tests.

Depends on D4112

Reviewers: zoran.jovanovic, jkolek, vmedic

Reviewed By: vmedic

Differential Revision: http://reviews.llvm.org/D4113

llvm-svn: 210897

10 years agoAdd files forgotten in the previous commit
Jeroen Ketema [Fri, 13 Jun 2014 12:33:40 +0000 (12:33 +0000)]
Add files forgotten in the previous commit

llvm-svn: 210896

10 years ago[Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt.
NAKAMURA Takumi [Fri, 13 Jun 2014 12:23:56 +0000 (12:23 +0000)]
[Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt.

It has exit code as 3. abort(), aka unreachable, may be handled as crash.

FIXME: Could we move this into Win32/Program.inc?
llvm-svn: 210895

10 years agollvm/test/CodeGen/X86/fast-isel-args-fail2.ll: Don't expect to fail with -Asserts...
NAKAMURA Takumi [Fri, 13 Jun 2014 12:05:06 +0000 (12:05 +0000)]
llvm/test/CodeGen/X86/fast-isel-args-fail2.ll: Don't expect to fail with -Asserts. It might or might not crash.

llvm-svn: 210894

10 years ago[Mips] Make exe-fileheader.test test case independent from external input files.
Simon Atanasyan [Fri, 13 Jun 2014 11:44:23 +0000 (11:44 +0000)]
[Mips] Make exe-fileheader.test test case independent from external input files.

llvm-svn: 210893

10 years agoAdd HasCDI predicate to AVX512 VPBROADCASTM*.
Cameron McInally [Fri, 13 Jun 2014 11:40:31 +0000 (11:40 +0000)]
Add HasCDI predicate to AVX512 VPBROADCASTM*.

llvm-svn: 210892

10 years agoImplementations for exp(float) and exp(double) v2
Jeroen Ketema [Fri, 13 Jun 2014 09:40:09 +0000 (09:40 +0000)]
Implementations for exp(float) and exp(double) v2

Use separate implementations instead of a macro
to ensure the constant multiplied with is of
higher precision.

v2: Use the correct formula, spotted by Dan Liew <daniel.liew@imperial.ac.uk>

Reviewed-by: Aaron Warty <awatry@gmail.com>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 210891

10 years agoCPP backend: set volatile property on atomic instructions.
Tim Northover [Fri, 13 Jun 2014 09:14:50 +0000 (09:14 +0000)]
CPP backend: set volatile property on atomic instructions.

llvm-svn: 210890

10 years agoARM: Fix fastcc calling convention for Thumb1
Oliver Stannard [Fri, 13 Jun 2014 08:33:03 +0000 (08:33 +0000)]
ARM: Fix fastcc calling convention for Thumb1

When targetting Thumb1 on a processor which has a VFP unit (which
is not accessible from Thumb1), we were converting the fastcc calling
convention to AAPCS-VFP, which is not possible.

llvm-svn: 210889

10 years agoR600: Don't call setOperationAction with things that aren't opcodes.
Matt Arsenault [Fri, 13 Jun 2014 07:44:38 +0000 (07:44 +0000)]
R600: Don't call setOperationAction with things that aren't opcodes.

CondCode actions are set with setCondCodeAction.
This should have been a harmless bug since the values seem to only
collide only with nodes that don't need to be handled, and these are
already correctly setup elsewhere.

llvm-svn: 210888

10 years agoclang-format: [JS] Understand named function literals.
Daniel Jasper [Fri, 13 Jun 2014 07:02:04 +0000 (07:02 +0000)]
clang-format: [JS] Understand named function literals.

Before:
  return {a: function SomeFunction(){// ...
                                     return 1;
  }
  }
  ;

After:
  return {
    a: function SomeFunction() {
      // ...
      return 1;
    }
  };

llvm-svn: 210887

10 years agoMS ABI: Fix inheritance model calculation in CRTP
David Majnemer [Fri, 13 Jun 2014 06:43:46 +0000 (06:43 +0000)]
MS ABI: Fix inheritance model calculation in CRTP

CRTP-like patterns involve a class which inherits from another class
using itself as a template parameter.

However, the base class itself may try to create a pointer-to-member
which involves the derived class.  This is problematic because we
may not have finished parsing the most derived classes' base specifiers
yet.

It turns out that MSVC simply uses the unspecified inheritance model
instead of doing anything fancy.

This fixes PR19987.

llvm-svn: 210886