platform/upstream/llvm.git
8 years agoRevert "[LIR] Handle access to AliasAnalysis the same way as the other analysis in...
Renato Golin [Thu, 13 Aug 2015 11:25:35 +0000 (11:25 +0000)]
Revert "[LIR] Handle access to AliasAnalysis the same way as the other analysis in LoopIdiomRecognize."

This reverts commit r244880, as it broke the test-suite on
SingleSource/Regression/C/2004-03-15-IndirectGoto in AArch64.

llvm-svn: 244884

8 years agoTest Commit.
Ashutosh Nema [Thu, 13 Aug 2015 11:18:35 +0000 (11:18 +0000)]
Test Commit.

llvm-svn: 244883

8 years ago[ARM] Reorganise and simplify thumb-1 load/store selection
John Brawn [Thu, 13 Aug 2015 10:48:22 +0000 (10:48 +0000)]
[ARM] Reorganise and simplify thumb-1 load/store selection

Other than PC-relative loads/store the patterns that match the various
load/store addressing modes have the same complexity, so the order that they
are matched is the order that they appear in the .td file.

Rearrange the instruction definitions in ARMInstrThumb.td, and make use of
AddedComplexity for PC-relative loads, so that the instruction matching order
is the order that results in the simplest selection logic. This also makes
register-offset load/store be selected when it should, as previously it was
only selected for too-large immediate offsets.

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

llvm-svn: 244882

8 years agoAdd missing include to RegisterInfoInterface.h
Tamas Berghammer [Thu, 13 Aug 2015 10:41:55 +0000 (10:41 +0000)]
Add missing include to RegisterInfoInterface.h

llvm-svn: 244881

8 years ago[LIR] Handle access to AliasAnalysis the same way as the other analysis
Chandler Carruth [Thu, 13 Aug 2015 10:00:53 +0000 (10:00 +0000)]
[LIR] Handle access to AliasAnalysis the same way as the other analysis
in LoopIdiomRecognize. This is what started me staring at this code. Now
migrating it with the new AA stuff will be trivial.

llvm-svn: 244880

8 years ago[LIR] Start leveraging the fundamental guarantees of a loop in
Chandler Carruth [Thu, 13 Aug 2015 09:56:20 +0000 (09:56 +0000)]
[LIR] Start leveraging the fundamental guarantees of a loop in
simplified form to remove redundant checks and simplify the code for
popcount recognition. We don't actually need to handle all of these
cases.

I've left a FIXME for one in particular until I finish inspecting to
make sure we don't actually *rely* on the predicate in any way.

llvm-svn: 244879

8 years ago[LIR] Handle the LoopInfo the same as all the other analyses. No utility
Chandler Carruth [Thu, 13 Aug 2015 09:27:01 +0000 (09:27 +0000)]
[LIR] Handle the LoopInfo the same as all the other analyses. No utility
really in breaking pattern just for this analysis.

llvm-svn: 244878

8 years agoFix Linux build after r244875
Tamas Berghammer [Thu, 13 Aug 2015 09:19:27 +0000 (09:19 +0000)]
Fix Linux build after r244875

llvm-svn: 244877

8 years agoFix formatting.
Manuel Klimek [Thu, 13 Aug 2015 09:09:28 +0000 (09:09 +0000)]
Fix formatting.

llvm-svn: 244876

8 years agoSet orig_eax to -1 for Linux x86 platforms
Ravitheja Addepally [Thu, 13 Aug 2015 09:05:11 +0000 (09:05 +0000)]
Set orig_eax to -1 for Linux x86 platforms

Summary:
For Linux x86 based environments the orig_eax/orig_rax
register should be set to -1 to prevent the instruction pointer
to be decremented, which was the cause for the SIGILL exception.

Fix for Bug 23659

Reviewers: zturner, ashok.thirumurthi, mikesart, jingham, clayborg

Subscribers: clayborg, labath

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

llvm-svn: 244875

8 years agoEnable code generation of scalar dependences from function arguments
Tobias Grosser [Thu, 13 Aug 2015 08:07:39 +0000 (08:07 +0000)]
Enable code generation of scalar dependences from function arguments

This change extends the BlockGenerator to not only allow Instructions as
base elements of scalar dependences, but any llvm::Value. This allows
us to code-generate scalar dependences which reference function arguments, as
they arise when moddeling read-only scalar dependences.

llvm-svn: 244874

8 years agoRevert "Removed xfail, since test is passing in line with expanded dtor sanitizing...
Daniel Jasper [Thu, 13 Aug 2015 07:57:32 +0000 (07:57 +0000)]
Revert "Removed xfail, since test is passing in line with expanded dtor sanitizing functionality"

Still breaking the bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19678/steps/ninja%20check-msan/logs/stdio

llvm-svn: 244873

8 years ago[InstCombine] SSE/AVX vector shifts demanded shift amount bits
Simon Pilgrim [Thu, 13 Aug 2015 07:39:03 +0000 (07:39 +0000)]
[InstCombine] SSE/AVX vector shifts demanded shift amount bits

Most SSE/AVX (non-constant) vector shift instructions only use the lower 64-bits of the 128-bit shift amount vector operand, this patch calls SimplifyDemandedVectorElts to optimize for this.

I had to refactor some of my recent InstCombiner work on the vector shifts to avoid quite a bit of duplicate code, it means that SimplifyX86immshift now (re)decodes the type of shift.

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

llvm-svn: 244872

8 years agoRemove superfluous private:, TypeCache is private by default.
Yaron Keren [Thu, 13 Aug 2015 07:12:03 +0000 (07:12 +0000)]
Remove superfluous private:, TypeCache is private by default.

llvm-svn: 244871

8 years agoModify raw_svector_ostream to use its SmallString without additional buffering.
Yaron Keren [Thu, 13 Aug 2015 06:19:52 +0000 (06:19 +0000)]
Modify raw_svector_ostream to use its SmallString without additional buffering.
This is faster and avoids the stream and SmallString state synchronization issue.
resync() is a no-op and may be safely deleted.  I'll do so in a follow-up commit.

Reviewed by Rafael Espindola.

llvm-svn: 244870

8 years agoDisable failing check in bots from r244867.
Yaron Keren [Thu, 13 Aug 2015 06:12:49 +0000 (06:12 +0000)]
Disable failing check in bots from r244867.

llvm-svn: 244869

8 years ago[LoopUnswitch] Check OptimizeForSize before traversing over all basic blocks in curre...
Chen Li [Thu, 13 Aug 2015 05:24:29 +0000 (05:24 +0000)]
[LoopUnswitch] Check OptimizeForSize before traversing over all basic blocks in current loop

Summary: This patch moves the check of OptimizeForSize before traversing over all basic blocks in current loop. If OptimizeForSize is set to true, no non-trivial unswitch is ever allowed. Therefore, the early exit will help reduce compilation time. This patch should be NFC.

Reviewers: reames, weimingz, broune

Subscribers: llvm-commits

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

llvm-svn: 244868

8 years agoAdd sanitizer blacklists to the rules generated with -M/-MM/-MD/-MMD.
Ivan Krasin [Thu, 13 Aug 2015 04:04:37 +0000 (04:04 +0000)]
Add sanitizer blacklists to the rules generated with -M/-MM/-MD/-MMD.

Summary:
Clang sanitizers, such as AddressSanitizer, ThreadSanitizer, MemorySanitizer,
Control Flow Integrity and others, use blacklists to specify which types / functions
should not be instrumented to avoid false positives or suppress known failures.

This change adds the blacklist filenames to the list of dependencies of the rules,
generated with -M/-MM/-MD/-MMD. This lets CMake/Ninja recognize that certain
C/C++/ObjC files need to be recompiled (if a blacklist is updated).

Reviewers: pcc

Subscribers: rsmith, honggyu.kim, pcc, cfe-commits

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

llvm-svn: 244867

8 years ago[LLDB][MIPS] Use qfThreadID if qC packet is not supported by target
Jaydeep Patil [Thu, 13 Aug 2015 03:46:36 +0000 (03:46 +0000)]
[LLDB][MIPS] Use qfThreadID if qC packet is not supported by target
    SUMMARY:
    The patch uses qfThreadID to get the thread IDs if qC packet is not supported by target.

    Reviewers: jingham, clayborg
    Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
    Differential Revision: http://reviews.llvm.org/D11519

llvm-svn: 244866

8 years ago[LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint
Jaydeep Patil [Thu, 13 Aug 2015 03:46:01 +0000 (03:46 +0000)]
[LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint
    SUMMARY:
    The patch supports TAAwatch:addr packet. The patch also sets m_watchpoints_trigger_after_instruction
    to eLazyBoolNo when qHostInfo or qWatchpointSupportInfo is not supported by the target.

    Reviewers: jingham, clayborg
    Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
    Differential Revision: http://reviews.llvm.org/D11747

llvm-svn: 244865

8 years ago[LLDB][MIPS] Handle false positives for MIPS hardware watchpoints
Jaydeep Patil [Thu, 13 Aug 2015 03:44:09 +0000 (03:44 +0000)]
[LLDB][MIPS] Handle false positives for MIPS hardware watchpoints
    SUMMARY:
    Last 3bits of the watchpoint address are masked by the kernel. For example, n is
    at 0x120010d00 and m is 0x120010d04. When a watchpoint is set at m, then watch
    exception is generated even when n is read/written. To handle this case, instruction
    at PC is emulated to find the base address of the load/store instruction. This address
    is then appended to the description of the stop-info packet. Client then reads this
    information to check whether the user has set a watchpoint on this address.

    Reviewers: jingham, clayborg
    Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
    Differential Revision: http://reviews.llvm.org/D11672

llvm-svn: 244864

8 years agoAdd missing newline at EOF.
Bruce Mitchener [Thu, 13 Aug 2015 02:44:40 +0000 (02:44 +0000)]
Add missing newline at EOF.

This fixes a warning on the Mac OS X build.

llvm-svn: 244863

8 years ago[CodeGen] Mark the promoted FCOPYSIGN result FP_ROUND as TRUNCating.
Ahmed Bougacha [Thu, 13 Aug 2015 01:32:30 +0000 (01:32 +0000)]
[CodeGen] Mark the promoted FCOPYSIGN result FP_ROUND as TRUNCating.

Now that we can properly promote mismatched FCOPYSIGNs (r244858), we
can mark the FP_ROUND on the result as truncating, to expose folding.

FCOPYSIGN doesn't change anything but the sign bit, so
  (fp_round (fcopysign (fpext a), b))
is equivalent to (modulo the sign bit):
  (fp_round (fpext a))
which is a no-op.

llvm-svn: 244862

8 years ago[AArch64] Cleanup vector-fcopysign.ll test. NFC.
Ahmed Bougacha [Thu, 13 Aug 2015 01:20:38 +0000 (01:20 +0000)]
[AArch64] Cleanup vector-fcopysign.ll test. NFC.

llvm-svn: 244861

8 years ago[AArch64] Also custom-lowering mismatched vector/f16 FCOPYSIGN.
Ahmed Bougacha [Thu, 13 Aug 2015 01:13:56 +0000 (01:13 +0000)]
[AArch64] Also custom-lowering mismatched vector/f16 FCOPYSIGN.

We can lower them using our cool tricks if we fpext/fptrunc the second
input, like we do for f32/f64.

Follow-up to r243924, r243926, and r244858.

llvm-svn: 244860

8 years ago[CodeGen] Assert on getNode(FP_EXTEND) with a smaller dst type.
Ahmed Bougacha [Thu, 13 Aug 2015 01:10:29 +0000 (01:10 +0000)]
[CodeGen] Assert on getNode(FP_EXTEND) with a smaller dst type.

This would have caught the problem in r244858.

llvm-svn: 244859

8 years ago[CodeGen] When Promoting, don't extend the 2nd FCOPYSIGN operand.
Ahmed Bougacha [Thu, 13 Aug 2015 01:09:43 +0000 (01:09 +0000)]
[CodeGen] When Promoting, don't extend the 2nd FCOPYSIGN operand.

We don't care about its type, and there's even a combine that'll fold
away the FP_EXTEND if we let it run. However, until it does, we'll have
something broken like:
  (f32 (fp_extend (f64 v)))

Scalar f16 follow-up to r243924.

llvm-svn: 244858

8 years ago[CodeGen] Simplify getNode(*EXT/TRUNC) type size assert. NFC.
Ahmed Bougacha [Thu, 13 Aug 2015 01:08:48 +0000 (01:08 +0000)]
[CodeGen] Simplify getNode(*EXT/TRUNC) type size assert. NFC.

We already check that vectors have the same number of elements, we
don't need to use the scalar types explicitly: comparing the size of
the whole vector is enough.

llvm-svn: 244857

8 years agoUpdate for llvm api change.
Rafael Espindola [Thu, 13 Aug 2015 01:07:08 +0000 (01:07 +0000)]
Update for llvm api change.

llvm-svn: 244856

8 years agoUpdate for llvm api change.
Rafael Espindola [Thu, 13 Aug 2015 01:07:06 +0000 (01:07 +0000)]
Update for llvm api change.

llvm-svn: 244855

8 years agoThere is only one saver of strings.
Rafael Espindola [Thu, 13 Aug 2015 01:07:02 +0000 (01:07 +0000)]
There is only one saver of strings.

llvm-svn: 244854

8 years ago[LIR] Make the LoopIdiomRecognize pass get analyses essentially the same
Chandler Carruth [Thu, 13 Aug 2015 01:03:26 +0000 (01:03 +0000)]
[LIR] Make the LoopIdiomRecognize pass get analyses essentially the same
way as every other pass. This simplifies the code quite a bit and is
also more idiomatic! <ba-dum!>

llvm-svn: 244853

8 years agoAdd SourceManager::dump() to dump the current set of SLocEntries.
Richard Smith [Thu, 13 Aug 2015 00:45:11 +0000 (00:45 +0000)]
Add SourceManager::dump() to dump the current set of SLocEntries.

llvm-svn: 244852

8 years ago[LIR] Remove the dedicated class for popcount recognition and sink the
Chandler Carruth [Thu, 13 Aug 2015 00:44:29 +0000 (00:44 +0000)]
[LIR] Remove the dedicated class for popcount recognition and sink the
code into methods on LoopIdiomRecognize.

This simplifies the code somewhat and also makes it much easier to move
the analyses around. Ultimately, the separate class wasn't providing
significant value over methods -- it contained the precondition basic
block and the current loop. The current loop is already available and
the precondition block wasn't needed everywhere and is easy to pass
around.

In several cases I just moved things to be static functions because they
already accepted most of their inputs as arguments.

This doesn't fix the way we manage analyses yet, that will be the next
patch, but it already makes the code over 50 lines shorter.

No functionality changed.

llvm-svn: 244851

8 years agoRemove DNBConfig.h
Bruce Mitchener [Thu, 13 Aug 2015 00:32:01 +0000 (00:32 +0000)]
Remove DNBConfig.h

Summary:
This was no longer needed and hasn't been needed since r143244
in 2011.  This removes everything associated with generating
or using it.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 244850

8 years agoUpdate for llvm api change.
Rafael Espindola [Thu, 13 Aug 2015 00:31:46 +0000 (00:31 +0000)]
Update for llvm api change.

llvm-svn: 244849

8 years agoReturn ErrorOr from FileOutputBuffer::create. NFC.
Rafael Espindola [Thu, 13 Aug 2015 00:31:39 +0000 (00:31 +0000)]
Return ErrorOr from FileOutputBuffer::create. NFC.

llvm-svn: 244848

8 years ago[WebAssembly] Declare the llvm.wasm.page.size() intrinsic.
Dan Gohman [Thu, 13 Aug 2015 00:26:04 +0000 (00:26 +0000)]
[WebAssembly] Declare the llvm.wasm.page.size() intrinsic.

llvm-svn: 244847

8 years agoConvert GetNumTemplateArguments() and GetTemplateArgument() to be instance functions...
Enrico Granata [Thu, 13 Aug 2015 00:24:24 +0000 (00:24 +0000)]
Convert GetNumTemplateArguments() and GetTemplateArgument() to be instance functions on the CompilerType and the TypeSystem

llvm-svn: 244846

8 years ago[LIR] Move all the helpers to be private and re-order the methods in
Chandler Carruth [Thu, 13 Aug 2015 00:10:03 +0000 (00:10 +0000)]
[LIR] Move all the helpers to be private and re-order the methods in
a way that groups things logically. No functionality changed.

llvm-svn: 244845

8 years agoThis test needs lib.exe.
Rafael Espindola [Thu, 13 Aug 2015 00:03:47 +0000 (00:03 +0000)]
This test needs lib.exe.

llvm-svn: 244844

8 years agoWdeprecated: LambdaScopeInfos need to be copied, so make the ScopeInfo hierarchy...
David Blaikie [Wed, 12 Aug 2015 23:59:02 +0000 (23:59 +0000)]
Wdeprecated: LambdaScopeInfos need to be copied, so make the ScopeInfo hierarchy safely copyable

Making the base class's copy ctor protected and the derived classes
final to avoid any slicing-prone APIs.

llvm-svn: 244843

8 years agoTest Commit - Corrected spelling in README.txt.
Steve King [Wed, 12 Aug 2015 23:56:50 +0000 (23:56 +0000)]
Test Commit - Corrected spelling in README.txt.

llvm-svn: 244842

8 years ago[LIR] Remove the 'LIRUtils' abstraction which was unnecessary and adding
Chandler Carruth [Wed, 12 Aug 2015 23:55:56 +0000 (23:55 +0000)]
[LIR] Remove the 'LIRUtils' abstraction which was unnecessary and adding
complexity.

There is only one function that was called from multiple locations, and
that was 'getBranch' which has a reasonable one-line spelling already:
dyn_cast<BranchInst>(BB->getTerminator). We could make this shorter, but
it doesn't seem to add much value. Instead, we should avoid calling it
so many times on the same basic blocks, but that will be in a subsequent
patch.

The other functions are only called in one location, so inline them
there, and take advantage of this to use direct early exit and reduce
indentation. This makes it much more clear what is being tested for, and
in fact makes it clear now to me that there are simpler ways to do this
work. However, this patch just does the mechanical inlining. I'll clean
up the functionality of the code to leverage loop simplified form more
effectively in a follow-up.

Despite lots of early line breaks due to early-exit, this is still
shorter than it was before.

llvm-svn: 244841

8 years ago[windows] Fix deadlock on mmap failure due to CHECK recursion
Reid Kleckner [Wed, 12 Aug 2015 23:55:38 +0000 (23:55 +0000)]
[windows] Fix deadlock on mmap failure due to CHECK recursion

Summary:
Printing a stacktrace acquires a spinlock, and the sanitizer spinlocks
aren't re-entrant. Avoid the problem by reusing the logic we already
have on Posix.

This failure mode is already exercised by the existing mmap_limit_mb.cc
test case. It will be enabled in a forthcoming change, so I didn't add
standalone tests for this change.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244840

8 years agoUse %env_asan_opts= substitution instead of 'env ASAN_OPTIONS=$ASAN_OPTIONS'
Reid Kleckner [Wed, 12 Aug 2015 23:50:12 +0000 (23:50 +0000)]
Use %env_asan_opts= substitution instead of 'env ASAN_OPTIONS=$ASAN_OPTIONS'

Summary:
The lit internal shell is used by default on Windows, and it does not
support bash variable expansion. Because bash variable expansion
interacts with tokenization, it is prohibitively difficult to make the
existing lit shell do general shell variable expansion.

The most common use of shell variables in the asan tests is to add
options to the default set of options set by lit.cfg. We can avoid the
need for variable expansion with a substitution that expands to 'env
ASAN_OPTIONS=<defaults:>'.

This has the side benefit of shortening the RUN lines, so it seemed
better than implementing limited variable expansion in lit.

Reviewers: samsonov, filcab

Subscribers: llvm-commits

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

llvm-svn: 244839

8 years agoWdeprecated: ApplyDebugLocation is returned by value yet if it is ever copied (rather...
David Blaikie [Wed, 12 Aug 2015 23:49:57 +0000 (23:49 +0000)]
Wdeprecated: ApplyDebugLocation is returned by value yet if it is ever copied (rather than RVO'd) that would be broken, make it movable instead

llvm-svn: 244838

8 years ago[windows] Always use the lit shell on Windows, even if bash is present
Reid Kleckner [Wed, 12 Aug 2015 23:49:52 +0000 (23:49 +0000)]
[windows] Always use the lit shell on Windows, even if bash is present

Summary:
This is consistent with LLVM and Clang. The lit shell isn't a complete
bash implementation, but its behavior is more easily reproducible.  This
fixes some ubsan test failures.

One ubsan test requires a shell currently, so I added "REQUIRES: shell",
and the other doesn't work on Windows because it prints a stack trace
and uses a linker that doesn't support DWARF. We can fix it eventually
through other means.

Reviewers: samsonov, pcc

Subscribers: yaron.keren, filcab, llvm-commits

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

llvm-svn: 244837

8 years agoWdeprecated: Remove unnecessary user-defined dtor that was getting in the way of...
David Blaikie [Wed, 12 Aug 2015 23:26:58 +0000 (23:26 +0000)]
Wdeprecated: Remove unnecessary user-defined dtor that was getting in the way of the default ops (copy construction, assignment, etc)

llvm-svn: 244836

8 years agoSimplify PackedVector by removing user-defined special members that aren't any differ...
David Blaikie [Wed, 12 Aug 2015 23:26:12 +0000 (23:26 +0000)]
Simplify PackedVector by removing user-defined special members that aren't any different than the defaults

This causes the other special members (like move and copy construction,
and move assignment) to come through for free. Some code in clang was
depending on the (deprecated, in the original code) copy ctor. Now that
there's no user-defined special members, they're all available without
any deprecation concerns.

llvm-svn: 244835

8 years agoFix an use of uninitialized.
Rafael Espindola [Wed, 12 Aug 2015 23:25:42 +0000 (23:25 +0000)]
Fix an use of uninitialized.

Should fix some tests on windows.

llvm-svn: 244834

8 years agoCombine helper file into main test file with ifdefs
Reid Kleckner [Wed, 12 Aug 2015 23:24:41 +0000 (23:24 +0000)]
Combine helper file into main test file with ifdefs

Keeping tests isolated to a single file is nice, and it was suggested in
post-commit review for r244827.

llvm-svn: 244833

8 years agoIRBuilder: Use move semantics for the IRBuilderInserter parameter
David Blaikie [Wed, 12 Aug 2015 23:18:49 +0000 (23:18 +0000)]
IRBuilder: Use move semantics for the IRBuilderInserter parameter

Just drive by cleanup while fixing -Wdeprecated warnings.

llvm-svn: 244832

8 years agoWdeprecated: CGBuilderInserter is copy constructed in some contexts - remove the...
David Blaikie [Wed, 12 Aug 2015 23:16:55 +0000 (23:16 +0000)]
Wdeprecated: CGBuilderInserter is copy constructed in some contexts - remove the unnecessarily disabling copy assignment to enable this

The object has very simple state, there seems no reason to disallow all
the usual value semantic operations.

llvm-svn: 244831

8 years ago-Wdeprecated: Job objects are stored in a vector yet are not really copyable, make...
David Blaikie [Wed, 12 Aug 2015 23:09:24 +0000 (23:09 +0000)]
-Wdeprecated: Job objects are stored in a vector yet are not really copyable, make them movable instead

llvm-svn: 244829

8 years ago[LIR] Run clang-format over LoopIdiomRecognize in preparation for
Chandler Carruth [Wed, 12 Aug 2015 23:06:37 +0000 (23:06 +0000)]
[LIR] Run clang-format over LoopIdiomRecognize in preparation for
a significant code cleanup here.

The handling of analyses in this pass is overly complex and can be
simplified significantly, but the right way to do that is to simplify
all of the code not just the analyses, and that'll require pretty
extensive edits that would be noisy with formatting changes mixed into
them.

llvm-svn: 244828

8 years agoMove tests that use unistd.h and pthread.h to TestCases/Posix
Reid Kleckner [Wed, 12 Aug 2015 22:58:56 +0000 (22:58 +0000)]
Move tests that use unistd.h and pthread.h to TestCases/Posix

llvm-svn: 244827

8 years ago-Wdeprecated: SavedInstanceContext is returned by value but isn't really copyable...
David Blaikie [Wed, 12 Aug 2015 22:58:10 +0000 (22:58 +0000)]
-Wdeprecated: SavedInstanceContext is returned by value but isn't really copyable, but it can be made movable

llvm-svn: 244826

8 years ago[PM/AA] Remove the AliasDebugger pass.
Chandler Carruth [Wed, 12 Aug 2015 22:54:47 +0000 (22:54 +0000)]
[PM/AA] Remove the AliasDebugger pass.

This debugger was designed to catch places where the old update API was
failing to be used correctly. As I've removed the update API, it no
longer serves any purpose. We can introduce new debugging aid passes
around any future work w.r.t. updating AAs.

Note that I've updated the documentation here, but really I need to
rewrite the documentation to carefully spell out the ideas around
stateful AA and how things are changing in the AA world. However, I'm
hoping to do that as a follow-up to the refactoring of the AA
infrastructure to work in both old and new pass managers so that I can
write the documentation specific to that world.

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

llvm-svn: 244825

8 years agoAdd myself as the InstCombine owner.
David Majnemer [Wed, 12 Aug 2015 22:30:45 +0000 (22:30 +0000)]
Add myself as the InstCombine owner.

llvm-svn: 244823

8 years ago[modules] If loading a .pcm file would cause us to run out of source locations, attem...
Richard Smith [Wed, 12 Aug 2015 22:25:24 +0000 (22:25 +0000)]
[modules] If loading a .pcm file would cause us to run out of source locations, attempt to fail more gracefully. (No test; this requires >= 4GB of preprocessed input...)

llvm-svn: 244822

8 years ago[RewriteStatepointsForGC] Avoid using unrelocated pointers after safepoints
Philip Reames [Wed, 12 Aug 2015 22:11:45 +0000 (22:11 +0000)]
[RewriteStatepointsForGC] Avoid using unrelocated pointers after safepoints

To be clear: this is an *optimization* not a correctness change.

CodeGenPrep likes to duplicate icmps feeding branch instructions to take advantage of x86's ability to fuze many comparison/branch patterns into a single micro-op and to reduce the need for materializing i1s into general registers. PlaceSafepoints likes to place safepoint polls right at the end of basic blocks (immediately before terminators) when inserting entry and backedge safepoints. These two heuristics interact in a somewhat unfortunate way where the branch terminating the original block will be controlled by a condition driven by unrelocated pointers. This forces the register allocator to keep both the relocated and unrelocated values of the pointers feeding the icmp alive over the safepoint poll.

One simple fix would have been to just adjust PlaceSafepoints to move one back in the basic block, but you can reach similar cases as a result of LICM or other hoisting passes. As a result, doing a post insertion fixup seems to be more robust.

I considered doing this in CodeGenPrep itself, but having to update the live sets of already rewritten safepoints gets complicated fast. In particular, you can't just use def/use information because by moving the icmp, we're extending the live range of it's inputs potentially.

Instead, this patch teaches RewriteStatepointsForGC to make the required adjustments before making the relocations explicit in the IR. This change really highlights the fact that RSForGC is a CodeGenPrep-like pass which is performing target specific lowering. In the long run, we may even want to combine the two though this would require a lot more smarts to be integrated into RSForGC first. We currently rely on being able to run a set of cleanup passes post rewriting because the IR RSForGC generates is pretty damn ugly.

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

llvm-svn: 244821

8 years agoRevert "Implement poisoning of only class members in dtor, as opposed to also poisoni...
Naomi Musgrave [Wed, 12 Aug 2015 22:07:24 +0000 (22:07 +0000)]
Revert "Implement poisoning of only class members in dtor, as opposed to also poisoning fields inherited from base classes."

This reverts commit 8dbbf3578a9a5d063232b59e558e5fe46e2cd42c.
Rolled back due to buildbot failures on 'ninja check-clang'.

llvm-svn: 244820

8 years agoImplement poisoning of only class members in dtor, as opposed to also poisoning field...
Naomi Musgrave [Wed, 12 Aug 2015 21:37:40 +0000 (21:37 +0000)]
Implement poisoning of only class members in dtor, as opposed to also poisoning fields inherited from base classes.
Verify emitted code for derived class with virtual destructor sanitizes its members only once.
Changed emission order for dtor callback, so only the last dtor for a class emits the sanitizing callback, while ensuring that class members are poisoned before base class destructors are invoked.
Skip poisoning of members, if class has no fields.
Removed patch file containing extraneous changes.

Summary: Poisoning applied to only class members, and before dtors for base class invoked

Reviewers: eugenis, kcc

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

llvm-svn: 244819

8 years agoRemoved xfail, since test is passing in line with expanded dtor sanitizing functionality
Naomi Musgrave [Wed, 12 Aug 2015 21:31:27 +0000 (21:31 +0000)]
Removed xfail, since test is passing in line with expanded dtor sanitizing functionality

Summary: Fixed test in response to buildbot failures from last night.

Reviewers: eugenis, kcc

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

llvm-svn: 244818

8 years agoMIR Parser: Allow the MI IR references to reference global values.
Alex Lorenz [Wed, 12 Aug 2015 21:27:16 +0000 (21:27 +0000)]
MIR Parser: Allow the MI IR references to reference global values.

This commit fixes a bug where MI parser couldn't resolve the named IR
references that referenced named global values.

llvm-svn: 244817

8 years agoMIR Serialization: Serialize the fixed stack pseudo source values.
Alex Lorenz [Wed, 12 Aug 2015 21:23:17 +0000 (21:23 +0000)]
MIR Serialization: Serialize the fixed stack pseudo source values.

llvm-svn: 244816

8 years agoNFC. Convert comments in MachineBasicBlock.cpp into new style.
Cong Hou [Wed, 12 Aug 2015 21:18:54 +0000 (21:18 +0000)]
NFC. Convert comments in MachineBasicBlock.cpp into new style.

llvm-svn: 244815

8 years agoMIR Parser: Move the parsing of fixed stack object indices into new method. NFC
Alex Lorenz [Wed, 12 Aug 2015 21:17:02 +0000 (21:17 +0000)]
MIR Parser: Move the parsing of fixed stack object indices into new method. NFC

This commit moves the code that parses the frame indices for the fixed stack
objects from the method 'parseFixedStackObjectOperand' to a new method named
'parseFixedStackFrameIndex', so that it can be reused when parsing fixed stack
pseudo source values.

llvm-svn: 244814

8 years agoMIR Serialization: Serialize the jump table pseudo source values.
Alex Lorenz [Wed, 12 Aug 2015 21:11:08 +0000 (21:11 +0000)]
MIR Serialization: Serialize the jump table pseudo source values.

llvm-svn: 244813

8 years agoMove the object being used to move-initialize when calling the base class' constructo...
Aaron Ballman [Wed, 12 Aug 2015 21:10:41 +0000 (21:10 +0000)]
Move the object being used to move-initialize when calling the base class' constructor from the ctor-initializer. This should have no effect given the triviality of the class, but it allows for easier maintenance should the semantics of the base class change. NFC intended.

llvm-svn: 244812

8 years agoFix two typos in documentation
Jonathan Peyton [Wed, 12 Aug 2015 21:05:22 +0000 (21:05 +0000)]
Fix two typos in documentation

llvm-svn: 244811

8 years agoMIR Serialization: Serialize the GOT pseudo source values.
Alex Lorenz [Wed, 12 Aug 2015 21:00:22 +0000 (21:00 +0000)]
MIR Serialization: Serialize the GOT pseudo source values.

llvm-svn: 244809

8 years ago[RewriteStatepointsForGC] Handle extractelement fully in the base pointer algorithm
Philip Reames [Wed, 12 Aug 2015 21:00:20 +0000 (21:00 +0000)]
[RewriteStatepointsForGC] Handle extractelement fully in the base pointer algorithm

When rewriting the IR such that base pointers are available for every live pointer, we potentially need to duplicate instructions to propagate the base. The original code had only handled PHI and Select under the belief those were the only instructions which would need duplicated. When I added support for vector instructions, I'd added a collection of hacks for ExtractElement which caught most of the common cases. Of course, I then found the one test case my hacks couldn't cover. :)

This change removes all of the early hacks for extract element. By defining extractelement as a BDV (rather than trying to look through it), we can extend the rewriting algorithm to duplicate the extract as needed.  Note that a couple of peephole optimizations were left in for the moment, because while we now handle extractelement as a first class citizen, we're not yet handling insertelement.  That change will follow in the near future.

llvm-svn: 244808

8 years agoOne line fix for hierarchical barrier
Jonathan Peyton [Wed, 12 Aug 2015 20:59:48 +0000 (20:59 +0000)]
One line fix for hierarchical barrier

There was a missing implicit task init for the ICV PUSH case in hierarchical barrier.

llvm-svn: 244807

8 years agoMIR Serialization: Serialize the stack pseudo source values.
Alex Lorenz [Wed, 12 Aug 2015 20:44:16 +0000 (20:44 +0000)]
MIR Serialization: Serialize the stack pseudo source values.

llvm-svn: 244806

8 years agofix typo; NFC
Sanjay Patel [Wed, 12 Aug 2015 20:36:18 +0000 (20:36 +0000)]
fix typo; NFC

llvm-svn: 244805

8 years agoUpdate a comment; Emscripten no longer uses le32 and le64. NFC.
Dan Gohman [Wed, 12 Aug 2015 20:34:40 +0000 (20:34 +0000)]
Update a comment; Emscripten no longer uses le32 and le64. NFC.

llvm-svn: 244804

8 years agoMIR Serialization: Serialize the constant pool pseudo source values.
Alex Lorenz [Wed, 12 Aug 2015 20:33:26 +0000 (20:33 +0000)]
MIR Serialization: Serialize the constant pool pseudo source values.

llvm-svn: 244803

8 years agoSwitching from an explicit loop to DeleteContainerSeconds; NFC.
Aaron Ballman [Wed, 12 Aug 2015 20:05:18 +0000 (20:05 +0000)]
Switching from an explicit loop to DeleteContainerSeconds; NFC.

llvm-svn: 244802

8 years agoFix process_events.py to auto continue the process if we attached so the process...
Greg Clayton [Wed, 12 Aug 2015 20:04:01 +0000 (20:04 +0000)]
Fix process_events.py to auto continue the process if we attached so the process doesn't just sit there suspended.

llvm-svn: 244801

8 years agoFix missing space in libfuzzer's help text.
Lenny Maiorani [Wed, 12 Aug 2015 20:00:10 +0000 (20:00 +0000)]
Fix missing space in libfuzzer's help text.

llvm-svn: 244800

8 years agoAdd recognition of the Intel 16.0 compiler in kmp_version.c
Jonathan Peyton [Wed, 12 Aug 2015 19:48:31 +0000 (19:48 +0000)]
Add recognition of the Intel 16.0 compiler in kmp_version.c

llvm-svn: 244799

8 years agoDocs: keep copyright years up-to-date
Hans Wennborg [Wed, 12 Aug 2015 19:45:01 +0000 (19:45 +0000)]
Docs: keep copyright years up-to-date

llvm-svn: 244797

8 years agoOptions.td: Drop trailing space in -fsanitize= help text
Hans Wennborg [Wed, 12 Aug 2015 19:35:05 +0000 (19:35 +0000)]
Options.td: Drop trailing space in -fsanitize= help text

llvm-svn: 244795

8 years agoDocs: update clang-cl command-line documentation
Hans Wennborg [Wed, 12 Aug 2015 19:35:01 +0000 (19:35 +0000)]
Docs: update clang-cl command-line documentation

llvm-svn: 244794

8 years ago[clang-tidy] Make FileOptionsProvider fields protected to make extending it easier
Alexander Kornienko [Wed, 12 Aug 2015 19:29:57 +0000 (19:29 +0000)]
[clang-tidy] Make FileOptionsProvider fields protected to make extending it easier

llvm-svn: 244793

8 years agoRangRangify some more for loops; NFC.
Aaron Ballman [Wed, 12 Aug 2015 19:00:39 +0000 (19:00 +0000)]
RangRangify some more for loops; NFC.

llvm-svn: 244792

8 years agoDon't compare getArchName() to "tce" as a string. NFC.
Douglas Katzman [Wed, 12 Aug 2015 18:36:12 +0000 (18:36 +0000)]
Don't compare getArchName() to "tce" as a string. NFC.

llvm-svn: 244791

8 years agoDocs: keep copyright years up-to-date.
Hans Wennborg [Wed, 12 Aug 2015 18:27:23 +0000 (18:27 +0000)]
Docs: keep copyright years up-to-date.

llvm-svn: 244789

8 years agoStop printing macro backtraces that don't help diagnostics.
Richard Trieu [Wed, 12 Aug 2015 18:24:59 +0000 (18:24 +0000)]
Stop printing macro backtraces that don't help diagnostics.

When displaying the macro backtrace, ignore some of the backtraces that do not
provide extra information to the diagnostic.  Typically, if the problem is
entirely contained within a macro argument, the macro expansion is often not
needed.  Also take into account SourceRange's attached to the diagnostic when
selecting which backtraces to ignore.  Two previous test cases have also been
updated.

Patch by Zhengkai Wu, with minor formatting fixes.

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

llvm-svn: 244788

8 years ago[PM/AA] Add missing static dependency edges from DSE and memdep to TLI.
Chandler Carruth [Wed, 12 Aug 2015 18:10:45 +0000 (18:10 +0000)]
[PM/AA] Add missing static dependency edges from DSE and memdep to TLI.

I forgot to add these in r244780 and r244778. Sorry about that.

Also order the static dependencies in a lexicographical order.

llvm-svn: 244787

8 years agoTry to fix the MSVC build now that we use /Zc:inline.
Rafael Espindola [Wed, 12 Aug 2015 18:09:44 +0000 (18:09 +0000)]
Try to fix the MSVC build now that we use /Zc:inline.

Thanks to Majnemer for the help.

llvm-svn: 244786

8 years ago[PM/AA] Explicitly depend on TLI rather than getting it out of the
Chandler Carruth [Wed, 12 Aug 2015 18:06:08 +0000 (18:06 +0000)]
[PM/AA] Explicitly depend on TLI rather than getting it out of the
AliasAnalysis.

Same as the other commits, the TLI access from an alias analysis is
going away and isn't very clean -- it is better to explicitly mark the
dependencies.

llvm-svn: 244785

8 years agoMake dosep.py PEP8 compliant. NFC.
Chaoren Lin [Wed, 12 Aug 2015 18:02:54 +0000 (18:02 +0000)]
Make dosep.py PEP8 compliant. NFC.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 244784

8 years agoRefactor dosep to use list comprehension. NFC.
Chaoren Lin [Wed, 12 Aug 2015 18:02:53 +0000 (18:02 +0000)]
Refactor dosep to use list comprehension. NFC.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 244783

8 years agoDon't print number of failures and percentage if no tests ran.
Chaoren Lin [Wed, 12 Aug 2015 18:02:51 +0000 (18:02 +0000)]
Don't print number of failures and percentage if no tests ran.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 244782

8 years agoMake dosep output status by overwriting the same line.
Chaoren Lin [Wed, 12 Aug 2015 18:02:49 +0000 (18:02 +0000)]
Make dosep output status by overwriting the same line.

Summary: Update to D11816.

Reviewers: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 244781

8 years ago[PM/AA] Stop getting the TargetLibraryInfo out of the AliasAnalysis and
Chandler Carruth [Wed, 12 Aug 2015 18:01:44 +0000 (18:01 +0000)]
[PM/AA] Stop getting the TargetLibraryInfo out of the AliasAnalysis and
just depend on it directly.

This was particularly frustrating because there was a really wide
mixture of using a member variable and re-extracting it from the AA that
happened to be around. I think the result is much more clear.

I've also deleted all of the pointless null checks and used references
across the APIs where I could to make it explicit that this cannot be
null in a useful fashion.

llvm-svn: 244780

8 years agoWebAssembly: floating-point comparisons
JF Bastien [Wed, 12 Aug 2015 17:53:29 +0000 (17:53 +0000)]
WebAssembly: floating-point comparisons

Summary:
D11924 implemented part of the floating-point comparisons, this patch implements the rest:
 * Tell ISelLowering that all booleans are either 0 or 1.
 * Expand the eq/ne/lt/le/gt/ge floating-point comparisons to the canonical ones (similar to what Mips32r6InstrInfo.td does).
 * Add tests for ord/uno.
 * Add tests for ueq/one/ult/ule/ugt/uge.
 * Fix existing comparison tests to remove the (res & 1) code, which setBooleanContents stops from generating.

Reviewers: sunfish

Subscribers: llvm-commits, jfb

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

llvm-svn: 244779