Commit Graph

180647 Commits

Author SHA1 Message Date
Jan Vesely 0cd3ec6cfa utils: Fix segfault in flattencfg
v2: continue iterating through the rest of the bb
    use for loop

v3: initialize FlattenCFG pass in ScalarOps
    add test

v4: split off initializing flattencfg to a separate patch
    add comment

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 215574
2014-08-13 20:31:53 +00:00
Jan Vesely 5a956d49f7 Initialize FlattenCFG pass
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 215573
2014-08-13 20:31:52 +00:00
Zachary Turner f818625103 Update clang-format file.
llvm-svn: 215572
2014-08-13 20:08:28 +00:00
Alexey Samsonov 3551e311f0 Simplify a few loops over CallArgList/FunctionArgList. NFC
llvm-svn: 215571
2014-08-13 20:06:24 +00:00
Tobias Grosser b5c440f33f Fix formatting
llvm-svn: 215570
2014-08-13 19:39:08 +00:00
Yi Kong a5548431a5 AArch64: Prefetch intrinsic
llvm-svn: 215569
2014-08-13 19:18:20 +00:00
Yi Kong 26d104a9ec ARM: Prefetch intrinsics
llvm-svn: 215568
2014-08-13 19:18:14 +00:00
Rafael Espindola bb415eac2e Simplify memory ownership with std::unique_ptr.
llvm-svn: 215567
2014-08-13 18:59:01 +00:00
Rafael Espindola 5f2bb7d9b8 Simplify ownership with std::unique_ptr. NFC.
llvm-svn: 215566
2014-08-13 18:49:01 +00:00
Ed Maste 6bc862dcf5 Use consistent capitalization for ENABLE_THREADS in tests
llvm-svn: 215565
2014-08-13 18:27:12 +00:00
Matt Arsenault 74ef277774 R600: Correctly set the src value offset for scalarized kernel args
This for some reason fixes v1i64 kernel arguments on pre-SI. This
currently breaks some other cases in the kernel-args.ll test for R600,
but I'm not particularly confident in the new output. VTX_READ_* are not
used for some of the scalarized cases, and the code reading from the
constant buffer doesn't make much sense to me.

llvm-svn: 215564
2014-08-13 18:14:11 +00:00
Johannes Doerfert 5aa2194ea5 [Polly] Remove the PoCC and ScopLib support
Remove the PoCC and ScopLib support from Polly as we do not have a
  user/maintainer for it.

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

llvm-svn: 215563
2014-08-13 17:49:16 +00:00
Zachary Turner c7826524ac Get test executables compiling on Windows.
Many of the test executables use pthreads directly.  This isn't
portable on Windows, so this patch converts these test to use
C++11 threads and mutexes.  Since Windows' implementation of
std::thread classes throw and catch from header files, this patch
also disables exceptions when compiling with clang on Windows.

Reviewed by: Todd Fiala, Ed Maste

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

llvm-svn: 215562
2014-08-13 17:44:53 +00:00
Rafael Espindola d3d657ca0f Revert what looks like an unintended change in r215557.
Should fix test ulibc driver tests.

llvm-svn: 215561
2014-08-13 17:15:42 +00:00
Rafael Espindola 4674a876cd Small cleanup: Don't duplicate default behavior.
std::unique_ptr is null initialized and reset default to null.

Thanks to David Blaikie for noticing.

llvm-svn: 215560
2014-08-13 17:08:22 +00:00
Rafael Espindola fa49c0bf10 Use std::unique_ptr to simplify memory management a bit.
llvm-svn: 215559
2014-08-13 16:47:00 +00:00
Benjamin Kramer a7c40ef022 Canonicalize header guards into a common format.
Add header guards to files that were missing guards. Remove #endif comments
as they don't seem common in LLVM (we can easily add them back if we decide
they're useful)

Changes made by clang-tidy with minor tweaks.

llvm-svn: 215558
2014-08-13 16:26:38 +00:00
Benjamin Kramer 2f5db8b3db Header guard canonicalization, clang part.
Modifications made by clang-tidy with minor tweaks.

llvm-svn: 215557
2014-08-13 16:25:19 +00:00
Benjamin Foster bdefab961a Test commit, remove trailing whitespace
llvm-svn: 215556
2014-08-13 16:11:50 +00:00
Andrea Di Biagio ace8e1e3d4 [DAGCombiner] Improved target independent vector shuffle combine rule.
This patch improves the existing algorithm in DAGCombiner that
attempts to fold shuffles according to rule:
  shuffle(shuffle(x, y, M1), undef, M2) -> shuffle(y, undef, M3)

Before this change, there were cases where the DAGCombiner conservatively
avoided folding shuffles even if the resulting mask would have been legal.
That is because the algorithm wrongly assumed that commuting
an illegal shuffle mask would always produce an illegal mask.

With this change, we now correctly compute the commuted shuffle mask before
calling method 'isShuffleMaskLegal' on it.
On X86, this improves for example the codegen for the following function:

define <4 x i32> @test(<4 x i32> %A, <4 x i32> %B) {
  %1 = shufflevector <4 x i32> %B, <4 x i32> %A, <4 x i32> <i32 1, i32 2, i32 6, i32 7>
  %2 = shufflevector <4 x i32> %1, <4 x i32> undef, <4 x i32> <i32 2, i32 3, i32 2, i32 3>
  ret <4 x i32> %2
}

Before this change the X86 backend (-mcpu=corei7) generated
the following assembly code for function @test:
  shufps $-23, %xmm0, %xmm1  # xmm1 = xmm1[1,2],xmm0[2,3]
  movhlps %xmm1, %xmm1       # xmm1 = xmm1[1,1]
  movaps %xmm1, %xmm0

Now we produce:
  movhlps %xmm0, %xmm0       # xmm0 = xmm0[1,1]

Added extra test cases in combine-vec-shuffle-2.ll to verify that we correctly
fold according to the above-mentioned rule.

llvm-svn: 215555
2014-08-13 16:09:40 +00:00
Manuel Klimek f67672e41c Work around missing handling of temporaries bound to default arguments.
Yet more problems due to the missing CXXBindTemporaryExpr in the CFG for
default arguments.

Unfortunately we cannot just switch off inserting temporaries for the
corresponding default arguments, as that breaks existing tests
(test/SemaCXX/return-noreturn.cpp:245).

llvm-svn: 215554
2014-08-13 15:25:55 +00:00
Benjamin Kramer cc5366c07a In ancient times build targets had to be sorted topologically. Sometimes this behavior can still be observed today.
llvm-svn: 215553
2014-08-13 14:41:24 +00:00
Simon Atanasyan d95c67d425 [Driver] Support -muclibc / -mglibc command line options for a couple
of MIPS toolchains.

The uCLibc implemented for multiple architectures. A couple of MIPS toolchains
contains both uCLibc and glibc implementation so these options allow to select
used C library.

Initially -muclibc / -mglibc (as well as -mbionic) have been implemented in gcc
for various architectures so they are not MIPS specific.

llvm-svn: 215552
2014-08-13 14:34:14 +00:00
Joerg Sonnenberger dd13b30c29 For NetBSD, use the same settings for PPC64 as for PPC when it comes to
integrated assembler, libc++ and libgcc. Set emulation for ld for both
platforms for correct -m32 handling.

llvm-svn: 215551
2014-08-13 14:17:32 +00:00
Benjamin Kramer 5eddaac17f Fix linking in the Makefile build.
llvm-svn: 215550
2014-08-13 14:14:38 +00:00
Manuel Klimek 5f594f80f4 Fix crasher bug in clang-format.
llvm-svn: 215549
2014-08-13 14:00:41 +00:00
Benjamin Kramer 498cce575f [clang-tidy] Add a generic header guard checker + LLVM implementation.
The implementation is split into a generic part and a LLVM-specific part.
Other codebases can implement it with their own style. The specific features
supported are:

- Verification (and fixing) of header guards against a style based on the file path
- Automatic insertion of header guards for headers that are missing them
- A warning when the header guard doesn't enable our fancy header guard optimization
(e.g. when there's an include preceeding the guard)
- Automatic insertion of a comment with the guard name after #endif.

For the LLVM style we disable #endif comments for now, they're not very common
in the codebase. We also only flag headers in the include directories, there
doesn't seem to be a common style outside.

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

llvm-svn: 215548
2014-08-13 13:57:57 +00:00
Chad Rosier 0a5eb23bbd Remove unused private fields from r215544 to appease buildbots.
llvm-svn: 215547
2014-08-13 13:57:24 +00:00
Dmitry Vyukov 5f86aaa27b tsan: fix unaligned memory access routine
It was possimitically handling an aligned 8-byte access as 2 4-byte accesses.

llvm-svn: 215546
2014-08-13 13:20:23 +00:00
Benjamin Kramer 87cc652651 Try to unbreak the Makefile build.
llvm-svn: 215545
2014-08-13 13:20:04 +00:00
Chad Rosier 69e2881070 [AArch64] Initial ELF/AArch64 Support
This patch adds the initial ELF/AArch64 support to lld. Only a basic "Hello
World" app has been successfully tested for both dynamic and static compiling.

Differential Revision: http://reviews.llvm.org/D4778
Patch by Daniel Stewart <stewartd@codeaurora.org>!

llvm-svn: 215544
2014-08-13 13:16:38 +00:00
Benjamin Kramer b4e7c9b211 Also run extra tools unit tests in shared library builds.
Took me way too long to figure out why they didn't run.

llvm-svn: 215543
2014-08-13 12:54:50 +00:00
Toma Tabacu 88f05ce30e [mips] Refactor calls to setCanHaveModuleDir.
Summary:
Moved some calls to setCanHaveModuleDir to the MipsTargetStreamer base class and removed the resulting empty functions from the MipsTargetELFStreamer class.

Also fixed a missing call to setCanHaveModuleDir in MipsTargetELFStreamer::emitDirectiveSetMicroMips.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: tomatabacu

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

llvm-svn: 215542
2014-08-13 12:48:12 +00:00
Manuel Klimek c0ff99089a Default getFile() to use the last accessed name in the FileEntry.
With modules we start accessing headers for the first time while reading
the module map, which often has very different paths from the include
scanning logic.

Using the name by which the file was accessed gets us one step closer to
the right solution, which is using a FileName abstraction that decouples
the name by which a file was accessed from the FileEntry.

llvm-svn: 215541
2014-08-13 12:34:41 +00:00
Chandler Carruth 2fe75b3a73 [shuffle] Stand back! I'm about to (try to) do math!
Especially with blends and large tree heights there was a problem with
the fuzzer where it would end up with enough undef shuffle elements in
enough parts of the tree that in a birthday-attack kind of way we ended
up regularly having large numbers of undef elements in the result. I was
seeing reasonably frequent cases of *all* results being undef which
prevents us from doing any correctness checking at all. While having
undef lanes is important, this was too much.

So I've tried to apply some math to the probabilities of having an undef
lane and balance them against the tree height. Please be gentle, I'm
really terrible at math. I probably made a bunch of amateur mistakes
here. Fixes, etc. are quite welcome. =D At least in running it some, it
seems to be producing more interesting (for correctness testing)
results.

llvm-svn: 215540
2014-08-13 12:27:18 +00:00
Aaron Ballman 74c2c8f160 Asserting that the call to chdir succeeds in this test. Fixes some -Wunused-result warnings.
llvm-svn: 215539
2014-08-13 11:17:41 +00:00
Chandler Carruth 0fb998110a [optnone] Make the optnone attribute effective at suppressing function
attribute and function argument attribute synthesizing and propagating.

As with the other uses of this attribute, the goal remains a best-effort
(no guarantees) attempt to not optimize the function or assume things
about the function when optimizing. This is particularly useful for
compiler testing, bisecting miscompiles, triaging things, etc. I was
hitting specific issues using optnone to isolate test code from a test
driver for my fuzz testing, and this is one step of fixing that.

llvm-svn: 215538
2014-08-13 10:49:33 +00:00
Aaron Ballman 1013b6b60c Silence a -Wparenthesis warning with these asserts. NFC.
llvm-svn: 215537
2014-08-13 10:49:07 +00:00
Robert Khasanov ed8829703f [SKX] Extended non-temporal load/store instructions for AVX512VL subsets.
Added avx512_movnt_vl multiclass for handling 256/128-bit forms of instruction.
Added encoding and lowering tests.

Reviewed by Elena Demikhovsky <elena.demikhovsky@intel.com>

llvm-svn: 215536
2014-08-13 10:46:00 +00:00
Daniel Sanders d97a634f12 Re-commit: [mips] Implement .ent, .end, .frame, .mask and .fmask.
Patch by Matheus Almeida and Toma Tabacu

The lld test failure on the previous attempt to commit was caused by the
addition of the .pdr section causing the offsets it was checking to change.
This has been fixed by removing the .ent/.end directives from that test since
they weren't really needed.

llvm-svn: 215535
2014-08-13 10:07:34 +00:00
Daniel Sanders df153c1a7e [mips] Remove .end and .end from test/elf/Mips/hilo16-3.test
The commit of the .ent/.end implementation will change the result of the
relocation evaluations (because of a new section and additional relocations)
which will lead to a failure if the .ent/.end directives are present in this
test.
We don't really need the .ent/.end directives in this test so let's just remove
them to preserve the current output.

llvm-svn: 215534
2014-08-13 10:04:59 +00:00
Chandler Carruth 03984ec362 [shuffle] Make the seed an optional component and add support for
letting the python very directly compute a UUID.

llvm-svn: 215533
2014-08-13 10:00:46 +00:00
Chandler Carruth 3f92ecc2a0 Revert r215415 which causse MSan to crash on a great deal of C++ code.
I've followed up on the original commit as well.

llvm-svn: 215532
2014-08-13 09:19:39 +00:00
Oliver Stannard 76244be6d4 Emit diagnostic for -munaligned-access on v6m targets
Rather than silently disabling unaligned accesses for v6m targets as
in the previous patch to llvm, instead produce a warning saying that
this architecture doesn't support unaligned accesses.

Patch by Ben Foster

llvm-svn: 215531
2014-08-13 09:18:12 +00:00
Chandler Carruth 8edd497996 [shuffle] Teach the shuffle fuzzer to fuzz blends, including forming
a tree of inputs to blend iteratively together.

This required a pretty substantial rewrite of the innards. The number of
shuffle instructions is now bounded in terms of tree-height. There is
a flag to disable blends so that its still possible to test single input
shuffles. I've also improved various aspects of how the test program is
generated, primarily to simplify the test harness and allow some
optimizations to clean up how we actually check the results and build up
the inputs.

Again, apologies for my likely horrible use of Python... But hey, it
works! (Ish?)

llvm-svn: 215530
2014-08-13 09:05:59 +00:00
Daniel Jasper 839922e9d1 clang-format: Format long lists in columns if without bin-packing.
After (even with BinPacking = false):
  const Aaaaaa aaaaa = {
      aaaaa,  bbbbb,  ccccc,  ddddd,  eeeee,  ffffff, ggggg, hhhhhh,
      iiiiii, jjjjjj, kkkkkk, aaaaa,  bbbbb,  ccccc,  ddddd, eeeee,
      ffffff, ggggg,  hhhhhh, iiiiii, jjjjjj, kkkkkk,
  };

Before:
  <each element on its own line>

This fixes http://llvm.org/PR20623.

llvm-svn: 215529
2014-08-13 08:46:21 +00:00
Tobias Grosser 5b1a04426b Fix formatting
llvm-svn: 215528
2014-08-13 08:38:34 +00:00
Daniel Jasper 343643b979 clang-format: Understand #defines defining system includes.
Before:
  #define MY_IMPORT < a / b >

After:
  #define MY_IMPORT <a/b>

llvm-svn: 215527
2014-08-13 08:29:18 +00:00
Elena Demikhovsky 51bbd011c3 AVX-512: Fixed a bug in shufflevector lowering.
PALIGNR instruction does not exist in AVX-512F set.
Added a test.

llvm-svn: 215526
2014-08-13 07:58:43 +00:00
Karthik Bhat a4a4db91be InstCombine: Combine (xor (or %a, %b) (xor %a, %b)) to (add %a, %b)
Correctness proof of the transform using CVC3-

$ cat t.cvc
A, B : BITVECTOR(32);
QUERY BVXOR(A | B, BVXOR(A,B) ) = A & B;

$ cvc3 t.cvc
Valid.

llvm-svn: 215524
2014-08-13 05:13:14 +00:00