platform/upstream/llvm.git
9 years agoR600/SI: Add definitions for ds_read2st64_ / ds_write2st64_
Matt Arsenault [Tue, 5 Aug 2014 23:53:20 +0000 (23:53 +0000)]
R600/SI: Add definitions for ds_read2st64_ / ds_write2st64_

llvm-svn: 214936

9 years agoRemove trailing whitespaces
Rui Ueyama [Tue, 5 Aug 2014 23:43:21 +0000 (23:43 +0000)]
Remove trailing whitespaces

llvm-svn: 214935

9 years agoFix typos in comments and doc
JF Bastien [Tue, 5 Aug 2014 23:27:34 +0000 (23:27 +0000)]
Fix typos in comments and doc

Committing http://reviews.llvm.org/D4798 for Robin Morisset (morisset@google.com)

llvm-svn: 214934

9 years agoDebugInfo: Move the reference to the CU from the location list entry to the list...
David Blaikie [Tue, 5 Aug 2014 23:14:16 +0000 (23:14 +0000)]
DebugInfo: Move the reference to the CU from the location list entry to the list itself, since it is constant across an entire list.

This simplifies construction and usage while making the data structure
smaller. It was a holdover from the days when we didn't have a separate
DebugLocList and all we had was a flat list of DebugLocEntries.

llvm-svn: 214933

9 years agoMS ABI: Mangle empty type parameter packs compatibly
David Majnemer [Tue, 5 Aug 2014 22:43:45 +0000 (22:43 +0000)]
MS ABI: Mangle empty type parameter packs compatibly

The MS mangling scheme apparently has separate manglings for type and
non-type parameter packs when they are empty.  Match template arguments
with parameters during mangling; check the parameter to see if it was
destined to hold type-ish things or nontype-ish things.

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

llvm-svn: 214932

9 years agoFix Driver tests that I broke on Windows in r214924
Reid Kleckner [Tue, 5 Aug 2014 22:39:07 +0000 (22:39 +0000)]
Fix Driver tests that I broke on Windows in r214924

llvm-svn: 214931

9 years agoExpose the name mangling C API to Python bindings.
Eli Bendersky [Tue, 5 Aug 2014 22:27:50 +0000 (22:27 +0000)]
Expose the name mangling C API to Python bindings.

llvm-svn: 214930

9 years agoRemove a virtual function from TargetMachine. NFC.
Rafael Espindola [Tue, 5 Aug 2014 22:10:21 +0000 (22:10 +0000)]
Remove a virtual function from TargetMachine. NFC.

llvm-svn: 214929

9 years agoRe-apply r214881: Fix return sequence on armv4 thumb
Jonathan Roelofs [Tue, 5 Aug 2014 21:32:21 +0000 (21:32 +0000)]
Re-apply r214881: Fix return sequence on armv4 thumb

This reverts r214893, re-applying r214881 with the test case relaxed a bit to
satiate the build bots.

POP on armv4t cannot be used to change thumb state (unilke later non-m-class
architectures), therefore we need a different return sequence that uses 'bx'
instead:

  POP {r3}
  ADD sp, #offset
  BX r3

This patch also fixes an issue where the return value in r3 would get clobbered
for functions that return 128 bits of data. In that case, we generate this
sequence instead:

  MOV ip, r3
  POP {r3}
  ADD sp, #offset
  MOV lr, r3
  MOV r3, ip
  BX lr

http://reviews.llvm.org/D4748

llvm-svn: 214928

9 years ago[MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify
Lang Hames [Tue, 5 Aug 2014 20:51:46 +0000 (20:51 +0000)]
[MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify
mode.

This will cause -verify mode to report failure when RuntimeDyld encounters an
internal error (e.g. overflows in relocation computations). Previously we had
let these errors slip past unreported.

llvm-svn: 214925

9 years agoMake crash diagnostics on Windows the tiniest bit more useful
Reid Kleckner [Tue, 5 Aug 2014 20:49:12 +0000 (20:49 +0000)]
Make crash diagnostics on Windows the tiniest bit more useful

This escapes any backslashes in the executable path and fixes an issue
with a trailing quote when the main file name had to be quoted during
printing.

It's impossible to test this without putting backslashes or quotes into
the executable path, so I didn't add automated tests.

The crash diagnostics are still only useful if you're using bash on
Windows, though.  This should probably be writing a batch file instead.

llvm-svn: 214924

9 years ago[PowerPC] Swap arguments and adjust shift count for vsldoi on little endian
Bill Schmidt [Tue, 5 Aug 2014 20:47:25 +0000 (20:47 +0000)]
[PowerPC] Swap arguments and adjust shift count for vsldoi on little endian

Commits r213915 and r214718 fix recognition of shuffle masks for vmrg*
and vpku*um instructions for a little-endian target, by swapping the
input arguments.  The vsldoi instruction requires similar treatment,
and also needs its shift count adjusted for little endian.

Reviewed by Ulrich Weigand.

This is a bug fix candidate for release 3.5 (and hopefully the last of
those for PowerPC).

llvm-svn: 214923

9 years agoForce trace on system() failure on FreeBSD while tracking down buildbot issues
Ed Maste [Tue, 5 Aug 2014 20:33:17 +0000 (20:33 +0000)]
Force trace on system() failure on FreeBSD while tracking down buildbot issues

llvm-svn: 214922

9 years agoImproved test cases that were added with r214892.
Sanjay Patel [Tue, 5 Aug 2014 20:16:35 +0000 (20:16 +0000)]
Improved test cases that were added with r214892.

1. Added ':' to CHECK-LABELs
2. Added more CHECKs
3. Added CHECK-NEXTs
4. Added verbose hex immediate comments to CHECKs

llvm-svn: 214921

9 years agoDon't internalize all but main by default.
Rafael Espindola [Tue, 5 Aug 2014 20:10:38 +0000 (20:10 +0000)]
Don't internalize all but main by default.

This is mostly a cleanup, but it changes a fairly old behavior.

Every "real" LTO user was already disabling the silly internalize pass
and creating the internalize pass itself. The difference with this
patch is for "opt -std-link-opts" and the C api.

Now to get a usable behavior out of opt one doesn't need the funny
looking command line:

opt -internalize -disable-internalize -internalize-public-api-list=foo,bar -std-link-opts

llvm-svn: 214919

9 years agoAdd a test showing the interaction of linker scripts and plugin.
Rafael Espindola [Tue, 5 Aug 2014 19:56:53 +0000 (19:56 +0000)]
Add a test showing the interaction of linker scripts and plugin.

In particular, the linker script is processed early enough for function g
to be internalized.

llvm-svn: 214916

9 years ago[x86] Fix a crasher due to shuffles which cancel each other out and add
Chandler Carruth [Tue, 5 Aug 2014 18:45:49 +0000 (18:45 +0000)]
[x86] Fix a crasher due to shuffles which cancel each other out and add
a test case.

We also miscompile this test case which is showing a serious flaw in the
single-input v8i16 shuffle code. I've left the specific instruction
checks FIXME-ed out until I can address the bug in the single-input
code, but I wanted to separate out a significant functionality change to
produce correct code from a very simple and targeted crasher fix.

The miscompile problem stems from keeping track of inputs by value
rather than by index. As a consequence of doing this, we can't reliably
update those inputs because they might swap and we can't detect this
without copying the mask.

The blend code now uses indices for the input lists and this seems
strictly better. It also should make it easier to sort things and do
other cleanups. I think the time has come to simplify The Great Lambda
here.

llvm-svn: 214914

9 years agotsan: allocate vector clocks using slab allocator
Dmitry Vyukov [Tue, 5 Aug 2014 18:45:02 +0000 (18:45 +0000)]
tsan: allocate vector clocks using slab allocator

Vector clocks is the most actively allocated object in tsan runtime.
Current internal allocator is not scalable enough to handle allocation
of clocks in scalable way (too small caches). This changes transforms
clocks to 2-level array with 512-byte blocks. Since all blocks are of
the same size, it's possible to cache them more efficiently in per-thread caches.

llvm-svn: 214912

9 years agoIntroduce f[no-]max-unknown-pointer-align=[number] option
Fariborz Jahanian [Tue, 5 Aug 2014 18:37:48 +0000 (18:37 +0000)]
Introduce f[no-]max-unknown-pointer-align=[number] option
to instruct the code generator to not enforce a higher alignment
than the given number (of bytes) when accessing memory via an opaque
pointer or reference. Patch reviewed by John McCall (with post-commit
review pending). rdar://16254558

llvm-svn: 214911

9 years ago[Analyzer] fix for PR19102
Anton Yartsev [Tue, 5 Aug 2014 18:26:05 +0000 (18:26 +0000)]
[Analyzer] fix for PR19102

Newly-created unconsumed instance is now assumed escaped if an invoked constructor has an argument of a pointer-to-record type.

llvm-svn: 214909

9 years agoRemove dead code in condition
Duncan P. N. Exon Smith [Tue, 5 Aug 2014 18:22:58 +0000 (18:22 +0000)]
Remove dead code in condition

Whether or not it's appropriate, labels have been first-class types
since r51511.

llvm-svn: 214908

9 years agoAdded f and m flags to be ignored. These will not display a warning. The revision
Arthur Marble [Tue, 5 Aug 2014 18:21:20 +0000 (18:21 +0000)]
Added f and m flags to be ignored. These will not display a warning. The revision
for this patch is here: http://reviews.llvm.org/D4570. This will help with the
rebuild of Debian with clang. Here is a link to the errors that Debian is
experiencing: http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG

llvm-svn: 214907

9 years agoAdded flags that should be ignored for compatibility. These flags will display
Arthur Marble [Tue, 5 Aug 2014 18:13:48 +0000 (18:13 +0000)]
Added flags that should be ignored for compatibility. These flags will display
a warning. Revision for this patch is here: http://reviews.llvm.org/D4565. This
patch will help with the rebuild of Debian with clang and many other projects
that wish to use clang. Here is a link to the errors that Debian is experiencing:
http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG

llvm-svn: 214906

9 years agoX86CodeEmitter.cpp: Add SEH_Epilogue to ignored list for legacy JIT, corresponding...
NAKAMURA Takumi [Tue, 5 Aug 2014 18:04:15 +0000 (18:04 +0000)]
X86CodeEmitter.cpp: Add SEH_Epilogue to ignored list for legacy JIT, corresponding to r214775.

llvm-svn: 214905

9 years ago[PR19983] SBPO_Always not covering all the cases.
Chad Rosier [Tue, 5 Aug 2014 17:58:54 +0000 (17:58 +0000)]
[PR19983] SBPO_Always not covering all the cases.
Patch by "Roman Kashitsyn" <romankashicin@gmail.com>.
Phabricator revision: http://reviews.llvm.org/D4788

llvm-svn: 214904

9 years ago[X86] Improve comments for r214888
Adam Nemet [Tue, 5 Aug 2014 17:58:49 +0000 (17:58 +0000)]
[X86] Improve comments for r214888

A rebase somehow ate my comments. This restores them.

llvm-svn: 214903

9 years agoR600/SI: Use register class instead of list of registers
Matt Arsenault [Tue, 5 Aug 2014 17:52:40 +0000 (17:52 +0000)]
R600/SI: Use register class instead of list of registers

I'm not sure if this has any consequence or not.

llvm-svn: 214902

9 years agoR600/SI: Add exec_lo and exec_hi subregisters.
Matt Arsenault [Tue, 5 Aug 2014 17:52:37 +0000 (17:52 +0000)]
R600/SI: Add exec_lo and exec_hi subregisters.

This allows accessing an SReg subregister with a normal subregister
index, instead of getting a machine verifier error.

Also be sure to include all of these subregisters in SReg_32.
This fixes inferring SGPR instead of SReg when finding a
super register class.

llvm-svn: 214901

9 years agoOn FreeBSD skip test that produces bogus output
Ed Maste [Tue, 5 Aug 2014 17:50:04 +0000 (17:50 +0000)]
On FreeBSD skip test that produces bogus output

The test produces lines that start with "<word>: " which confuses the
buildbot log parser.  Disable the test until either the test is fixed
or the buildbot can deal with the undesired output.

llvm.org/pr20545

llvm-svn: 214900

9 years agoBitcodeReader: Fix non-determinism in use-list order
Duncan P. N. Exon Smith [Tue, 5 Aug 2014 17:49:48 +0000 (17:49 +0000)]
BitcodeReader: Fix non-determinism in use-list order

`BasicBlockFwdRefs` (and `BlockAddrFwdRefs` before it) was being emptied
in a non-deterministic order.  When predicting use-list order I've
worked around this another way, but even when parsing lazily (and we
can't recreate use-list order) use-lists should be deterministic.

Make them so by using a side-queue of functions with forward-referenced
blocks that gets visited in order.

llvm-svn: 214899

9 years agoRemove dead zero store to calloc initialized memory
Philip Reames [Tue, 5 Aug 2014 17:48:20 +0000 (17:48 +0000)]
Remove dead zero store to calloc initialized memory

Optimize the following IR:

%1 = tail call noalias i8* @calloc(i64 1, i64 4)
%2 = bitcast i8* %1 to i32*
; This store is dead and should be removed
store i32 0, i32* %2, align 4

Memory returned by calloc is guaranteed to be zero initialized. If the value being stored is the constant zero (and the store is not otherwise observable across threads), we can delete the store.  If the store is to an out of bounds address, it is undefined and thus also removable.

Reviewed By: nicholas

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

llvm-svn: 214897

9 years agoRevert r214881 because it broke lots of build-bots
Jonathan Roelofs [Tue, 5 Aug 2014 17:36:05 +0000 (17:36 +0000)]
Revert r214881 because it broke lots of build-bots

llvm-svn: 214893

9 years agoOptimize vector fabs of bitcasted constant integer values.
Sanjay Patel [Tue, 5 Aug 2014 17:35:22 +0000 (17:35 +0000)]
Optimize vector fabs of bitcasted constant integer values.

Allow vector fabs operations on bitcasted constant integer values to be optimized
in the same way that we already optimize scalar fabs.

So for code like this:
%bitcast = bitcast i64 18446744069414584320 to <2 x float> ; 0xFFFF_FFFF_0000_0000
%fabs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %bitcast)
%ret = bitcast <2 x float> %fabs to i64

Instead of generating something like this:

movabsq (constant pool loadi of mask for sign bits)
vmovq   (move from integer register to vector/fp register)
vandps  (mask off sign bits)
vmovq   (move vector/fp register back to integer return register)

We should generate:

mov     (put constant value in return register)

I have also removed a redundant clause in the first 'if' statement:
N0.getOperand(0).getValueType().isInteger()

is the same thing as:
IntVT.isInteger()

Testcases for x86 and ARM added to existing files that deal with vector fabs.
One existing testcase for x86 removed because it is no longer ideal.

For more background, please see:
http://reviews.llvm.org/D4770

And:
http://llvm.org/bugs/show_bug.cgi?id=20354

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

llvm-svn: 214892

9 years ago[AVX512] Add intrinsic for valignd/q
Adam Nemet [Tue, 5 Aug 2014 17:28:23 +0000 (17:28 +0000)]
[AVX512] Add intrinsic for valignd/q

Note that similar to palingr, we could further optimize these to emit
shufflevector when the shift count is <=64.  This however does not
change the overall design that unlike palignr we would still need the LLVM
intrinsic corresponding to this intruction to handle the >64 cases.  (palignr
uses the psrldq intrinsic in this case.)

llvm-svn: 214891

9 years ago[AVX512] Add masking variant and intrinsics for valignd/q
Adam Nemet [Tue, 5 Aug 2014 17:23:04 +0000 (17:23 +0000)]
[AVX512] Add masking variant and intrinsics for valignd/q

This is similar to what I did with the two-source permutation recently.  (It's
almost too similar so that we should consider generating the masking variants
with some tablegen help.)

Both encoding and intrinsic tests are added as well.  For the latter, this is
what the IR that the intrinsic test on the clang side generates.

Part of <rdar://problem/17688758>

llvm-svn: 214890

9 years ago[X86] Increase X86_MAX_OPERANDS from 5 to 6
Adam Nemet [Tue, 5 Aug 2014 17:23:01 +0000 (17:23 +0000)]
[X86] Increase X86_MAX_OPERANDS from 5 to 6

This controls the number of operands in the disassembler's x86OperandSets
table.  The entries describe how the operand is encoded and its type.

Not to surprisingly 5 operands is insufficient for AVX512.  Consider
VALIGNDrrik in the next patch.  These are its operand specifiers:

  { /* 328 */
    { ENCODING_DUP, TYPE_DUP1 },
    { ENCODING_REG, TYPE_XMM512 },
    { ENCODING_WRITEMASK, TYPE_VK8 },
    { ENCODING_VVVV, TYPE_XMM512 },
    { ENCODING_RM_CD64, TYPE_XMM512 },
    { ENCODING_IB, TYPE_IMM8 },
  },

llvm-svn: 214889

9 years ago[X86] Add lowering to VALIGN
Adam Nemet [Tue, 5 Aug 2014 17:22:59 +0000 (17:22 +0000)]
[X86] Add lowering to VALIGN

This was currently part of lowering to PALIGNR with some special-casing to
make interlane shifting work.  Since AVX512F has interlane alignr (valignd/q)
and AVX512BW has vpalignr we need to support both of these *at the same time*,
e.g. for SKX.

This patch breaks out the common code and then add support to check both of
these lowering options from LowerVECTOR_SHUFFLE.

I also added some FIXMEs where I think the AVX512BW and AVX512VL additions
should probably go.

llvm-svn: 214888

9 years ago[X86] Separate DAG node for valign and palignr
Adam Nemet [Tue, 5 Aug 2014 17:22:55 +0000 (17:22 +0000)]
[X86] Separate DAG node for valign and palignr

They have different semantics (valign is interlane while palingr is intralane)
and palingr is still needed even in the AVX512 context.  According to the
latest spec AVX512BW provides these.

llvm-svn: 214887

9 years ago[AVX512] alignr: Use suffix rather than name argument to multiclass
Adam Nemet [Tue, 5 Aug 2014 17:22:52 +0000 (17:22 +0000)]
[AVX512] alignr: Use suffix rather than name argument to multiclass

Again no functional change.  This prepares for the suffix to be used with the
intrinsic matching.

llvm-svn: 214886

9 years ago[AVX512] Pull everything alignr-related into the multiclass
Adam Nemet [Tue, 5 Aug 2014 17:22:50 +0000 (17:22 +0000)]
[AVX512] Pull everything alignr-related into the multiclass

The packed integer pattern becomes the DAG pattern for rri and the packed
float, another Pat<> inside the multiclass.

No functional change.

llvm-svn: 214885

9 years agoWrap long lines
Adam Nemet [Tue, 5 Aug 2014 17:22:47 +0000 (17:22 +0000)]
Wrap long lines

llvm-svn: 214884

9 years agoReleaseNotes: try to fix links
Hans Wennborg [Tue, 5 Aug 2014 17:19:14 +0000 (17:19 +0000)]
ReleaseNotes: try to fix links

llvm-svn: 214883

9 years agoReleaseNotes: mention basic debug info and ASan support in the Windows blurb
Hans Wennborg [Tue, 5 Aug 2014 17:15:00 +0000 (17:15 +0000)]
ReleaseNotes: mention basic debug info and ASan support in the Windows blurb

llvm-svn: 214882

9 years agoFix return sequence on armv4 thumb
Jonathan Roelofs [Tue, 5 Aug 2014 17:13:17 +0000 (17:13 +0000)]
Fix return sequence on armv4 thumb

POP on armv4t cannot be used to change thumb state (unilke later non-m-class
architectures), therefore we need a different return sequence that uses 'bx'
instead:

  POP {r3}
  ADD sp, #offset
  BX r3

This patch also fixes an issue where the return value in r3 would get clobbered
for functions that return 128 bits of data. In that case, we generate this
sequence instead:

  MOV ip, r3
  POP {r3}
  ADD sp, #offset
  MOV lr, r3
  MOV r3, ip
  BX lr

http://reviews.llvm.org/D4748

llvm-svn: 214881

9 years agoPartially revert r214761 that asserted that all concrete debug info variables had...
David Blaikie [Tue, 5 Aug 2014 16:47:23 +0000 (16:47 +0000)]
Partially revert r214761 that asserted that all concrete debug info variables had DIEs, due to a failure on Darwin.

I'll work on a reduction and fix after this.

llvm-svn: 214880

9 years agoImprove test for merged global debug info by using llvm-dwarfdump.
David Blaikie [Tue, 5 Aug 2014 16:20:25 +0000 (16:20 +0000)]
Improve test for merged global debug info by using llvm-dwarfdump.

It's a bit of a tradeoff, since llvm-dwarfdump doesn't print the name of
the global symbol being used as an address in the addressing mode, but
this avoids the dependence on hardcoded set labels that keep changing
(5+ commits over the last few years that each update the set label as it
changes due to other, unrelated differences in output). This could've,
instead, been changed to match the set name then match the name in the
string pool but that would present other issues (needing to skip over
the sets that weren't of interest, etc) and checking that the addresses
(granted, without relocations applied - so it's not the whole story)
match in the two variable location descriptions seems sufficient and
fairly stable here.

There are a few similar other tests with similar label dependence that
I'll update soonish.

llvm-svn: 214878

9 years agoUpdate CREDITS.txt with the list of folks who worked on ARM EHABI support
Jonathan Roelofs [Tue, 5 Aug 2014 15:56:07 +0000 (15:56 +0000)]
Update CREDITS.txt with the list of folks who worked on ARM EHABI support

llvm-svn: 214877

9 years agoASTMatchersTests/matchesConditionallyWithCuda: Add -fno-ms-extensions, and get rid...
NAKAMURA Takumi [Tue, 5 Aug 2014 15:54:43 +0000 (15:54 +0000)]
ASTMatchersTests/matchesConditionallyWithCuda: Add -fno-ms-extensions, and get rid of initializer list.

I am not sure whether -xcuda might imply -fno-ms-extensions.

llvm-svn: 214876

9 years agoAdd accessors for the PPC 403 bank registers.
Joerg Sonnenberger [Tue, 5 Aug 2014 15:45:15 +0000 (15:45 +0000)]
Add accessors for the PPC 403 bank registers.

llvm-svn: 214875

9 years ago[clang-tidy] Simplify ast matcher.
Benjamin Kramer [Tue, 5 Aug 2014 15:33:46 +0000 (15:33 +0000)]
[clang-tidy] Simplify ast matcher.

Turns out there is a better way to do this. No functionality change.

llvm-svn: 214874

9 years agoFix a copy-pasta in r214573
Jonathan Roelofs [Tue, 5 Aug 2014 15:31:16 +0000 (15:31 +0000)]
Fix a copy-pasta in r214573

llvm-svn: 214873

9 years agoAdd tests for cp10/cp11 on ARMv5/6
Renato Golin [Tue, 5 Aug 2014 15:29:41 +0000 (15:29 +0000)]
Add tests for cp10/cp11 on ARMv5/6

Tests for ARMv7/8 are already on diagnostics.s

llvm-svn: 214872

9 years agoSpecify that the thumb setend and blx <immed> instructions are not valid on an m...
Keith Walker [Tue, 5 Aug 2014 15:11:59 +0000 (15:11 +0000)]
Specify that the thumb setend and blx <immed> instructions are not valid on an m-class target

llvm-svn: 214871

9 years agoASTMatchers.h: Fix an annotation. [-Wdocumentation-html]
NAKAMURA Takumi [Tue, 5 Aug 2014 15:01:31 +0000 (15:01 +0000)]
ASTMatchers.h: Fix an annotation. [-Wdocumentation-html]

Angle brackets, aka &lt; &gt;, should be escaped.

llvm-svn: 214870

9 years ago[CMake] clangCodeGen: Update libdeps to add clangLex for PPChainedCallbacks.
NAKAMURA Takumi [Tue, 5 Aug 2014 15:01:12 +0000 (15:01 +0000)]
[CMake] clangCodeGen: Update libdeps to add clangLex for PPChainedCallbacks.

llvm-svn: 214869

9 years agoDefine stc2/stc2l/ldc2/ldc2l as thumb2 instructions
Keith Walker [Tue, 5 Aug 2014 14:58:05 +0000 (14:58 +0000)]
Define stc2/stc2l/ldc2/ldc2l as thumb2 instructions

llvm-svn: 214868

9 years agoAccessors for SSR2 and SSR3 on PPC 403.
Joerg Sonnenberger [Tue, 5 Aug 2014 14:53:05 +0000 (14:53 +0000)]
Accessors for SSR2 and SSR3 on PPC 403.

llvm-svn: 214867

9 years agoR600/SI: Update MUBUF assembly string to match AMD proprietary compiler
Tom Stellard [Tue, 5 Aug 2014 14:48:12 +0000 (14:48 +0000)]
R600/SI: Update MUBUF assembly string to match AMD proprietary compiler

llvm-svn: 214866

9 years agoR600/SI: Avoid generating REGISTER_LOAD instructions.
Tom Stellard [Tue, 5 Aug 2014 14:40:52 +0000 (14:40 +0000)]
R600/SI: Avoid generating REGISTER_LOAD instructions.

SI doesn't use REGISTER_LOAD anymore, but it was still hitting this code
path for 8-bit and 16-bit private loads.

llvm-svn: 214865

9 years agoAdd dci/ici instructions for PPC 476 and friends.
Joerg Sonnenberger [Tue, 5 Aug 2014 14:40:32 +0000 (14:40 +0000)]
Add dci/ici instructions for PPC 476 and friends.

llvm-svn: 214864

9 years agoAdd mftblo and mftbhi for PPC 4xx.
Joerg Sonnenberger [Tue, 5 Aug 2014 14:18:16 +0000 (14:18 +0000)]
Add mftblo and mftbhi for PPC 4xx.

llvm-svn: 214863

9 years agoAdd lswi / stswi for assembler use with a warning to not add patterns
Joerg Sonnenberger [Tue, 5 Aug 2014 13:34:01 +0000 (13:34 +0000)]
Add lswi / stswi for assembler use with a warning to not add patterns
for them.

llvm-svn: 214862

9 years ago[ASan/Win] Handle SEH exceptions even with -GS
Timur Iskhodzhanov [Tue, 5 Aug 2014 13:26:26 +0000 (13:26 +0000)]
[ASan/Win] Handle SEH exceptions even with -GS

This is a follow-up to r213654, r213656, r213667 and r213668.

llvm-svn: 214861

9 years agoAArch64: Add support for instruction prefetch intrinsic
Yi Kong [Tue, 5 Aug 2014 12:46:47 +0000 (12:46 +0000)]
AArch64: Add support for instruction prefetch intrinsic

Instruction prefetch is not implemented for AArch64, it is incorrectly
translated into data prefetch instruction.

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

llvm-svn: 214860

9 years agoTeach the SLP Vectorizer that keeping some values live over a callsite can have a...
James Molloy [Tue, 5 Aug 2014 12:30:34 +0000 (12:30 +0000)]
Teach the SLP Vectorizer that keeping some values live over a callsite can have a cost.

Some types, such as 128-bit vector types on AArch64, don't have any callee-saved registers. So if a value needs to stay live over a callsite, it must be spilled and refilled. This cost is now taken into account.

llvm-svn: 214859

9 years agoclang-format: Add option to always break after a function's return type.
Daniel Jasper [Tue, 5 Aug 2014 12:16:31 +0000 (12:16 +0000)]
clang-format: Add option to always break after a function's return type.

This is required for GNU coding style, among others.

Also update the configuration documentation.

Modified from an original patch by Jarkko Hietaniemi, thank you!

llvm-svn: 214858

9 years agoclang-format: Break before 'else' in Stroustrup style.
Daniel Jasper [Tue, 5 Aug 2014 12:06:20 +0000 (12:06 +0000)]
clang-format: Break before 'else' in Stroustrup style.

Seems to be the desired thing to do according to:
  http://www.stroustrup.com/Programming/PPP-style-rev3.pdf

Patch by Jarkko Hietaniemi, thank you!

llvm-svn: 214857

9 years agoUpdating the documentation comment to list another parameter. No functional changes.
Aaron Ballman [Tue, 5 Aug 2014 11:48:21 +0000 (11:48 +0000)]
Updating the documentation comment to list another parameter. No functional changes.

llvm-svn: 214856

9 years agoThe test doesn't export ASAN_OPTIONS, so $ASAN_OPTIONS should not be used in RUN...
Alexander Kornienko [Tue, 5 Aug 2014 11:12:23 +0000 (11:12 +0000)]
The test doesn't export ASAN_OPTIONS, so $ASAN_OPTIONS should not be used in RUN lines.

llvm-svn: 214855

9 years agoMachO: set sizeof result type to what embedded headers expect.
Tim Northover [Tue, 5 Aug 2014 11:07:26 +0000 (11:07 +0000)]
MachO: set sizeof result type to what embedded headers expect.

Embedded systems seem to have inherited Darwin's choise of "unsigned long" for
size_t (via a bunch of headers), so we should respect that.

rdar://problem/17872787

llvm-svn: 214854

9 years ago[x86] Reformat some code I moved around in a prior commit but left
Chandler Carruth [Tue, 5 Aug 2014 10:35:30 +0000 (10:35 +0000)]
[x86] Reformat some code I moved around in a prior commit but left
poorly formatted. Sorry about that.

llvm-svn: 214853

9 years agoAdds AST matchers for matching CUDA declarations.
Manuel Klimek [Tue, 5 Aug 2014 09:45:53 +0000 (09:45 +0000)]
Adds AST matchers for matching CUDA declarations.

Patch by Jacques Pienaar.

llvm-svn: 214852

9 years agoAllow binary and for tblgen math.
Joerg Sonnenberger [Tue, 5 Aug 2014 09:43:25 +0000 (09:43 +0000)]
Allow binary and for tblgen math.

llvm-svn: 214851

9 years agoAfter three iterations of community review, we believe that this new
Jim Cownie [Tue, 5 Aug 2014 09:32:28 +0000 (09:32 +0000)]
After three iterations of community review, we believe that this new
CMAKE buld system should meet everyone's requirements.

Enhanced CMake Build System Commit

* Supports Linux, Mac, Windows, and IntelĀ® Xeon Phi builds
* Supports building with gcc, icc, clang, and Visual Studio compilers
* Supports bulding "fat" libraries on OS/X with clang
* Details and documentation on how to use build system
  are in Build_With_CMake.txt
* To use the old CMake build system (corresponds to
  CMakeLists.txt.old), just rename CMakeLists.txt to
  CMakeLists.txt.other and rename CMakeLists.txt.old to
  CMakeLists.txt

llvm-svn: 214850

9 years ago[x86] Fix a crash and wrong-code bug in the new vector lowering all
Chandler Carruth [Tue, 5 Aug 2014 08:19:21 +0000 (08:19 +0000)]
[x86] Fix a crash and wrong-code bug in the new vector lowering all
found by a single test reduced out of a failure on llvm-stress.

The start of the problem (and the crash) came when we tried to use
a find of a non-used slot in the move-to half of the move-mask as the
target for two bad-half inputs. While if lucky this will be the first of
a pair of slots which we can place the bad-half inputs into, it isn't
actually guaranteed. This really isn't surprising, not sure what I was
thinking. The correct way to find the two unused slots is to look for
one of the *used* slots. We know it isn't that pair, and we can use some
modular arithmetic to find the other pair by masking off the odd bit and
adding 2 modulo 4. With this, we reliably found a viable pair of slots
for the bad-half inputs.

Sadly, that wasn't enough. We also had a wrong code bug that surfaced
when I reduced the test case for this where we would use the same slot
twice for the two bad inputs. This is because both of the bad inputs
could be in odd slots originally and thus the mod-2 mapping would
actually be the same. The whole point of the weird indexing into the
pair of empty slots was to try to leverage when the end result needed
the two bad-half inputs to be paired in a dword and pre-pair them in the
correct orrientation. This is less important with the powerful combining
we're now doing, and also easier and more reliable to achieve be noting
that we add the bad-half inputs in order. Thus, if they are in a dword
pair, the low part of that will be the first input in the sequence.
Always putting that in the low element will just do the right thing in
addition to computing the correct result.

Test case added. =]

llvm-svn: 214849

9 years ago[FastIsel][AArch64] Fix previous commit r214844 (Don't perform sign-/zero-extension...
Juergen Ributzka [Tue, 5 Aug 2014 07:31:30 +0000 (07:31 +0000)]
[FastIsel][AArch64] Fix previous commit r214844 (Don't perform sign-/zero-extension for function arguments that have already been sign-/zero-extended.)

The original code would fail for unsupported value types like i1, i8, and i16.
This fix changes the code to only create a sub-register copy for i64 value types
and all other types (i1/i8/i16/i32) just use the source register without any
modifications.

getRegClassFor() is now guarded by the i64 value type check, that guarantees
that we always request a register for a valid value type.

llvm-svn: 214848

9 years agoMS ABI: Make the alias template mangling more correct
David Majnemer [Tue, 5 Aug 2014 06:42:40 +0000 (06:42 +0000)]
MS ABI: Make the alias template mangling more correct

llvm-svn: 214847

9 years ago[FastISel][AArch64] Implement the FastLowerArguments hook.
Juergen Ributzka [Tue, 5 Aug 2014 05:43:48 +0000 (05:43 +0000)]
[FastISel][AArch64] Implement the FastLowerArguments hook.

This implements basic argument lowering for AArch64 in FastISel. It only
handles a small subset of the C calling convention. It supports simple
arguments that can be passed in GPR and FPR registers.

This should cover most of the trivial cases without falling back to
SelectionDAG.

This fixes <rdar://problem/17890986>.

llvm-svn: 214846

9 years agoRevert "r214832 - MachineCombiner Pass for selecting faster instruction"
Kevin Qin [Tue, 5 Aug 2014 05:43:47 +0000 (05:43 +0000)]
Revert "r214832 - MachineCombiner Pass for selecting faster instruction"

It broke compiling of most Benchmark and internal test, as clang got
clashed by segmentation fault or assertion.

llvm-svn: 214845

9 years ago[FastISel][AArch64] Don't perform sign-/zero-extension for function arguments that...
Juergen Ributzka [Tue, 5 Aug 2014 05:43:44 +0000 (05:43 +0000)]
[FastISel][AArch64] Don't perform sign-/zero-extension for function arguments that have already been sign-/zero-extended.

llvm-svn: 214844

9 years agoProvide convenient access to the zext/sext attributes of function arguments. NFC.
Juergen Ributzka [Tue, 5 Aug 2014 05:43:41 +0000 (05:43 +0000)]
Provide convenient access to the zext/sext attributes of function arguments. NFC.

llvm-svn: 214843

9 years agoHave MachineFunction cache a pointer to the subtarget to make lookups
Eric Christopher [Tue, 5 Aug 2014 02:39:49 +0000 (02:39 +0000)]
Have MachineFunction cache a pointer to the subtarget to make lookups
shorter/easier and have the DAG use that to do the same lookup. This
can be used in the future for TargetMachine based caching lookups from
the MachineFunction easily.

Update the MIPS subtarget switching machinery to update this pointer
at the same time it runs.

llvm-svn: 214838

9 years agoIf you found a step through plan stop looking up the stack for a step out plan.
Jim Ingham [Tue, 5 Aug 2014 01:59:20 +0000 (01:59 +0000)]
If you found a step through plan stop looking up the stack for a step out plan.

llvm-svn: 214837

9 years agoAdd some useful logging to the step log.
Jim Ingham [Tue, 5 Aug 2014 01:58:14 +0000 (01:58 +0000)]
Add some useful logging to the step log.

llvm-svn: 214836

9 years ago[PECOFF] addDeadStripRoot is not thread-safe.
Rui Ueyama [Tue, 5 Aug 2014 01:44:43 +0000 (01:44 +0000)]
[PECOFF] addDeadStripRoot is not thread-safe.

llvm-svn: 214835

9 years agodit pointed out on IRC that '__i = _VSTD::next(__i)' was a very long-winded way of...
Marshall Clow [Tue, 5 Aug 2014 01:34:12 +0000 (01:34 +0000)]
dit pointed out on IRC that '__i = _VSTD::next(__i)' was a very long-winded way of writing '++__i'. Since I hate being thought of as long-winded (this checkin comment notwithstanding), I fixed it. No functionality change.

llvm-svn: 214834

9 years ago[UBSan] Allow to suppress reports from vptr checker for specified types.
Alexey Samsonov [Tue, 5 Aug 2014 01:24:22 +0000 (01:24 +0000)]
[UBSan] Allow to suppress reports from vptr checker for specified types.

Based on http://reviews.llvm.org/D4702 by Byoungyoung Lee!

llvm-svn: 214833

9 years agoMachineCombiner Pass for selecting faster instruction
Gerolf Hoflehner [Tue, 5 Aug 2014 01:16:13 +0000 (01:16 +0000)]
MachineCombiner Pass for selecting faster instruction
 sequence on AArch64

Re-commit of r214669 without changes to test cases
LLVM::CodeGen/AArch64/arm64-neon-mul-div.ll and
LLVM:: CodeGen/AArch64/dp-3source.ll
This resolves the reported compfails of the original commit.

llvm-svn: 214832

9 years ago[Sanitizer] Turn SuppressionContext::Init() into InitIfNecessary().
Alexey Samsonov [Tue, 5 Aug 2014 00:43:23 +0000 (00:43 +0000)]
[Sanitizer] Turn SuppressionContext::Init() into InitIfNecessary().

Suppression context might be used in multiple sanitizers working
simultaneously (e.g. LSan and UBSan) and not knowing about each other.

llvm-svn: 214831

9 years agoReleaseNotes: add blurb about Windows support
Hans Wennborg [Tue, 5 Aug 2014 00:21:23 +0000 (00:21 +0000)]
ReleaseNotes: add blurb about Windows support

llvm-svn: 214830

9 years agoCodeGenObjCXX: Add a test for r214699
David Majnemer [Tue, 5 Aug 2014 00:01:15 +0000 (00:01 +0000)]
CodeGenObjCXX: Add a test for r214699

I forgot to add this with the changes for r214699.

llvm-svn: 214829

9 years agoMS ABI: Aligned tentative definitions don't have CommonLinkage
David Majnemer [Tue, 5 Aug 2014 00:01:13 +0000 (00:01 +0000)]
MS ABI: Aligned tentative definitions don't have CommonLinkage

int __declspec(align(16)) foo; is a tentative definition but the storage
for that variable should not have CommonLinkage.

llvm-svn: 214828

9 years agoAdd TCR register access
Joerg Sonnenberger [Mon, 4 Aug 2014 23:53:42 +0000 (23:53 +0000)]
Add TCR register access

llvm-svn: 214826

9 years agoAdd PPC 603's tlbld and tlbli instructions.
Joerg Sonnenberger [Mon, 4 Aug 2014 23:49:45 +0000 (23:49 +0000)]
Add PPC 603's tlbld and tlbli instructions.

llvm-svn: 214825

9 years ago[PECOFF] Fix /include option in .drectve section.
Rui Ueyama [Mon, 4 Aug 2014 23:48:57 +0000 (23:48 +0000)]
[PECOFF] Fix /include option in .drectve section.

/INCLUDE arguments passed as command line options are handled in the
same way as Unix -u. All option values are converted to an undefined
symbol and added to a dummy input file, so that the specified symbols
are resolved.

One tricky thing on Windows is that the option is also allowed to
appear in the object file's directive section. At the time when
it's being read, all (regular) command line options have already
been processed. We cannot add undefined atoms to the dummy file
anymore.

Previously, we added such /INCLUDE to a set that has already been
processed. As a result the options were ignored.

This patch fixes the issue. Now, /INCLUDE symbols in the directive
section are handled as real undefined symbol in the COFF file.
We create an undefined symbol for each /INCLUDE argument and add
it to the file being parsed.

llvm-svn: 214824

9 years agoTeach ProcessWindows plugin to support stdio i/o redirection.
Zachary Turner [Mon, 4 Aug 2014 23:31:21 +0000 (23:31 +0000)]
Teach ProcessWindows plugin to support stdio i/o redirection.

llvm-svn: 214816

9 years agoAllow CP10/CP11 operations on ARMv5/v6
Renato Golin [Mon, 4 Aug 2014 23:21:56 +0000 (23:21 +0000)]
Allow CP10/CP11 operations on ARMv5/v6

Those registers are VFP/NEON and vector instructions should be used instead,
but old cores rely on those co-processors to enable VFP unwinding. This change
was prompted by the libc++abi's unwinding routine and is also present in many
legacy low-level bare-metal code that we ought to compile/assemble.

Fixing bug PR20025 and allowing PR20529 to proceed with a fix in libc++abi.

llvm-svn: 214802

9 years ago[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi
Bill Schmidt [Mon, 4 Aug 2014 23:21:26 +0000 (23:21 +0000)]
[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi

My original LE implementation of the vsldoi instruction, with its
altivec.h interfaces vec_sld and vec_vsldoi, produces incorrect
shufflevector operations in the LLVM IR.  Correct code is generated
because the back end handles the incorrect shufflevector in a
consistent manner.

This patch and a companion patch for LLVM correct this problem by
removing the fixup from altivec.h and the corresponding fixup from the
PowerPC back end.  Several test cases are also modified to reflect the
now-correct LLVM IR.

The vec_sums and vec_vsumsws interfaces in altivec.h are also fixed,
because they used vec_perm calls intended to be recognized as vsldoi
instructions.  These vec_perm calls are now replaced with code that
more clearly shows the intent of the transformation.

llvm-svn: 214801

9 years ago[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi
Bill Schmidt [Mon, 4 Aug 2014 23:21:01 +0000 (23:21 +0000)]
[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi

My original LE implementation of the vsldoi instruction, with its
altivec.h interfaces vec_sld and vec_vsldoi, produces incorrect
shufflevector operations in the LLVM IR.  Correct code is generated
because the back end handles the incorrect shufflevector in a
consistent manner.

This patch and a companion patch for Clang correct this problem by
removing the fixup from altivec.h and the corresponding fixup from the
PowerPC back end.  Several test cases are also modified to reflect the
now-correct LLVM IR.

llvm-svn: 214800

9 years agoEnable Darwin vararg parameters support in assembler macros.
Kevin Enderby [Mon, 4 Aug 2014 23:14:37 +0000 (23:14 +0000)]
Enable Darwin vararg parameters support in assembler macros.

Duplicate the vararg tests for linux and add a tests which mixed
vararg arguments with darwin positional parameters.

Patch by: Janne Grunau <j@jannau.net>

llvm-svn: 214799