platform/upstream/llvm.git
9 years agoRemove trailing whitespace. NFC ®
Alex Rosenberg [Mon, 26 Jan 2015 18:02:18 +0000 (18:02 +0000)]
Remove trailing whitespace. NFC ®

llvm-svn: 227105

9 years agoObjective-C SDK modernizer to use NS_ENUM/NS_OPTIONS macros
Fariborz Jahanian [Mon, 26 Jan 2015 17:41:03 +0000 (17:41 +0000)]
Objective-C SDK modernizer to use NS_ENUM/NS_OPTIONS macros
with typed enums. rdar://19352510

llvm-svn: 227104

9 years agoRemove trailing whitespace.
Alex Rosenberg [Mon, 26 Jan 2015 17:35:56 +0000 (17:35 +0000)]
Remove trailing whitespace.

Also test commit email processing by including this char: '®'

llvm-svn: 227103

9 years agoMove the Mips target to storing the ABI in the TargetMachine rather
Eric Christopher [Mon, 26 Jan 2015 17:33:46 +0000 (17:33 +0000)]
Move the Mips target to storing the ABI in the TargetMachine rather
than on MipsSubtargetInfo.

This required a bit of massaging in the MC level to handle this since
MC is a) largely a collection of disparate classes with no hierarchy,
and b) there's no overarching equivalent to the TargetMachine, instead
only the subtarget via MCSubtargetInfo (which is the base class of
TargetSubtargetInfo).

We're now storing the ABI in both the TargetMachine level and in the
MC level because the AsmParser and the TargetStreamer both need to
know what ABI we have to parse assembly and emit objects. The target
streamer has a pointer to the one in the asm parser and is updated
when the asm parser is created. This is fragile as the FIXME comment
notes, but shouldn't be a problem in practice since we always
create an asm parser before attempting to emit object code via the
assembler. The TargetMachine now contains the ABI so that the DataLayout
can be constructed dependent upon ABI.

All testcases have been updated to use the -target-abi command line
flag so that we can set the ABI without using a subtarget feature.

Should be no change visible externally here.

llvm-svn: 227102

9 years agoStore the passed in CPU name string so that it can be accessed later.
Eric Christopher [Mon, 26 Jan 2015 17:33:30 +0000 (17:33 +0000)]
Store the passed in CPU name string so that it can be accessed later.

llvm-svn: 227101

9 years ago[Msan] Fix the statfs unit test to pass on FreeBSD
Viktor Kutuzov [Mon, 26 Jan 2015 17:31:23 +0000 (17:31 +0000)]
[Msan] Fix the statfs unit test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D7144

llvm-svn: 227100

9 years agoFix incorrect partial aliasing
Daniel Berlin [Mon, 26 Jan 2015 17:31:17 +0000 (17:31 +0000)]
Fix incorrect partial aliasing
Update testcases

llvm-svn: 227099

9 years agoFix delegation
Daniel Berlin [Mon, 26 Jan 2015 17:30:39 +0000 (17:30 +0000)]
Fix delegation

llvm-svn: 227098

9 years agoFix PR21428. Buffer was one byte too small in octal formatting case. Add test
Marshall Clow [Mon, 26 Jan 2015 17:24:52 +0000 (17:24 +0000)]
Fix PR21428. Buffer was one byte too small in octal formatting case. Add test

llvm-svn: 227097

9 years agoFix darwin-debug build in cmake (OS X)
Zachary Turner [Mon, 26 Jan 2015 17:23:18 +0000 (17:23 +0000)]
Fix darwin-debug build in cmake (OS X)

This patch fixes test_launch_in_terminal test which doesn't work
in OS X since the moment as it was added in r225284. The test fails
because Target::Launch returns the following error: "the darwin-debug
executable doesn't exist at
<output_dir>/lib/python2.7/site-packages/lldb/darwin-debug'".

Patch by Ilia K
Differential Revision: http://reviews.llvm.org/D7102

llvm-svn: 227096

9 years agofix line-endings; NFC
Sanjay Patel [Mon, 26 Jan 2015 17:21:36 +0000 (17:21 +0000)]
fix line-endings; NFC

llvm-svn: 227095

9 years ago[Support][Windows] Disable error dialog boxes when stack trace printing is enabled.
Michael J. Spencer [Mon, 26 Jan 2015 17:05:02 +0000 (17:05 +0000)]
[Support][Windows] Disable error dialog boxes when stack trace printing is enabled.

llvm-svn: 227094

9 years agoPutting all the standard tool options into a "Generic" category.
Chris Bieneman [Mon, 26 Jan 2015 16:56:00 +0000 (16:56 +0000)]
Putting all the standard tool options into a "Generic" category.

Summary:
This puts all the options that CommandLine.cpp implements into a category so that the APIs to hide options can not hide based on the generic category instead of string matching a partial list of argument strings.

This patch is pretty simple and straight forward but it does impact the -help output of all tools using cl::opt. Specifically the options implemented in CommandLine.cpp (help, help-list, help-hidden, help-list-hidden, print-options, print-all-options, version) are all grouped together into an Option category, and these options are never hidden by the cl::HideUnrelatedOptions API.

Reviewers: dexonsmith, chandlerc, majnemer

Subscribers: llvm-commits

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

llvm-svn: 227093

9 years ago[FIX] Debug build + instrinsic handling
Johannes Doerfert [Mon, 26 Jan 2015 15:55:54 +0000 (15:55 +0000)]
[FIX] Debug build + instrinsic handling

  The ignored intrinsics needed to be ignored in three other places as
  well. Tests and lnt pass now.

llvm-svn: 227092

9 years ago[MC] The PS4's ELF OSABI value is the same as FreeBSD.
Alex Rosenberg [Mon, 26 Jan 2015 15:42:07 +0000 (15:42 +0000)]
[MC] The PS4's ELF OSABI value is the same as FreeBSD.

llvm-svn: 227091

9 years agoTeach the autoconf machinery about the PS4 triple.
Alex Rosenberg [Mon, 26 Jan 2015 15:25:05 +0000 (15:25 +0000)]
Teach the autoconf machinery about the PS4 triple.

(I think the last checkin, r227060, got lost from the mailing lists because of the (R) in the comment.)

llvm-svn: 227090

9 years ago[mips] Enable arithmetic and binary operations for the i128 data type.
Vasileios Kalintiris [Mon, 26 Jan 2015 12:33:22 +0000 (12:33 +0000)]
[mips] Enable arithmetic and binary operations for the i128 data type.

Summary:
This patch adds support for some operations that were missing from
128-bit integer types (add/sub/mul/sdiv/udiv... etc.). With these
changes we can support the __int128_t and __uint128_t data types
from C/C++.

Depends on D7125

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 227089

9 years agoFor NetBSD/ARM-EB, link with --be8. Support for the older BE32 is
Joerg Sonnenberger [Mon, 26 Jan 2015 12:30:16 +0000 (12:30 +0000)]
For NetBSD/ARM-EB, link with --be8. Support for the older BE32 is
currently not planned.

llvm-svn: 227088

9 years ago[mips] Add tests for bitwise binary and integer arithmetic operators.
Vasileios Kalintiris [Mon, 26 Jan 2015 12:04:40 +0000 (12:04 +0000)]
[mips] Add tests for bitwise binary and integer arithmetic operators.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 227087

9 years agoAlso except OSError when terminating a child.
Hafiz Abid Qadeer [Mon, 26 Jan 2015 12:03:05 +0000 (12:03 +0000)]
Also except OSError when terminating a child.
Ilia K <ki.stfu@gmail.com> sent this patch. He noted that it was possible for
child to be terminated after isAlive call and before we send it quit command.
In this case, sending command to it causes OSError. This patch just adds this
exception to the except list.

llvm-svn: 227086

9 years agoThe canonical CPU variant for ARM according to config.guess uses a
Joerg Sonnenberger [Mon, 26 Jan 2015 11:41:48 +0000 (11:41 +0000)]
The canonical CPU variant for ARM according to config.guess uses a
suffix it seems:

    # ./config.guess
    earmv7hfeb-unknown-netbsd7.99.4

Extend the triple parsing to support this. Avoid running the ARM parser
multiple times because StringSwitch is not lazy.

Reviewers: Renato Golin, Tim Northover

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

llvm-svn: 227085

9 years agoWhen disassembler meets compact jump instructions for r6 it crashes as the access...
Vladimir Medic [Mon, 26 Jan 2015 10:33:43 +0000 (10:33 +0000)]
When disassembler meets compact jump instructions for r6 it crashes as the access to operands array is out of range. This patch removes dedicated decoder method that wrongly handles decoding of these instructions.

llvm-svn: 227084

9 years agoAdd link to github x86-psABI repo where the ABI doc is being
Jason Molenda [Mon, 26 Jan 2015 10:07:39 +0000 (10:07 +0000)]
Add link to github x86-psABI repo where the ABI doc is being
revised.

llvm-svn: 227083

9 years agoRevert "[mips] Fix assertion on i128 addition/subtraction on MIPS64"
Vasileios Kalintiris [Mon, 26 Jan 2015 09:53:30 +0000 (09:53 +0000)]
Revert "[mips] Fix assertion on i128 addition/subtraction on MIPS64"

This reverts commit r227003. Support for addition/subtraction and
various other operations for the i128 data type will be added in a
future commit based on the review D7143.

llvm-svn: 227082

9 years agopath.data() may return a non null terminated string
Jean-Daniel Dupas [Mon, 26 Jan 2015 09:52:37 +0000 (09:52 +0000)]
path.data() may return a non null terminated string
and raw_fd_ostream constructor expects a StringRef.

llvm-svn: 227081

9 years agoRevert llvm/test/MC/ELF/noexec.s in r227074, "Fix a problem where the AArch64 ELF...
NAKAMURA Takumi [Mon, 26 Jan 2015 09:30:29 +0000 (09:30 +0000)]
Revert llvm/test/MC/ELF/noexec.s in r227074, "Fix a problem where the AArch64 ELF assembler was failing with"

It should be split into target-specific location.

llvm-svn: 227080

9 years ago[X86] Add AVX512 integer comparison intrinsics for word and byte vectors.
Craig Topper [Mon, 26 Jan 2015 09:24:10 +0000 (09:24 +0000)]
[X86] Add AVX512 integer comparison intrinsics for word and byte vectors.

llvm-svn: 227079

9 years ago[msan] Remove MSanDR reference from the manual.
Evgeniy Stepanov [Mon, 26 Jan 2015 09:17:37 +0000 (09:17 +0000)]
[msan] Remove MSanDR reference from the manual.

It is no longer supported.

llvm-svn: 227078

9 years agoSLPVectorizer: fix wrong scheduling of atomic load/stores.
Erik Eckstein [Mon, 26 Jan 2015 09:07:04 +0000 (09:07 +0000)]
SLPVectorizer: fix wrong scheduling of atomic load/stores.

This fixes PR22306.

llvm-svn: 227077

9 years agoCorrect the header guard for MipsABIInfo.h.
Eric Christopher [Mon, 26 Jan 2015 08:19:53 +0000 (08:19 +0000)]
Correct the header guard for MipsABIInfo.h.

llvm-svn: 227076

9 years ago[X86] Add more of the AVX512 integer comparision intrinsics. This adds 128 and 256...
Craig Topper [Mon, 26 Jan 2015 08:11:49 +0000 (08:11 +0000)]
[X86] Add more of the AVX512 integer comparision intrinsics. This adds 128 and 256 bit vectors of dwords and qwords.

llvm-svn: 227075

9 years agoFix a problem where the AArch64 ELF assembler was failing with
Eric Christopher [Mon, 26 Jan 2015 06:32:17 +0000 (06:32 +0000)]
Fix a problem where the AArch64 ELF assembler was failing with
-no-exec-stack. This was due to it not deriving from the correct
asm info base class and missing the override for the exec
stack section query. Added another line to the noexec test
line to make sure this doesn't regress.

llvm-svn: 227074

9 years agoDon't let virtual calls and dynamic casts call Sema::MarkVTableUsed().
Nico Weber [Mon, 26 Jan 2015 06:23:36 +0000 (06:23 +0000)]
Don't let virtual calls and dynamic casts call Sema::MarkVTableUsed().

clang currently calls MarkVTableUsed() for classes that get their virtual
methods called or that participate in a dynamic_cast. This is unnecessary,
since CodeGen only emits vtables when it generates constructor, destructor, and
vtt code. (*)

Note that Sema::MarkVTableUsed() doesn't cause the emission of a vtable.
Its main user-visible effect is that it instantiates virtual member functions
of template classes, to make sure that if codegen decides to write a vtable
all the entries in the vtable are defined.

While this shouldn't change the behavior of codegen (other than being faster),
it does make clang more permissive: virtual methods of templates (in particular
destructors) end up being instantiated less often. In particular, classes that
have members that are smart pointers to incomplete types will now get their
implicit virtual destructor instantiated less frequently. For example, this
used to not compile but does now compile:

    template <typename T> struct OwnPtr {
      ~OwnPtr() { static_assert((sizeof(T) > 0), "TypeMustBeComplete"); }
    };
    class ScriptLoader;
    struct Base { virtual ~Base(); };
    struct Sub : public Base {
      virtual void someFun() const {}
      OwnPtr<ScriptLoader> m_loader;
    };
    void f(Sub *s) { s->someFun(); }

The more permissive behavior matches both gcc (where this is not often
observable, since in practice most things with virtual methods have a key
function, and Sema::DefineUsedVTables() skips vtables for classes with key
functions) and cl (which is my motivation for this change) – this fixes
PR20337.  See this issue and the review thread for some discussions about
optimizations.

This is similar to r213109 in spirit. r225761 was a prerequisite for this
change.

Various tests relied on "a->f()" marking a's vtable as used (in the sema
sense), switch these to just construct a on the stack. This forces
instantiation of the implicit constructor, which will mark the vtable as used.

(*) The exception is -fapple-kext mode: In this mode, qualified calls to
virtual functions (`a->Base::f()`) still go through the vtable, and since the
vtable pointer off this doesn't point to Base's vtable, this needs to reference
Base's vtable directly. To keep this working, keep referencing the vtable for
virtual calls in apple kext mode.

llvm-svn: 227073

9 years agoTest that member functions of constexpr constructed templates are instantiated.
Nico Weber [Mon, 26 Jan 2015 06:08:07 +0000 (06:08 +0000)]
Test that member functions of constexpr constructed templates are instantiated.

They are referenced from the vtable. (This worked fine, but I couldn't find
an existing test for this.  Maybe I didn't look hard enough.)

llvm-svn: 227072

9 years agoRemove -verify from a codegen test that didn't have any expected-foo lines.
Nico Weber [Mon, 26 Jan 2015 05:47:24 +0000 (05:47 +0000)]
Remove -verify from a codegen test that didn't have any expected-foo lines.

Makes the error output of the test more readable when it fails. Also allows
removing a "not" from the run line.

llvm-svn: 227071

9 years agoclang-format two Decl* code locations, NFC.
Yaron Keren [Mon, 26 Jan 2015 04:41:07 +0000 (04:41 +0000)]
clang-format two Decl* code locations, NFC.

llvm-svn: 227070

9 years agoReword comment.
Nico Weber [Mon, 26 Jan 2015 03:03:49 +0000 (03:03 +0000)]
Reword comment.

llvm-svn: 227069

9 years agoTest that qualified virtual calls mark vtables referenced in apple kext mode.
Nico Weber [Mon, 26 Jan 2015 02:59:07 +0000 (02:59 +0000)]
Test that qualified virtual calls mark vtables referenced in apple kext mode.

I broke this locally while working on PR20337 and no test caught that.  Now
there's coverage for this, and a comment explaining why this is needed.

llvm-svn: 227068

9 years ago[X86] Add AVX512F integer comparision intrinsics to header file.
Craig Topper [Sun, 25 Jan 2015 23:30:07 +0000 (23:30 +0000)]
[X86] Add AVX512F integer comparision intrinsics to header file.

llvm-svn: 227067

9 years ago[X86] Add immediate range checking to AVX512 integer comparision builtins.
Craig Topper [Sun, 25 Jan 2015 23:30:05 +0000 (23:30 +0000)]
[X86] Add immediate range checking to AVX512 integer comparision builtins.

llvm-svn: 227066

9 years ago[X86] Add AVX512 floating cmpgt and integer comparison builtins. Intrinsic header...
Craig Topper [Sun, 25 Jan 2015 23:30:00 +0000 (23:30 +0000)]
[X86] Add AVX512 floating cmpgt and integer comparison builtins. Intrinsic header file usages coming later.

llvm-svn: 227065

9 years ago[X86] Change comparision immediate type to i8 in test cases for AVX512 floating point...
Craig Topper [Sun, 25 Jan 2015 23:26:12 +0000 (23:26 +0000)]
[X86] Change comparision immediate type to i8 in test cases for AVX512 floating point comparisons. The type was already changed in the definitions and was being auto upgraded to the new type.

llvm-svn: 227064

9 years ago[X86] Use i8 immediate for comparison type on AVX512 packed integer instructions...
Craig Topper [Sun, 25 Jan 2015 23:26:02 +0000 (23:26 +0000)]
[X86] Use i8 immediate for comparison type on AVX512 packed integer instructions. This matches floating point equivalents. Includes autoupgrade support to convert old code.

llvm-svn: 227063

9 years agoAllows Clang to use LLVM's fixes-x18 option
Renato Golin [Sun, 25 Jan 2015 23:17:48 +0000 (23:17 +0000)]
Allows Clang to use LLVM's fixes-x18 option

This patch allows clang to have llvm reserve the x18
platform register on AArch64. FreeBSD will use this in the kernel for
per-cpu data but has no need to reserve this register in userland so
will need this flag to reserve it.

This uses llvm r226664 to allow this register to be reserved.

Patch by Andrew Turner.

llvm-svn: 227062

9 years agoclang/test/Driver/rewrite-map-in-diagnostics.c: This depends on crash-recovery.
NAKAMURA Takumi [Sun, 25 Jan 2015 23:10:21 +0000 (23:10 +0000)]
clang/test/Driver/rewrite-map-in-diagnostics.c: This depends on crash-recovery.

llvm-svn: 227061

9 years agoAdd the triple for the Sony Playstation®4.
Alex Rosenberg [Sun, 25 Jan 2015 22:46:59 +0000 (22:46 +0000)]
Add the triple for the Sony Playstation®4.

Lots more to follow.

llvm-svn: 227060

9 years ago[Mips] Add checking of disassembler output in some test cases
Simon Atanasyan [Sun, 25 Jan 2015 21:31:52 +0000 (21:31 +0000)]
[Mips] Add checking of disassembler output in some test cases

No functional changes.

llvm-svn: 227059

9 years ago[Mips] Teach LLD to recognize one more MIPS target triple - mips64el
Simon Atanasyan [Sun, 25 Jan 2015 19:15:35 +0000 (19:15 +0000)]
[Mips] Teach LLD to recognize one more MIPS target triple - mips64el

This is initial patch to support MIPS64 object files linking.
The patch just makes some classes more generalized, and rejects
attempts to interlinking O32 and N64 ABI object files.

I try to reuse the current MIPS target related classes as much as
possible because O32 and N64 MIPS ABI are tightly related and share
almost the same set of relocations, GOT, flags etc.

llvm-svn: 227058

9 years ago[FIX] Independent blocks with intrinsics handling
Johannes Doerfert [Sun, 25 Jan 2015 19:09:49 +0000 (19:09 +0000)]
[FIX] Independent blocks with intrinsics handling

  Also an old option was removed from some new test cases

llvm-svn: 227057

9 years agoDebug info: Fix PR22296 by omitting the DW_AT_location if we lost the
Adrian Prantl [Sun, 25 Jan 2015 19:04:08 +0000 (19:04 +0000)]
Debug info: Fix PR22296 by omitting the DW_AT_location if we lost the
physical register that is described in a DBG_VALUE.

In the testcase the DBG_VALUE describing "p5" becomes unavailable
because the register its address is in is clobbered and we (currently)
aren't smart enough to realize that the value is rematerialized immediately
after the DBG_VALUE and/or is actually a stack slot.

llvm-svn: 227056

9 years ago[PowerPC] Revert ppc64le-aggregates.ll test changes from r227053
Bill Schmidt [Sun, 25 Jan 2015 18:18:54 +0000 (18:18 +0000)]
[PowerPC] Revert ppc64le-aggregates.ll test changes from r227053

It appears we have different behavior with and without -mcpu=pwr8 even
with ppc64le defaulting to POWER8.  The failure appears as follows:

/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/test/CodeGen/PowerPC/ppc64le-aggregates.ll:268:14: error: expected string not found in input
; CHECK-DAG: lfs 1, 0([[REG]])
             ^
<stdin>:497:11: note: scanning from here
 ld 3, .LC1@toc@l(3)
          ^
<stdin>:497:11: note: with variable "REG" equal to "3"
 ld 3, .LC1@toc@l(3)
          ^
<stdin>:514:2: note: possible intended match here
 lfs 1, 0(4)
 ^

Reverting this particular test case change.  Nemanja, please have a look
at the reason for the failure.

llvm-svn: 227055

9 years agoSupport for math/misc intrinsics
Johannes Doerfert [Sun, 25 Jan 2015 18:07:30 +0000 (18:07 +0000)]
Support for math/misc intrinsics

  The support is currently limited as we only allow them in the input but do
  not emit them in the transformed SCoP due to the possible semantic changes.

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

llvm-svn: 227054

9 years ago[PowerPC] Reset the baseline for ppc64le to be equivalent to pwr8
Bill Schmidt [Sun, 25 Jan 2015 18:05:42 +0000 (18:05 +0000)]
[PowerPC] Reset the baseline for ppc64le to be equivalent to pwr8

Test by Nemanja Ivanovic.

Since ppc64le implies POWER8 as a minimum, it makes sense that the
same features are included. Since the pwr8 processor model will likely
be getting new features until the implementation is complete, I
created a new list to add these updates to. This will include them in
both pwr8 and ppc64le.

Furthermore, it seems that it would make sense to compose the feature
lists for other processor models (pwr3 and up). Per discussion in the
review, I will make this change in a subsequent patch.

In order to test the changes, I've added an additional run step to
test cases that specify -march=ppc64le -mcpu=pwr8 to omit the -mcpu
option. Since the feature lists are the same, the behaviour should be
unchanged.

llvm-svn: 227053

9 years agoSema: Formatting. No behavior change.
Francisco Lopes da Silva [Sun, 25 Jan 2015 17:00:47 +0000 (17:00 +0000)]
Sema: Formatting. No behavior change.

llvm-svn: 227052

9 years ago[Mips] Make MipsELFObjectReader and MipsELFDSOReader class templates
Simon Atanasyan [Sun, 25 Jan 2015 16:38:16 +0000 (16:38 +0000)]
[Mips] Make MipsELFObjectReader and MipsELFDSOReader class templates

No functional changes.

llvm-svn: 227051

9 years ago[docs] Add link to the MIPS 64-bit ELF object file specification
Simon Atanasyan [Sun, 25 Jan 2015 16:20:30 +0000 (16:20 +0000)]
[docs] Add link to the MIPS 64-bit ELF object file specification

llvm-svn: 227050

9 years ago[Mips] Reformat the code with clang-format
Simon Atanasyan [Sun, 25 Jan 2015 16:17:16 +0000 (16:17 +0000)]
[Mips] Reformat the code with clang-format

No functional changes.

llvm-svn: 227049

9 years ago[Mips] Remove duplicated typedef's
Simon Atanasyan [Sun, 25 Jan 2015 16:17:10 +0000 (16:17 +0000)]
[Mips] Remove duplicated typedef's

No functional changes.

llvm-svn: 227048

9 years ago[Mips] Use template class argument instead of hard-coded type name in
Simon Atanasyan [Sun, 25 Jan 2015 16:17:02 +0000 (16:17 +0000)]
[Mips] Use template class argument instead of hard-coded type name in
the class field declarations.

No functional changes.

llvm-svn: 227047

9 years agoInstantiate Registry<GCStrategy> in LLVMCore, to let it available on Win32 DLL.
NAKAMURA Takumi [Sun, 25 Jan 2015 15:05:36 +0000 (15:05 +0000)]
Instantiate Registry<GCStrategy> in LLVMCore, to let it available on Win32 DLL.

llvm-svn: 227046

9 years ago[ELF] Update for LLVM api change
Simon Atanasyan [Sun, 25 Jan 2015 13:44:02 +0000 (13:44 +0000)]
[ELF] Update for LLVM api change

The `Elf_Rel_Impl::setSymbolAndType` method now has the third argument
`IsMips64EL` (like complement methods `getSymbol` and `getType`). While
we do not support linking of MIPS64 ELF object file just pass `false`
to the `setSymbolAndType`.

llvm-svn: 227045

9 years ago[ELFYAML] Support mips64 relocation record format in yaml2obj/obj2yaml
Simon Atanasyan [Sun, 25 Jan 2015 13:29:25 +0000 (13:29 +0000)]
[ELFYAML] Support mips64 relocation record format in yaml2obj/obj2yaml

MIPS64 ELF file has a very specific relocation record format. Each
record might specify up to three relocation operations. So the `r_info`
field in fact consists of three relocation type sub-fields and optional
code of "special" symbols.

http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf
page 40

The patch implements support of the MIPS64 relocation record format in
yaml2obj/obj2yaml tools by introducing new optional Relocation fields:
Type2, Type3, and SpecSym. These fields are recognized only if the
object/YAML file relates to the MIPS64 target.

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

llvm-svn: 227044

9 years agoAVX-512: Changes in operations on masks registers for KNL and SKX
Elena Demikhovsky [Sun, 25 Jan 2015 12:47:15 +0000 (12:47 +0000)]
AVX-512: Changes in operations on masks registers for KNL and SKX
- Added KSHIFTB/D/Q for skx
- Added KORTESTB/D/Q for skx
- Fixed store operation for v8i1 type for KNL
- Store size of v8i1, v4i1 and v2i1 are changed to 8 bits

llvm-svn: 227043

9 years agoOrc/IRCompileLayer.h: Avoid non-static initializer.
NAKAMURA Takumi [Sun, 25 Jan 2015 11:41:56 +0000 (11:41 +0000)]
Orc/IRCompileLayer.h: Avoid non-static initializer.

llvm-svn: 227042

9 years agoOrcJIT: Avoid non-static initializers.
NAKAMURA Takumi [Sun, 25 Jan 2015 11:41:49 +0000 (11:41 +0000)]
OrcJIT: Avoid non-static initializers.

llvm-svn: 227041

9 years agoOrc/LLVMBuild.txt: Prune redundant "Target" in libdeps.
NAKAMURA Takumi [Sun, 25 Jan 2015 11:41:41 +0000 (11:41 +0000)]
Orc/LLVMBuild.txt: Prune redundant "Target" in libdeps.

llvm-svn: 227040

9 years ago[X86] Give scalar VRNDSCALE instructions priority in AVX512 mode.
Craig Topper [Sun, 25 Jan 2015 08:49:22 +0000 (08:49 +0000)]
[X86] Give scalar VRNDSCALE instructions priority in AVX512 mode.

llvm-svn: 227039

9 years agoSimplify a multiclass. No functional change.
Craig Topper [Sun, 25 Jan 2015 08:49:19 +0000 (08:49 +0000)]
Simplify a multiclass. No functional change.

llvm-svn: 227038

9 years agoSema: require a complete type before lookup.
Francisco Lopes da Silva [Sun, 25 Jan 2015 08:47:59 +0000 (08:47 +0000)]
Sema: require a complete type before lookup.

llvm-svn: 227037

9 years agoRemove tab characters. NFC
Craig Topper [Sun, 25 Jan 2015 08:45:32 +0000 (08:45 +0000)]
Remove tab characters. NFC

llvm-svn: 227036

9 years agoImplemented cost model for masked load/store operations.
Elena Demikhovsky [Sun, 25 Jan 2015 08:44:46 +0000 (08:44 +0000)]
Implemented cost model for masked load/store operations.

llvm-svn: 227035

9 years agoFix the buildbots (fallout from r227028) by returning the exprloc of non-binary opera...
David Blaikie [Sun, 25 Jan 2015 07:44:05 +0000 (07:44 +0000)]
Fix the buildbots (fallout from r227028) by returning the exprloc of non-binary operator overload calls (and ->) to the start of the expression, not the location of the operator

I'll give this some further thought/discussion later, but this is enough
to unbreak the buildbots at least.

llvm-svn: 227034

9 years agoFix up test cases to account for improved column fidelity provided by clang
David Blaikie [Sun, 25 Jan 2015 04:39:06 +0000 (04:39 +0000)]
Fix up test cases to account for improved column fidelity provided by clang

llvm-svn: 227033

9 years ago[X86] Replace i32i8imm on SSE/AVX instructions with i32u8imm which will make the...
Craig Topper [Sun, 25 Jan 2015 02:21:16 +0000 (02:21 +0000)]
[X86] Replace i32i8imm on SSE/AVX instructions with i32u8imm which will make the assembler bounds check them. It will also make them print as unsigned.

llvm-svn: 227032

9 years ago[X86] Use u8imm in several places that used i32i8imm that don't require an i32 type.
Craig Topper [Sun, 25 Jan 2015 02:21:13 +0000 (02:21 +0000)]
[X86] Use u8imm in several places that used i32i8imm that don't require an i32 type.

llvm-svn: 227031

9 years agoRemove tab characters. NFC.
Craig Topper [Sun, 25 Jan 2015 02:21:11 +0000 (02:21 +0000)]
Remove tab characters. NFC.

llvm-svn: 227030

9 years agoRename four test files from .C to .cpp.
Nico Weber [Sun, 25 Jan 2015 02:04:36 +0000 (02:04 +0000)]
Rename four test files from .C to .cpp.

lit.cfg has never supported running .C files, so these tests were never
executed by check-clang.  Rename them to .cpp so that they run as part of
the test suite, and minorly tweak two of them that look like they were broken
when checked in to actually pass.

llvm-svn: 227029

9 years agoDebugInfo: Attribute calls to overloaded operators with the operator, not the start...
David Blaikie [Sun, 25 Jan 2015 01:25:37 +0000 (01:25 +0000)]
DebugInfo: Attribute calls to overloaded operators with the operator, not the start of the whole expression

llvm-svn: 227028

9 years agoDebugInfo: Use the preferred location rather than the start location for expression...
David Blaikie [Sun, 25 Jan 2015 01:19:10 +0000 (01:19 +0000)]
DebugInfo: Use the preferred location rather than the start location for expression line info

This causes things like assignment to refer to the '=' rather than the
LHS when attributing the store instruction, for example.

There were essentially 3 options for this:

* The beginning of an expression (this was the behavior prior to this
  commit). This meant that stepping through subexpressions would bounce
  around from subexpressions back to the start of the outer expression,
  etc. (eg: x + y + z would go x, y, x, z, x (the repeated 'x's would be
  where the actual addition occurred)).

* The end of an expression. This seems to be what GCC does /mostly/, and
  certainly this for function calls. This has the advantage that
  progress is always 'forwards' (never jumping backwards - except for
  independent subexpressions if they're evaluated in interesting orders,
  etc). "x + y + z" would go "x y z" with the additions occurring at y
  and z after the respective loads.
  The problem with this is that the user would still have to think
  fairly hard about precedence to realize which subexpression is being
  evaluated or which operator overload is being called in, say, an asan
  backtrace.

* The preferred location or 'exprloc'. In this case you get sort of what
  you'd expect, though it's a bit confusing in its own way due to going
  'backwards'. In this case the locations would be: "x y + z +" in
  lovely postfix arithmetic order. But this does mean that if the op+
  were an operator overload, say, and in a backtrace, the backtrace will
  point to the exact '+' that's being called, not to the end of one of
  its operands.

(actually the operator overload case doesn't work yet for other reasons,
but that's being fixed - but this at least gets scalar/complex
assignments and other plain operators right)

llvm-svn: 227027

9 years agoName a bool parameter. No behavior change.
Nico Weber [Sun, 25 Jan 2015 01:00:21 +0000 (01:00 +0000)]
Name a bool parameter. No behavior change.

llvm-svn: 227026

9 years ago[PM] Remove the restricted visibility from the instcombine worklist. Now
Chandler Carruth [Sun, 25 Jan 2015 00:30:05 +0000 (00:30 +0000)]
[PM] Remove the restricted visibility from the instcombine worklist. Now
that library consumers access the instcombine pass directly, they also
(transitively) access the worklist. Also, it would need to be used
directly in order to have a useful utility if we ever want that.

This should fix some warnings since I moved this code. Sorry for the
trouble.

llvm-svn: 227025

9 years agoRemove duplicate code
Nathan Sidwell [Sun, 25 Jan 2015 00:25:44 +0000 (00:25 +0000)]
Remove duplicate code

llvm-svn: 227024

9 years agoDebugInfo: Correct the line location of geps on array accesses
David Blaikie [Sat, 24 Jan 2015 23:35:17 +0000 (23:35 +0000)]
DebugInfo: Correct the line location of geps on array accesses

llvm-svn: 227023

9 years agoFirst steps in implementing DR1467: List-initialization of aggregate from same-type...
Larisse Voufo [Sat, 24 Jan 2015 23:09:54 +0000 (23:09 +0000)]
First steps in implementing DR1467: List-initialization of aggregate from same-type object.
Only the first two items for now, changing Sections 8.5.4 [dcl.init.list] paragraph 3 and 13.3.1.7 [over.match.list] paragraph 1,
so that defining class objects and character arrays using uniform initialization syntax is actually treated as list initialization
and before it is treated aggregate initialization.

llvm-svn: 227022

9 years agoRemove a few more redundant ExecutionEngine regression tests.
Lang Hames [Sat, 24 Jan 2015 22:41:13 +0000 (22:41 +0000)]
Remove a few more redundant ExecutionEngine regression tests.

llvm-svn: 227021

9 years agoFixup debug information references.
Charlie Turner [Sat, 24 Jan 2015 21:51:21 +0000 (21:51 +0000)]
Fixup debug information references.

llvm-svn: 227020

9 years agoUpdate references to lines of code count.
Charlie Turner [Sat, 24 Jan 2015 21:51:17 +0000 (21:51 +0000)]
Update references to lines of code count.

The number of lines of code in Kaleidoscope has risen from the
previously reported 700 to 986 according to the cloc tool. This tools
was run on the toy.cpp file from Chapter 8.

llvm-svn: 227019

9 years agoInstrProf: Add operator!= to coverage counters
Justin Bogner [Sat, 24 Jan 2015 21:13:23 +0000 (21:13 +0000)]
InstrProf: Add operator!= to coverage counters

I'll use this in clang shortly. Also makes the operator definition
style more consistent in this class.

llvm-svn: 227018

9 years agollvm-cov: Only combine segments if they overlap exactly
Justin Bogner [Sat, 24 Jan 2015 20:58:52 +0000 (20:58 +0000)]
llvm-cov: Only combine segments if they overlap exactly

If two coverage segments cover the same area we need to combine them,
as per r218432. OTOH, just because they start at the same place
doesn't mean they cover the same area. This fixes the check to be more
exact about this.

This is pretty hard to test right now. The frontend doesn't currently
emit regions that start at the same place but don't overlap, but some
upcoming work changes this.

llvm-svn: 227017

9 years agoRevert r227013 "Add visibility attribute for InstCombinePass (r226987)."
Patrik Hagglund [Sat, 24 Jan 2015 20:35:36 +0000 (20:35 +0000)]
Revert r227013 "Add visibility attribute for InstCombinePass (r226987)."

Buildbot breakage.
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/21749

llvm-svn: 227016

9 years agoInstrProf: Use an Optional instead of an out parameter
Justin Bogner [Sat, 24 Jan 2015 20:22:32 +0000 (20:22 +0000)]
InstrProf: Use an Optional instead of an out parameter

llvm-svn: 227015

9 years agoCodeGen: drive-by formatting clean ups
Saleem Abdulrasool [Sat, 24 Jan 2015 20:19:45 +0000 (20:19 +0000)]
CodeGen: drive-by formatting clean ups

Minor tweaks to whitespace formatting that I noticed was off.  NFC.

llvm-svn: 227014

9 years agoAdd visibility attribute for InstCombinePass (r226987).
Patrik Hagglund [Sat, 24 Jan 2015 20:06:53 +0000 (20:06 +0000)]
Add visibility attribute for InstCombinePass (r226987).

Warning by gcc:
'llvm::InstCombinePass' declared with greater visibility than the type of its field 'llvm::InstCombinePass::Worklist' [-Wattributes]

llvm-svn: 227013

9 years agoDebugInfo: Fix use after return found by asan.
Benjamin Kramer [Sat, 24 Jan 2015 19:55:23 +0000 (19:55 +0000)]
DebugInfo: Fix use after return found by asan.

llvm-svn: 227012

9 years ago[Orc] Add TransformUtils to Orc's dependency list.
Lang Hames [Sat, 24 Jan 2015 19:00:09 +0000 (19:00 +0000)]
[Orc] Add TransformUtils to Orc's dependency list.

Patch by Jan Vesely. Thanks Jan!

llvm-svn: 227011

9 years agoRemove a number of redundant ExecutionEngine regression tests.
Lang Hames [Sat, 24 Jan 2015 18:49:51 +0000 (18:49 +0000)]
Remove a number of redundant ExecutionEngine regression tests.

These tests used to test the legacy JIT but since that has been removed they're
just redundantly testing MCJIT. Remove them and just leave their counterparts in
test/ExecutionEngine/MCJIT.

llvm-svn: 227010

9 years agobpf: add missing lit.local.cfg
Alexei Starovoitov [Sat, 24 Jan 2015 18:20:52 +0000 (18:20 +0000)]
bpf: add missing lit.local.cfg

llvm-svn: 227009

9 years agoBPF backend
Alexei Starovoitov [Sat, 24 Jan 2015 17:51:26 +0000 (17:51 +0000)]
BPF backend

Summary:
V8->V9:
- cleanup tests

V7->V8:
- addressed feedback from David:
- switched to range-based 'for' loops
- fixed formatting of tests

V6->V7:
- rebased and adjusted AsmPrinter args
- CamelCased .td, fixed formatting, cleaned up names, removed unused patterns
- diffstat: 3 files changed, 203 insertions(+), 227 deletions(-)

V5->V6:
- addressed feedback from Chandler:
- reinstated full verbose standard banner in all files
- fixed variables that were not in CamelCase
- fixed names of #ifdef in header files
- removed redundant braces in if/else chains with single statements
- fixed comments
- removed trailing empty line
- dropped debug annotations from tests
- diffstat of these changes:
  46 files changed, 456 insertions(+), 469 deletions(-)

V4->V5:
- fix setLoadExtAction() interface
- clang-formated all where it made sense

V3->V4:
- added CODE_OWNERS entry for BPF backend

V2->V3:
- fix metadata in tests

V1->V2:
- addressed feedback from Tom and Matt
- removed top level change to configure (now everything via 'experimental-backend')
- reworked error reporting via DiagnosticInfo (similar to R600)
- added few more tests
- added cmake build
- added Triple::bpf
- tested on linux and darwin

V1 cover letter:
---------------------
recently linux gained "universal in-kernel virtual machine" which is called
eBPF or extended BPF. The name comes from "Berkeley Packet Filter", since
new instruction set is based on it.
This patch adds a new backend that emits extended BPF instruction set.

The concept and development are covered by the following articles:
http://lwn.net/Articles/599755/
http://lwn.net/Articles/575531/
http://lwn.net/Articles/603983/
http://lwn.net/Articles/606089/
http://lwn.net/Articles/612878/

One of use cases: dtrace/systemtap alternative.

bpf syscall manpage:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b4fc1a460f3017e958e6a8ea560ea0afd91bf6fe

instruction set description and differences vs classic BPF:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/filter.txt

Short summary of instruction set:
- 64-bit registers
  R0      - return value from in-kernel function, and exit value for BPF program
  R1 - R5 - arguments from BPF program to in-kernel function
  R6 - R9 - callee saved registers that in-kernel function will preserve
  R10     - read-only frame pointer to access stack
- two-operand instructions like +, -, *, mov, load/store
- implicit prologue/epilogue (invisible stack pointer)
- no floating point, no simd

Short history of extended BPF in kernel:
interpreter in 3.15, x64 JIT in 3.16, arm64 JIT, verifier, bpf syscall in 3.18, more to come in the future.

It's a very small and simple backend.
There is no support for global variables, arbitrary function calls, floating point, varargs,
exceptions, indirect jumps, arbitrary pointer arithmetic, alloca, etc.
From C front-end point of view it's very restricted. It's done on purpose, since kernel
rejects all programs that it cannot prove safe. It rejects programs with loops
and with memory accesses via arbitrary pointers. When kernel accepts the program it is
guaranteed that program will terminate and will not crash the kernel.

This patch implements all 'must have' bits. There are several things on TODO list,
so this is not the end of development.
Most of the code is a boiler plate code, copy-pasted from other backends.
Only odd things are lack or < and <= instructions, specialized load_byte intrinsics
and 'compare and goto' as single instruction.
Current instruction set is fixed, but more instructions can be added in the future.

Signed-off-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subscribers: majnemer, chandlerc, echristo, joerg, pete, rengolin, kristof.beyls, arsenm, t.p.northover, tstellarAMD, aemerson, llvm-commits

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

llvm-svn: 227008

9 years agotest: Convert some tests to FileCheck
Justin Bogner [Sat, 24 Jan 2015 17:39:36 +0000 (17:39 +0000)]
test: Convert some tests to FileCheck

These were all doing trivial greps. It's better to use FileCheck.

llvm-svn: 227007

9 years agotest: Remove two redundant lines from this test
Justin Bogner [Sat, 24 Jan 2015 17:39:32 +0000 (17:39 +0000)]
test: Remove two redundant lines from this test

The FileCheck already checks for these lines, no need to grep as well.

llvm-svn: 227006