OSDN Git Service

android-x86/external-llvm.git
7 years ago[X86] Clzero intrinsic and its addition under znver1
Craig Topper [Thu, 9 Feb 2017 04:27:34 +0000 (04:27 +0000)]
[X86] Clzero intrinsic and its addition under znver1

This patch does the following.

1. Adds an Intrinsic int_x86_clzero which works with __builtin_ia32_clzero
2. Identifies clzero feature using cpuid info. (Function:8000_0008, Checks if EBX[0]=1)
3. Adds the clzero feature under znver1 architecture.
4. The custom inserter is added in Lowering.
5. A testcase is added to check the intrinsic.
6. The clzero instruction is added to assembler test.

Patch by Ganesh Gopalasubramanian with a couple formatting tweaks, a disassembler test, and using update_llc_test.py from me.

Differential revision: https://reviews.llvm.org/D29385

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

7 years agoObject: pad BSD ar string table to 4-bytes
Saleem Abdulrasool [Thu, 9 Feb 2017 04:26:21 +0000 (04:26 +0000)]
Object: pad BSD ar string table to 4-bytes

cctools would pad the string table to a sizeof(int32_t) (explicitly
printed out by cctools rather than 4).  This adjusts the string table to
make it more compatible with cctools, but is insufficient to make ld64
happy.

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

7 years ago[GlobalISel] Simplify StringRef parameters. NFC.
Ahmed Bougacha [Thu, 9 Feb 2017 02:50:01 +0000 (02:50 +0000)]
[GlobalISel] Simplify StringRef parameters. NFC.

'const' on StringRef parameters adds no guarantees. Remove it.

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

7 years agoSwiftCC: swifterror register cannot be as the base register
Arnold Schwaighofer [Thu, 9 Feb 2017 01:52:17 +0000 (01:52 +0000)]
SwiftCC: swifterror register cannot be as the base register

Functions that have a dynamic alloca require a base register which is defined to
be X19 on AArch64 and r6 on ARM.  We have defined the swifterror register to be
the same register. Use a different callee save register for swifterror instead:

 X21 on AArch64
 R8 on ARM

rdar://30433803

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

7 years agoLowerTypeTests: Change a few vtable globals in tests to constants.
Peter Collingbourne [Thu, 9 Feb 2017 01:48:24 +0000 (01:48 +0000)]
LowerTypeTests: Change a few vtable globals in tests to constants.

It turns out that some of our negative tests were not in fact providing the
test coverage we expected: they were passing because the vtables were failing
an early check that they were constant. Fix this by changing the globals in
these tests to constants.

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

7 years ago[MC] Fix some Clang-tidy modernize and Include What You Use warnings in SubtargetFeat...
Eugene Zelenko [Thu, 9 Feb 2017 01:09:54 +0000 (01:09 +0000)]
[MC] Fix some Clang-tidy modernize and Include What You Use warnings in SubtargetFeature; other minor fixes (NFC).

Same changes in files affected by reduced SubtargetFeature.h dependencies.

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

7 years agoReapply r294356 ("Keep track of spilled variables in LiveDebugValues").
Wolfgang Pieb [Wed, 8 Feb 2017 23:46:59 +0000 (23:46 +0000)]
Reapply r294356 ("Keep track of spilled variables in LiveDebugValues").

Was reverted with r294447 due to undefined behavior with negative offsets
in DBG_VALUE instructions.

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

7 years agoGlobalISel: legalize G_FPOW to a libcall on AArch64.
Tim Northover [Wed, 8 Feb 2017 23:23:39 +0000 (23:23 +0000)]
GlobalISel: legalize G_FPOW to a libcall on AArch64.

There's no instruction to implement it.

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

7 years agoGlobalISel: translate @llvm.pow intrinsic to G_FPOW.
Tim Northover [Wed, 8 Feb 2017 23:23:32 +0000 (23:23 +0000)]
GlobalISel: translate @llvm.pow intrinsic to G_FPOW.

It'll usually be immediately legalized back to a libcall, but occasionally
something can be done with it so we'd just as well enable that flexibility from
the start.

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

7 years ago[sancov] using comdat only when it is enabled
Mike Aizatsky [Wed, 8 Feb 2017 23:12:46 +0000 (23:12 +0000)]
[sancov] using comdat only when it is enabled

Differential Revision: https://reviews.llvm.org/D29733

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

7 years ago[ARM/AArch ISel] SwiftCC: First parameters that are marked swiftself are not 'this...
Arnold Schwaighofer [Wed, 8 Feb 2017 22:30:47 +0000 (22:30 +0000)]
[ARM/AArch ISel] SwiftCC: First parameters that are marked swiftself are not 'this returns'

We mark X0 as preserved by a call that passes the returned parameter.

 x0 = ...
 fun(x0) // no implicit def of x0

This no longer is valid if we pass the parameter in a different register then
the returned value as is the case with a swiftself parameter (passed in x20).

x20 = ...
fun(x20) // there should be an implict def of x8

rdar://30425845

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

7 years ago[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 8 Feb 2017 22:23:19 +0000 (22:23 +0000)]
[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[ARM] Fix some Include What You Use warnings; other minor fixes (NFC).
Eugene Zelenko [Wed, 8 Feb 2017 22:19:56 +0000 (22:19 +0000)]
[ARM] Fix some Include What You Use warnings; other minor fixes (NFC).

This is preparation to reduce MC headers dependencies.

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

7 years ago[InstCombine] add tests to show information-losing add nsw/nuw transforms; NFC
Sanjay Patel [Wed, 8 Feb 2017 22:14:11 +0000 (22:14 +0000)]
[InstCombine] add tests to show information-losing add nsw/nuw transforms; NFC

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

7 years agoRevert r294437 as it broke an asan buildbot.
Amara Emerson [Wed, 8 Feb 2017 21:41:16 +0000 (21:41 +0000)]
Revert r294437 as it broke an asan buildbot.

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

7 years agoGlobalISel: select G_[SU]MULH on AArch64.
Tim Northover [Wed, 8 Feb 2017 21:22:25 +0000 (21:22 +0000)]
GlobalISel: select G_[SU]MULH on AArch64.

Hopefully this'll be nuked by tablegen pretty soon, but until then it's
reasonably important for supporting C++ operator new[].

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

7 years agoGlobalISel: expand mul-with-overflow into mul-hi on AArch64.
Tim Northover [Wed, 8 Feb 2017 21:22:15 +0000 (21:22 +0000)]
GlobalISel: expand mul-with-overflow into mul-hi on AArch64.

AArch64 has specific instructions to multiply two numbers at double the width
and produce the high part of the result. These can be used to implement LLVM's
mul.with.overflow instructions fairly simply. Helps with C++ operator new[].

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

7 years ago[AMDGPU] Implement register pressure callbacks
Stanislav Mekhanoshin [Wed, 8 Feb 2017 21:22:03 +0000 (21:22 +0000)]
[AMDGPU] Implement register pressure callbacks

Implement getRegPressureLimit and getRegPressureSetLimit callbacks in
SIRegisterInfo.

This makes standard converge scheduler to behave almost the same as
GCNScheduler, sometime slightly better sometimes a bit worse.
In gerenal that is also possible to switch GCNScheduler to use these
callbacks instead of getMaxWaves(), which also makes GCNScheduler
slightly better on some tests and slightly worse on another. A big
win is behavior with converge scheduler.

Note, these are used not only by scheduling, but in places like
MachineLICM.

Differential Revision: https://reviews.llvm.org/D29700

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

7 years ago[sancov] specifying comdat for sancov constructors
Mike Aizatsky [Wed, 8 Feb 2017 21:20:33 +0000 (21:20 +0000)]
[sancov] specifying comdat for sancov constructors

Differential Revision: https://reviews.llvm.org/D29662

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

7 years agoTake code ownership of LLVM bitcode.
Peter Collingbourne [Wed, 8 Feb 2017 21:16:27 +0000 (21:16 +0000)]
Take code ownership of LLVM bitcode.

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

7 years ago[CMake] Fix `is_llvm_target_library` and support out-of-order components
Chris Bieneman [Wed, 8 Feb 2017 20:58:37 +0000 (20:58 +0000)]
[CMake] Fix `is_llvm_target_library` and support out-of-order components

Summary: This patch is required by D28855, and enables us to rely on CMake's ability to handle out of order target dependencies.

Reviewers: mgorny, chapuni, bryant

Subscribers: llvm-commits, jgosnell

Differential Revision: https://reviews.llvm.org/D28869

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

7 years agobuild_llvm_package.bat: Build teh clang-format plugin separately
Hans Wennborg [Wed, 8 Feb 2017 20:58:33 +0000 (20:58 +0000)]
build_llvm_package.bat: Build teh clang-format plugin separately

In r293373 we switched the build to linking dynamically against the
Universal CRT and include the redistributables in the installer.

However, clang-format.exe is copied into the vsix and needs to be
statically linked. This commit makes us build the plugin in a separate
step that uses static linking.

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

7 years agoThinLTOBitcodeWriter: Strip debug info from merged module.
Peter Collingbourne [Wed, 8 Feb 2017 20:44:00 +0000 (20:44 +0000)]
ThinLTOBitcodeWriter: Strip debug info from merged module.

This module will contain nothing but vtable definitions and (soon)
available_externally function definitions, so there is no point in keeping
debug info in the module.

Differential Revision: https://reviews.llvm.org/D28913

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

7 years ago[SLP] Additional test to check correct work of horizontal reductions,
Alexey Bataev [Wed, 8 Feb 2017 19:52:46 +0000 (19:52 +0000)]
[SLP] Additional test to check correct work of horizontal reductions,
NFC.

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

7 years ago[Loop Vectorizer] Cost-based decision for vectorization form of memory instruction.
Elena Demikhovsky [Wed, 8 Feb 2017 19:25:23 +0000 (19:25 +0000)]
[Loop Vectorizer] Cost-based decision for vectorization form of memory instruction.

Making the cost model selecting between Interleave, GatherScatter or Scalar vectorization form of memory instruction.
The right decision should be done for non-consecutive memory access instrcuctions that may have more than one vectorization solution.

This patch includes the following changes:
- Cost Model calculates the cost of Load/Store vector form and choose the better option between Widening, Interleave, GatherScactter and Scalarization. Cost Model keeps the widening decision.
- Arrays of Uniform and Scalar values are moved from Legality to Cost Model.
- Cost Model collects Uniforms and Scalars per VF. The collection is based on CM decision map of Loadis/Stores vectorization form.
- Vectorization of memory instruction is performed according to the CM decision.

Differential Revision: https://reviews.llvm.org/D27919

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

7 years ago[DebugInfo] Rename EmitDebugValue to EmitDebugThreadLocal (NFC)
Simon Dardis [Wed, 8 Feb 2017 19:03:46 +0000 (19:03 +0000)]
[DebugInfo] Rename EmitDebugValue to EmitDebugThreadLocal (NFC)

As pointed out by David Blaikie in the post commit review of
r292624, EmitDebugValue should be called EmitDebugThreadLocal.

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

7 years ago[X86][SSE] Regenerate scalar integer conversions to float tests
Simon Pilgrim [Wed, 8 Feb 2017 19:01:27 +0000 (19:01 +0000)]
[X86][SSE] Regenerate scalar integer conversions to float tests

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

7 years agoFix inline-asm-diags.ll on Windows, give it a triple to avoid WoA thumb confusion
Reid Kleckner [Wed, 8 Feb 2017 18:17:21 +0000 (18:17 +0000)]
Fix inline-asm-diags.ll on Windows, give it a triple to avoid WoA thumb confusion

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

7 years agollvm-objdump: make NoLeadingAddr work on more than just MachO
Saleem Abdulrasool [Wed, 8 Feb 2017 18:11:31 +0000 (18:11 +0000)]
llvm-objdump: make NoLeadingAddr work on more than just MachO

Support printing the disassembly without the address on all formats
rather than making it MachO specific.

Patch by Jeff Muizelaar!

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

7 years ago[DAGCombiner] NFC. Mark ByteProvider accessors as const
Artur Pilipenko [Wed, 8 Feb 2017 17:59:34 +0000 (17:59 +0000)]
[DAGCombiner] NFC. Mark ByteProvider accessors as const

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

7 years agoGlobalISel: select G_VASTART on iOS AArch64.
Tim Northover [Wed, 8 Feb 2017 17:57:27 +0000 (17:57 +0000)]
GlobalISel: select G_VASTART on iOS AArch64.

The AAPCS ABI is substantially more complicated so that's coming in a separate
patch. For now we can generate correct code for iOS though.

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

7 years agoGlobalISel: translate @llvm.va_start intrinsic.
Tim Northover [Wed, 8 Feb 2017 17:57:20 +0000 (17:57 +0000)]
GlobalISel: translate @llvm.va_start intrinsic.

Because we need to preserve the memory access being performed we need a
separate instruction to represent this.

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

7 years agoNVPTX: Extract mem intrinsic expansions into utilities
Matt Arsenault [Wed, 8 Feb 2017 17:49:52 +0000 (17:49 +0000)]
NVPTX: Extract mem intrinsic expansions into utilities

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

7 years ago[Reassociate] Remove an unused argument. NFC.
Chad Rosier [Wed, 8 Feb 2017 17:45:27 +0000 (17:45 +0000)]
[Reassociate] Remove an unused argument. NFC.

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

7 years agoFix bitcode upgrade for DIGlobalVariables with a var: field.
Adrian Prantl [Wed, 8 Feb 2017 17:44:43 +0000 (17:44 +0000)]
Fix bitcode upgrade for DIGlobalVariables with a var: field.

This is a follow-up to https://reviews.llvm.org/D29349.  It turns out
that NeedUpgradeToDIGlobalVariableExpression is always necessary when
we encountered a version==0 record because it may always be referenced
via a list of globals in a DICompileUnit. My tests weren't good enough
to catch this though. To trigger this case, we need much older bitcode
produced by LLVM around version 3.7.

<rdar://problem/30404262>

Differential Revision: https://reviews.llvm.org/D29693

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

7 years ago[InstCombine] add test for missed vector icmp fold; NFC
Sanjay Patel [Wed, 8 Feb 2017 17:37:17 +0000 (17:37 +0000)]
[InstCombine] add test for missed vector icmp fold; NFC

Also, move the related existing scalar test to a renamed file
where I'm planning to add more icmp-add tests.

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

7 years agoMove inline asm diags tests to an ARM directory.
Sanne Wouda [Wed, 8 Feb 2017 16:48:35 +0000 (16:48 +0000)]
Move inline asm diags tests to an ARM directory.

The assembler syntaxes (and parsers) differ too much to expect this test to
pass for all of them.

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

7 years ago[Hexagon] Fix decoding conflict between A2_zxtb and A4_ext
Krzysztof Parzyszek [Wed, 8 Feb 2017 16:31:00 +0000 (16:31 +0000)]
[Hexagon] Fix decoding conflict between A2_zxtb and A4_ext

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

7 years ago[mips] MUL macro variations
Simon Dardis [Wed, 8 Feb 2017 16:25:05 +0000 (16:25 +0000)]
[mips] MUL macro variations

[mips] MUL macro variations

Adds support for MUL macro variations.

Patch by: Srdjan Obucina

Reviewers: zoran.jovanovic, vkalintiris, dsanders, sdardis, obucina, seanbruno

Differential Revision: https://reviews.llvm.org/D16807

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

7 years ago[InstCombine] add local name for repeated calls; NFC
Sanjay Patel [Wed, 8 Feb 2017 16:19:36 +0000 (16:19 +0000)]
[InstCombine] add local name for repeated calls; NFC

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

7 years agoFix inline asm diagnostics test.
Sanne Wouda [Wed, 8 Feb 2017 16:14:01 +0000 (16:14 +0000)]
Fix inline asm diagnostics test.

Don't depend on X86 everywhere. Fix the original problem with a reg-exp for the
column number.

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

7 years agoLVI: Add a per-value worklist limit to LazyValueInfo.
Daniel Berlin [Wed, 8 Feb 2017 15:22:52 +0000 (15:22 +0000)]
LVI: Add a per-value worklist limit to LazyValueInfo.

Summary:
LVI is now depth first, which is optimal for iteration strategy in
terms of work per call.  However, the way the results get cached means
it can still go very badly N^2 or worse right now.  The overdefined
cache is per-block, because LVI wants to try to get different results
for the same name in different blocks (IE solve the problem
PredicateInfo solves).  This means even if we discover a value is
overdefined after going very deep, it doesn't cache this information,
causing it to end up trying to rediscover it again and again.  The
same is true for values along the way.  In practice, overdefined
anywhere should mean overdefined everywhere (this is how, for example,
SCCP works).

Until we get around to reworking the overdefined cache, we need to
limit the worklist size we process.  Note that permanently reverting
the DFS strategy exploration seems the wrong strategy (temporarily
seems fine if we really want).  BFS is clearly the wrong approach, it
just gets luckier on some testcases.  It's also very hard to design
an effective throttle for BFS. For DFS, the throttle is directly related
to the depth of the CFG.  So really deep CFGs will get cutoff, smaller
ones will not. As the CFG simplifies, you get better results.
In BFS, the limit is it's related to the fan-out times average block size,
which is harder to reason about or make good choices for.

Bug being filed about the overdefined cache, but it will require major
surgery to fix it (plumbing predicateinfo through CVP or LVI).

Note: I did not make this number configurable because i'm not sure
anyone really needs to tweak this knob.  We run CVP 3 times. On the
testcases i have the slow ones happen in the middle, where CVP is
doing cleanup work other things are effective at.  Over the course of
3 runs, we don't see to have any real loss of performance.

I haven't gotten a minimized testcase yet, but just imagine in your
head a testcase where, going *up* the CFG, you have branches, one of
which leads 50000 blocks deep, and the other, to something where the
answer is overdefined immediately.  BFS would discover the overdefined
faster than DFS, but do more work to do so.  In practice, the right
answer is "once DFS discovers overdefined for a value, stop trying to
get more info about that value" (and so, DFS would normally cache the
overdefined results for every value it passed through in those 50k
blocks, and never do that work again. But it don't, because of the
naming problem)

Reviewers: chandlerc, djasper

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29715

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

7 years ago[x86] add AVX512vl target for more coverage; NFC
Sanjay Patel [Wed, 8 Feb 2017 15:22:52 +0000 (15:22 +0000)]
[x86] add AVX512vl target for more coverage; NFC

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

7 years ago[InstComobineCalls] Fix buildbot failures after r294453.
Igor Laevsky [Wed, 8 Feb 2017 15:21:48 +0000 (15:21 +0000)]
[InstComobineCalls] Fix buildbot failures after r294453.

Some targets don't support uint64_t options. Change type to unsigned.

Differential Revision: https://reviews.llvm.org/D28909

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

7 years ago[Assembler] Enable nicer diagnostics for inline assembly.
Sanne Wouda [Wed, 8 Feb 2017 14:48:05 +0000 (14:48 +0000)]
[Assembler] Enable nicer diagnostics for inline assembly.

Fixed test.

Summary:
Enables source location in diagnostic messages from the backend.  This
is after parsing, during finalization.  This requires the SourceMgr, the
inline assembly string buffer, and DiagInfo to still be alive after
EmitInlineAsm returns.

This patch creates a single SourceMgr for inline assembly inside the
AsmPrinter.  MCContext gets a pointer to this SourceMgr.  Using one
SourceMgr per call to EmitInlineAsm would make it difficult for
MCContext to figure out in which SourceMgr the SMLoc is located, while a
single SourceMgr can figure it out if it has multiple buffers.

The Str argument to EmitInlineAsm is copied into a buffer and owned by
the inline asm SourceMgr.  This ensures that DiagHandlers won't print
garbage.  (Clang emits a "note: instantiated into assembly here", which
refers to this string.)

The AsmParser gets destroyed before finalization, which means that the
DiagHandlers the AsmParser installs into the SourceMgr will be stale.
Restore the saved DiagHandlers.

Since now we're using just one SourceMgr for multiple inline asm
strings, we need to tell the AsmParser which buffer it needs to parse
currently.  Hand a buffer id -- returned from SourceMgr::
AddNewSourceBuffer -- to the AsmParser.

Reviewers: rnk, grosbach, compnerd, rengolin, rovka, anemet

Reviewed By: rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29441

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

7 years ago[X86][SSE] Tidyup LowerBuildVectorv16i8 and LowerBuildVectorv8i16. NFCI.
Simon Pilgrim [Wed, 8 Feb 2017 14:44:45 +0000 (14:44 +0000)]
[X86][SSE] Tidyup LowerBuildVectorv16i8 and LowerBuildVectorv8i16. NFCI.

Run clang-format and standardized variable names between functions.

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

7 years agoAdd test case for pr31890. NFC
Amaury Sechet [Wed, 8 Feb 2017 14:35:48 +0000 (14:35 +0000)]
Add test case for pr31890. NFC

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

7 years ago[AMDGPU][NFC] Assign IsaInfo to reference variable in order to shorten long lines
Konstantin Zhuravlyov [Wed, 8 Feb 2017 14:34:10 +0000 (14:34 +0000)]
[AMDGPU][NFC] Assign IsaInfo to reference variable in order to shorten long lines

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

7 years ago[InstCombineCalls] Unfold element atomic memcpy instruction
Igor Laevsky [Wed, 8 Feb 2017 14:32:04 +0000 (14:32 +0000)]
[InstCombineCalls] Unfold element atomic memcpy instruction

Differential Revision: https://reviews.llvm.org/D28909

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

7 years ago[InstCombineCalls] Remove zero length atomic memcpy intrinsics
Igor Laevsky [Wed, 8 Feb 2017 14:23:47 +0000 (14:23 +0000)]
[InstCombineCalls] Remove zero length atomic memcpy intrinsics

Differential Revision: https://reviews.llvm.org/D28909

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

7 years agoFix test to work on swift/cyclone too
Diana Picus [Wed, 8 Feb 2017 14:23:30 +0000 (14:23 +0000)]
Fix test to work on swift/cyclone too

I forgot to remove the neonfp target feature from the test, which means we'd
have trouble selecting VADDS on targets that have neonfp enabled by default.

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

7 years ago[AMDGPU] Add target information that is required by tools to metadata
Konstantin Zhuravlyov [Wed, 8 Feb 2017 14:05:23 +0000 (14:05 +0000)]
[AMDGPU] Add target information that is required by tools to metadata

Differential Revision: https://reviews.llvm.org/D28760#fb670e28

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

7 years agoRevert "[Assembler] Enable nicer diagnostics for inline assembly."
Diana Picus [Wed, 8 Feb 2017 14:02:16 +0000 (14:02 +0000)]
Revert "[Assembler] Enable nicer diagnostics for inline assembly."

This reverts commit r294433 because it seems it broke the buildbots.

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

7 years agoRevert r294356, "DebugInfo: Track spilled variables in LiveDebugValues"
NAKAMURA Takumi [Wed, 8 Feb 2017 13:49:28 +0000 (13:49 +0000)]
Revert r294356, "DebugInfo: Track spilled variables in LiveDebugValues"

It caused undefined behavior in VarLoc. As far as I investigated,

  - VarLoc::VarLoc() treats negative offset value as InvalidKind.
    Consider the case that (int64_t)MI.getOperand(1).getImm() is negative and whether it satisfies ((uint64_t)Offset < (1ULL << 32)).

  - Comparison operators in VarLoc behave undefined since VarLoc::Loc.Hash is uninitialized in case of InvalidKind.

I guess Offset (in VarLoc) could be made aware of signed, but I am not sure.
So I have reverted it for now.

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

7 years agoMove test from r294430 to target-specific directory
Diana Picus [Wed, 8 Feb 2017 13:48:08 +0000 (13:48 +0000)]
Move test from r294430 to target-specific directory

The test is X86-specific, and it broke on the ARM bots because they don't build
the X86 target.

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

7 years ago[AMDGPU][NFC] De-tabify
Konstantin Zhuravlyov [Wed, 8 Feb 2017 13:29:23 +0000 (13:29 +0000)]
[AMDGPU][NFC] De-tabify

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

7 years agoAdding virtual destructor for PredicateBase.
Alexander Kornienko [Wed, 8 Feb 2017 13:28:27 +0000 (13:28 +0000)]
Adding virtual destructor for PredicateBase.

A virtual destructor is needed, since the derived classes are stored in
`iplist<PredicateBase> AllInfos;` and, apparently, ilist_node doesn't have a
virtual destructor.

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

7 years ago[ARM] GlobalISel: Add FPR reg bank
Diana Picus [Wed, 8 Feb 2017 13:23:04 +0000 (13:23 +0000)]
[ARM] GlobalISel: Add FPR reg bank

Add a register bank for floating point values and select simple instructions
using them (add, copies from GPR).

This assumes that the hardware can cope with a single precision add (VADDS)
instruction, so the legalizer will treat G_FADD as legal and the instruction
selector will refuse to select if the hardware doesn't support it. In the future
we'll want to be more careful about this, and legalize to libcalls if we have to
use soft float.

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

7 years ago[AMDGPU] Distinguish between S/VGPR allocation and encoding granularities
Konstantin Zhuravlyov [Wed, 8 Feb 2017 13:18:40 +0000 (13:18 +0000)]
[AMDGPU] Distinguish between S/VGPR allocation and encoding granularities

Differential Revision: https://reviews.llvm.org/D29633

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

7 years ago[AMDGPU] Move register related queries to subtarget class
Konstantin Zhuravlyov [Wed, 8 Feb 2017 13:02:33 +0000 (13:02 +0000)]
[AMDGPU] Move register related queries to subtarget class

Differential Revision: https://reviews.llvm.org/D29318

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

7 years ago[AArch64][TableGen] Skip tied result operands for InstAlias
Amara Emerson [Wed, 8 Feb 2017 11:28:08 +0000 (11:28 +0000)]
[AArch64][TableGen] Skip tied result operands for InstAlias

This patch checks the number of operands in the resulting
instruction instead of just the alias, then skips over
tied operands when generating the printing method.

This allows us to generate the preferred assembly syntax
for the AArch64 'ins' instruction, which should always be
displayed as 'mov' according to the ARMARM.

Several unit tests have changed as a result, but only to
reflect the preferred disassembly.

Some other InstAlias patterns (movk/bic/orr) needed a
slight adjustment to stop them becoming the default
and breaking other unit tests.

Patch by Graham Hunter.

Differential Revision: https://reviews.llvm.org/D29219

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

7 years agoUpdate CODE_OWNERS with my new email address
Dylan McKay [Wed, 8 Feb 2017 10:38:06 +0000 (10:38 +0000)]
Update CODE_OWNERS with my new email address

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

7 years ago[AVR] XFAIL a set of failing CodeGen tests
Dylan McKay [Wed, 8 Feb 2017 10:24:18 +0000 (10:24 +0000)]
[AVR] XFAIL a set of failing CodeGen tests

There are about 3 underlying bugs causing the tests to fail.

On top of that, some tests just we're 'generic' enough. i.e. 32-bit
registers.

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

7 years ago[Assembler] Enable nicer diagnostics for inline assembly.
Sanne Wouda [Wed, 8 Feb 2017 10:20:07 +0000 (10:20 +0000)]
[Assembler] Enable nicer diagnostics for inline assembly.

Summary:
Enables source location in diagnostic messages from the backend.  This
is after parsing, during finalization.  This requires the SourceMgr, the
inline assembly string buffer, and DiagInfo to still be alive after
EmitInlineAsm returns.

This patch creates a single SourceMgr for inline assembly inside the
AsmPrinter.  MCContext gets a pointer to this SourceMgr.  Using one
SourceMgr per call to EmitInlineAsm would make it difficult for
MCContext to figure out in which SourceMgr the SMLoc is located, while a
single SourceMgr can figure it out if it has multiple buffers.

The Str argument to EmitInlineAsm is copied into a buffer and owned by
the inline asm SourceMgr.  This ensures that DiagHandlers won't print
garbage.  (Clang emits a "note: instantiated into assembly here", which
refers to this string.)

The AsmParser gets destroyed before finalization, which means that the
DiagHandlers the AsmParser installs into the SourceMgr will be stale.
Restore the saved DiagHandlers.

Since now we're using just one SourceMgr for multiple inline asm
strings, we need to tell the AsmParser which buffer it needs to parse
currently.  Hand a buffer id -- returned from SourceMgr::
AddNewSourceBuffer -- to the AsmParser.

Reviewers: rnk, grosbach, compnerd, rengolin, rovka, anemet

Reviewed By: rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29441

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

7 years agoUse dynamic symbols for ELF disassembly
Sam Parker [Wed, 8 Feb 2017 09:44:18 +0000 (09:44 +0000)]
Use dynamic symbols for ELF disassembly

Disassembly currently begins from addresses obtained from the objects
symbol table. For ELF, add the dynamic symbols to the list if no
static symbols are available so that we can more successfully
disassemble stripped binaries.

Differential Revision: https://reviews.llvm.org/D29632

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

7 years ago[ArgPromote] Delete a test that makes no sense (any more).
Chandler Carruth [Wed, 8 Feb 2017 08:54:08 +0000 (08:54 +0000)]
[ArgPromote] Delete a test that makes no sense (any more).

This test is under 'ArgumentPromotion' but there are no arguments that
get promoted in the test case, so there seems to be no point. Also,
there are no assertions about the output at all, so this seems like
something we should just delete given the low value.

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

7 years ago[AVR] Add missing #includes
Dylan McKay [Wed, 8 Feb 2017 08:52:46 +0000 (08:52 +0000)]
[AVR] Add missing #includes

A previous change seems to have remove #includes from header files. This
fixes the build.

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

7 years ago[ArgPromote] Clean up a crash test case by rinsing it through opt,
Chandler Carruth [Wed, 8 Feb 2017 08:47:35 +0000 (08:47 +0000)]
[ArgPromote] Clean up a crash test case by rinsing it through opt,
renaming things to at least have somewhat spelled out names, and even
have meaningful names where I could guess at what they should be.

Also add FileCheck assertions that we're actually doing what we set out
to do for some of the tests, for example not promoting a type that would
result in infinite promotion.

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

7 years ago[ArgPromote] Actually add FileCheck to a test that I actually updated to
Chandler Carruth [Wed, 8 Feb 2017 08:04:02 +0000 (08:04 +0000)]
[ArgPromote] Actually add FileCheck to a test that I actually updated to
have nice CHECK patterns instead of relying on a coarse 'not grep'
check. Sorry that I missed this the first time through.

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

7 years ago[ArgPromote] Actually run FileCheck on this test. The CHECK lines are
Chandler Carruth [Wed, 8 Feb 2017 08:01:14 +0000 (08:01 +0000)]
[ArgPromote] Actually run FileCheck on this test. The CHECK lines are
already there, just waiting to, well, be checked. =]

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

7 years agoTargetLowering: Remove AddrSpace parameter from GetAddrModeArguments
Matt Arsenault [Wed, 8 Feb 2017 07:09:03 +0000 (07:09 +0000)]
TargetLowering: Remove AddrSpace parameter from GetAddrModeArguments

It doesn't make any sense to pass in to what is supposed to be parsing
the call, and this can be inferred from the pointer output.

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

7 years agoLSR: Check atomic instruction pointer operands
Matt Arsenault [Wed, 8 Feb 2017 06:44:58 +0000 (06:44 +0000)]
LSR: Check atomic instruction pointer operands

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

7 years agoAMDGPU: Enable InferAddressSpaces
Matt Arsenault [Wed, 8 Feb 2017 06:16:04 +0000 (06:16 +0000)]
AMDGPU: Enable InferAddressSpaces

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

7 years ago[X86] Add test for clflushopt intrinsic and only enable it to be selected if the...
Craig Topper [Wed, 8 Feb 2017 05:45:46 +0000 (05:45 +0000)]
[X86] Add test for clflushopt intrinsic and only enable it to be selected if the feature flag is set.

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

7 years ago[X86] Remove the VMFUNC feature flag. It was only partially implemented and we have...
Craig Topper [Wed, 8 Feb 2017 05:45:42 +0000 (05:45 +0000)]
[X86] Remove the VMFUNC feature flag. It was only partially implemented and we have no support for codegening vmfunc instructions today.

If that support ever gets added, the full feature flag support should come along with it.

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

7 years ago[X86] Remove PCOMMIT instruction support since Intel has deprecated this instruction...
Craig Topper [Wed, 8 Feb 2017 05:45:39 +0000 (05:45 +0000)]
[X86] Remove PCOMMIT instruction support since Intel has deprecated this instruction with no plans to release products with it.

Intel's documentation for the deprecation https://software.intel.com/en-us/blogs/2016/09/12/deprecate-pcommit-instruction

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

7 years agoMove mnemonicIsValid to Mips target.
Craig Topper [Wed, 8 Feb 2017 02:54:12 +0000 (02:54 +0000)]
Move mnemonicIsValid to Mips target.

Summary:
The Mips target is the only user of mnemonicIsValid. This patch
moves this method from AsmMatcherEmitter.cpp to MipsAsmParser.cpp,
getting rid of the method in all other targets where it generated
warnings about an unused function.

Patch by Gonsolo.

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: sdardis

Differential Revision: https://reviews.llvm.org/D28748

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

7 years agoRevert "CVP: Make CVP iterate in an order that maximizes reuse of LVI cache"
Daniel Berlin [Wed, 8 Feb 2017 02:48:25 +0000 (02:48 +0000)]
Revert "CVP: Make CVP iterate in an order that maximizes reuse of LVI cache"

This reverts commit r294398, it seems to be failing on the bots.

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

7 years agoCVP: Make CVP iterate in an order that maximizes reuse of LVI cache
Daniel Berlin [Wed, 8 Feb 2017 02:35:07 +0000 (02:35 +0000)]
CVP: Make CVP iterate in an order that maximizes reuse of LVI cache

Summary:
After the DFS order change for LVI, i have a few testcases that now
take forever.

The TL;DR - This is mainly due to the overdefined cache, but that
requires predicateinfo to fix[1]

In order to maximize reuse of the LVI cache for now, change the order
we iterate in.

This reduces my testcase from 5 minutes to 4 seconds.

I have verified cases like gmic do not get slower.

I am playing with whether the order should be postorder or idf.

[1] In practice, overdefined anywhere should be overdefined
everywhere, so this cache should be global.  That also fixes this bug.
The problem, however, is that LVI relies on this cache being filled in
per-block because it wants different values in different blocks due to
precisely the naming issue that predicateinfo fixes.  With
predicateinfo, making the cache global works fine on individual
passes, and also resolves this issue.

Reviewers: davide, sanjoy, chandlerc

Subscribers: llvm-commits, djasper

Differential Revision: https://reviews.llvm.org/D29679

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

7 years ago[DAGCombiner] Push truncate through adde when the carry isn't used.
Amaury Sechet [Wed, 8 Feb 2017 00:32:36 +0000 (00:32 +0000)]
[DAGCombiner] Push truncate through adde when the carry isn't used.

Summary: As per title.

Reviewers: mkuper, spatel, bkramer, RKSimon, zvi

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29528

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

7 years ago[Orc][RPC] Add a HandlerTratis specialization for free functions.
Lang Hames [Wed, 8 Feb 2017 00:13:51 +0000 (00:13 +0000)]
[Orc][RPC] Add a HandlerTratis specialization for free functions.

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

7 years ago[libFuzzer] Use long long to ensure 64 bits.
Marcos Pividori [Wed, 8 Feb 2017 00:03:31 +0000 (00:03 +0000)]
[libFuzzer] Use long long to ensure 64 bits.

We should always use unsigned long long to ensure 64 bits. On Windows, unsigned
long is 4 bytes. This was the reason why value-profile-cmp4.test was failing on
Windows.

Differential Revision: https://reviews.llvm.org/D29617

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

7 years ago[libFuzzer] Use custom target instead of list of binaries for tests.
Marcos Pividori [Wed, 8 Feb 2017 00:03:26 +0000 (00:03 +0000)]
[libFuzzer] Use custom target instead of list of binaries for tests.

Update cmake to use a custom target TestBinaries instead of a list of targets.
This simplifies cmake, and fix some errors. This way, we don't have to propagate
the values into parents directories. We only need to use add_dependencies.

Differential Revision: https://reviews.llvm.org/D29593

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

7 years ago[libFuzzer] Properly use Handle instead of FD on Windows.
Marcos Pividori [Wed, 8 Feb 2017 00:03:18 +0000 (00:03 +0000)]
[libFuzzer] Properly use Handle instead of FD on Windows.

For Windows, sanitizers work with Handles, not with posix file descriptors,
because they use the windows-specific API. So we need to convert the fds to
handles before passing them to the sanitizer library.
After this change, close_fd_mask is fixed for Windows (this fix some tests too).

Differential Revision: https://reviews.llvm.org/D29548

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

7 years ago[libFuzzer] Change Uninstrumented test name.
Marcos Pividori [Wed, 8 Feb 2017 00:03:13 +0000 (00:03 +0000)]
[libFuzzer] Change Uninstrumented test name.

On Windows, executables with the word "uninst" included in their names are
associated with administrator privileges.

Differential Revision: https://reviews.llvm.org/D29549

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

7 years ago[libFuzzer] fuzzer-jobs requires posix.
Marcos Pividori [Wed, 8 Feb 2017 00:03:07 +0000 (00:03 +0000)]
[libFuzzer] fuzzer-jobs requires posix.

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

7 years ago[libFuzzer] Update fuzzer.test to properly set environment variables.
Marcos Pividori [Wed, 8 Feb 2017 00:03:03 +0000 (00:03 +0000)]
[libFuzzer] Update fuzzer.test to properly set environment variables.

Use env to set environment variables, so it works on Windows and Linux.

Differential Revision: https://reviews.llvm.org/D29537

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

7 years ago[libFuzzer] Don't add newline character when using echo in tests.
Marcos Pividori [Wed, 8 Feb 2017 00:02:59 +0000 (00:02 +0000)]
[libFuzzer] Don't add newline character when using echo in tests.

Add the option "-n", so we don't add a new line character at the end of the file
when using echo. (on Windows this means 2 characters).

Differential Revision: https://reviews.llvm.org/D29536

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

7 years ago[libFuzzer] Disable ulimit test on windows.
Marcos Pividori [Wed, 8 Feb 2017 00:02:54 +0000 (00:02 +0000)]
[libFuzzer] Disable ulimit test on windows.

Differential Revision: https://reviews.llvm.org/D29535

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

7 years ago[libFuzzer] Remove ? wildcard on tests.
Marcos Pividori [Wed, 8 Feb 2017 00:02:50 +0000 (00:02 +0000)]
[libFuzzer] Remove ? wildcard on tests.

We can not use the wildcard ? on Windows.

Differential Revision: https://reviews.llvm.org/D29534

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

7 years ago[libFuzzer] Update fuzzer-segv to set environment variables.
Marcos Pividori [Wed, 8 Feb 2017 00:02:45 +0000 (00:02 +0000)]
[libFuzzer] Update fuzzer-segv to set environment variables.

Use env to set environment variables, so it works on Linux and Windows.

Differential Revision: https://reviews.llvm.org/D29533

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

7 years ago[libFuzzer] Properly configure tests for Windows.
Marcos Pividori [Wed, 8 Feb 2017 00:02:41 +0000 (00:02 +0000)]
[libFuzzer] Properly configure tests for Windows.

This configuration is necessary, and is included in all tests suites.
We need to execute: `config.test_format = lit.formats.ShTest(False)`
Otherwise, lit will try to use bash, which generates many problems.

Differential Revision: https://reviews.llvm.org/D29529

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

7 years ago[libFuzzer] Simplify dump_coverage test.
Marcos Pividori [Wed, 8 Feb 2017 00:02:36 +0000 (00:02 +0000)]
[libFuzzer] Simplify dump_coverage test.

Environment variables are handled differently on Windows. In this case it is not
necessary to use environment variables. So, I simplify the test to work on
Windows.

Differential Revision: https://reviews.llvm.org/D29532

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

7 years ago[libFuzzer] Update Load test to work on 32 bits.
Marcos Pividori [Wed, 8 Feb 2017 00:02:32 +0000 (00:02 +0000)]
[libFuzzer] Update Load test to work on 32 bits.

We should ensure the size of the variable `a` is 8 bytes. Otherwise, this
generates a stack buffer overflow inside the memcpy call in 32 bits machines.
(We write more bytes than the size of a, when it is 4 bytes)

Differential Revision: https://reviews.llvm.org/D29602

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

7 years ago[libFuzzer] Update test to consider different exceptions.
Marcos Pividori [Wed, 8 Feb 2017 00:02:25 +0000 (00:02 +0000)]
[libFuzzer] Update test to consider different exceptions.

Differential Revision: https://reviews.llvm.org/D29531

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

7 years ago[libFuzzer] Temporarily fix Shmem for Windows.
Marcos Pividori [Wed, 8 Feb 2017 00:02:12 +0000 (00:02 +0000)]
[libFuzzer] Temporarily fix Shmem for Windows.

In this diff, I add stubs for shared memory on Windows. Now we can compile and
use libFuzzer without support for shared memory.

Differential Revision: https://reviews.llvm.org/D29544

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

7 years ago[IRCE] Add a missing invariant check
Sanjoy Das [Tue, 7 Feb 2017 23:59:07 +0000 (23:59 +0000)]
[IRCE] Add a missing invariant check

Currently IRCE relies on the loops it transforms to be (semantically) of
the form:

  for (i = START; i < END; i++)
    ...

or

  for (i = START; i > END; i--)
    ...

However, we were not verifying the presence of the START < END entry
check (i.e. check before the first iteration).  We were only verifying
that the backedge was guarded by (i + 1) < END.

Usually this would work "fine" since (especially in Java) most loops do
actually have the START < END check, but of course that is not
guaranteed.

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

7 years ago[CMake] Allow overriding CMAKE_LIBTOOL
Chris Bieneman [Tue, 7 Feb 2017 23:32:56 +0000 (23:32 +0000)]
[CMake] Allow overriding CMAKE_LIBTOOL

This patch allows a user to specify a their own libtool instead of auto-detecting one.

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

7 years ago[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Tue, 7 Feb 2017 23:02:00 +0000 (23:02 +0000)]
[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[PowerPC] Fix some Include What You Use warnings; other minor fixes (NFC).
Eugene Zelenko [Tue, 7 Feb 2017 22:59:46 +0000 (22:59 +0000)]
[PowerPC] Fix some Include What You Use warnings; other minor fixes (NFC).

This is preparation to reduce MC headers dependencies.

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