Commit Graph

268357 Commits

Author SHA1 Message Date
Stephan T. Lavavej 05f99df8e2 [libcxx] [test] In func.wrap.func.con/alloc_F.pass.cpp, fix REQUIRES whitespace. NFC.
llvm-svn: 309466
2017-07-29 00:55:25 +00:00
Stephan T. Lavavej d29b12ef7c [libcxx] [test] Make files consistently end with newlines, NFC.
llvm-svn: 309465
2017-07-29 00:55:22 +00:00
Stephan T. Lavavej 4159db7698 [libcxx] [test] Untabify, NFC.
llvm-svn: 309464
2017-07-29 00:55:10 +00:00
Stephan T. Lavavej 8980b8ad9c [libcxx] [test] Strip trailing whitespace, NFC.
llvm-svn: 309463
2017-07-29 00:54:49 +00:00
Alexander Shaposhnikov e574034f28 [llvm] Update MachOObjectFile::exports interface
This diff removes the second argument of the method MachOObjectFile::exports.
In all in-tree uses this argument is equal to "this" and 
without this argument the interface seems to be cleaner.

Test plan: make check-all

llvm-svn: 309462
2017-07-29 00:30:45 +00:00
Vedant Kumar 4fb45077c4 [ubsan] Diagnose invalid uses of builtins (compiler-rt)
Differential Revision: https://reviews.llvm.org/D34591

llvm-svn: 309461
2017-07-29 00:20:02 +00:00
Vedant Kumar 6dc0f5b947 [test] FileCheck-ify a test to avoid a spurious failure, NFC
The path to one of my source trees contains 'builtin' as a substring, so
this test failed. Fix it with FileCheck.

llvm-svn: 309460
2017-07-29 00:19:52 +00:00
Vedant Kumar 10c3102071 [ubsan] Diagnose invalid uses of builtins (clang)
On some targets, passing zero to the clz() or ctz() builtins has undefined
behavior. I ran into this issue while debugging UB in __hash_table from libcxx:
the bug I was seeing manifested itself differently under -O0 vs -Os, due to a
UB call to clz() (see: libcxx/r304617).

This patch introduces a check which can detect UB calls to builtins.

llvm.org/PR26979

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

llvm-svn: 309459
2017-07-29 00:19:51 +00:00
Michael Kruse 4335c3992a [test] Add test case for -polly-simplify. NFC.
llvm-svn: 309458
2017-07-29 00:06:06 +00:00
Eli Friedman b6fc8dc5e5 Fix update_llc_test_checks.py ARM parsing
When I tried running the script, the ARM regex parser could not parse
my code. It failed because the .Lfunc_end line has a comment at the
end of it, so this commit removes the newline at the end of the regex.

Patch by Joel Galenson!

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

llvm-svn: 309457
2017-07-28 23:58:24 +00:00
Tobias Edler von Koch 819d84032e [LTO] llvm-lto2: Add option to load sample profile
Summary:
This exposes LTO's Conf.SampleProfile as a command line option
(-lto-sample-profile-file) for testing via the llvm-lto2 utility.

Reviewers: pcc, danielcdh

Subscribers: mehdi_amini, inglorion, llvm-commits

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

llvm-svn: 309456
2017-07-28 23:43:22 +00:00
Adrian Prantl 359846fe1c Remove the unused offset field from LiveDebugValues (NFC)
Followup to r309426.
rdar://problem/33580047

llvm-svn: 309455
2017-07-28 23:25:51 +00:00
Michael Kruse 8e41d2baab [Simplify] Do not remove dependencies of phis within region stmts.
These were wrongly assumed to be phi nodes that require
MemoryKind::PHI accesses.

llvm-svn: 309454
2017-07-28 23:22:32 +00:00
Michael Kruse fd7f40961b [VirtualInstruction] Do not iterate over a region statement's instruction list. NFC.
It should be empty anyways. In this case it would even be redundant
because we just all all instructions in region statements.

llvm-svn: 309453
2017-07-28 23:22:23 +00:00
Adrian Prantl b2811e50f9 Remove the unused offset field from LiveDebugVariables (NFC)
Followup to r309426.
rdar://problem/33580047

llvm-svn: 309451
2017-07-28 23:06:50 +00:00
Adrian Prantl 8b9bb534a1 Remove the unused offset from DBG_VALUE (NFC)
Followup to r309426.
rdar://problem/33580047

llvm-svn: 309450
2017-07-28 23:00:45 +00:00
Adrian Prantl d92ac5a259 Remove the unused DBG_VALUE offset parameter from GlobalISel (NFC)
Followup to r309426.
rdar://problem/33580047

llvm-svn: 309449
2017-07-28 22:46:20 +00:00
Adrian Prantl eb5d69ba81 Update the Go bindings for r309426 (remove offset from llvm.dbg.value)
llvm-svn: 309448
2017-07-28 22:44:44 +00:00
Farhana Aleen 7ccc9fd0e2 Added tests for i8 interleaved-load-pattern of stride=4, VF=(8, 16, 32).
llvm-svn: 309447
2017-07-28 22:43:34 +00:00
Adrian Prantl 1b63dc54b0 Remove the unused DBG_VALUE offset parameter from RegAllocFast (NFC)
Followup to r309426.
rdar://problem/33580047

llvm-svn: 309446
2017-07-28 22:36:55 +00:00
Sumanth Gundapaneni 6af104e418 Add documentation for the attribute "no-jump-tables"
llvm-svn: 309445
2017-07-28 22:26:22 +00:00
Sumanth Gundapaneni 8d50a50e98 [SimplifyCFG] Make the no-jump-tables attribute also disable switch lookup tables
Differential Revision: https://reviews.llvm.org/D35579

llvm-svn: 309444
2017-07-28 22:25:40 +00:00
Kostya Serebryany f14996b962 [libFuzzer] improve support for inline-8bit-counters (make it more correct and faster)
llvm-svn: 309443
2017-07-28 22:00:56 +00:00
Krzysztof Parzyszek cfd8806b2b [Hexagon] Formatting changes, NFC
llvm-svn: 309442
2017-07-28 21:52:21 +00:00
Easwaran Raman 51b809bf2f [Inliner] Do not apply any bonus for cold callsites.
Summary:
Inlining threshold is increased by application of bonuses when the
callee has a single reachable basic block or is rich in vector
instructions. Similarly, inlining cost is reduced by applying a large
bonus when the last call to a static function is considered for
inlining. This patch disables the application of these bonuses when the
callsite or the callee is cold. The intention here is to prevent a large
cold callsite from being inlined to a non-cold caller that could prevent
the caller from being inlined. This is especially important when the
cold callsite is a last call to a static since the associated bonus is
very high.

Reviewers: chandlerc, davidxl

Subscribers: danielcdh, llvm-commits

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

llvm-svn: 309441
2017-07-28 21:47:36 +00:00
Reid Kleckner 3bcad2b2e6 Try to fix asan test on sanitizer-windows
llvm-svn: 309440
2017-07-28 21:43:23 +00:00
Adrian Prantl a617576bb1 Remove the unused dbg.value offset from SelectionDAG (NFC)
Followup to r309426.
rdar://problem/33580047

llvm-svn: 309436
2017-07-28 21:27:35 +00:00
Reid Kleckner 67de34897c [lit] Use a %{python} substitution to avoid relying on python being on PATH
llvm-svn: 309434
2017-07-28 21:13:47 +00:00
Adrian Prantl 99c4a5fb8e Remove offset parameter from llvm.dbg.value intrinsics in testcase
llvm-svn: 309433
2017-07-28 21:08:53 +00:00
Reid Kleckner 7895d2fcab [lit] Remove stale test inputs before running check-lit
This should fix googletest-format test failures on the clang modules
buildbots, which have a stale copy of the OneTest script in the build
directory.

llvm-svn: 309432
2017-07-28 21:00:57 +00:00
Adrian Prantl 1b842dad3e Reword sentence in LangRef
llvm-svn: 309431
2017-07-28 20:44:29 +00:00
Krzysztof Parzyszek 48a34c684b [compiler-rt] Add missing quotation marks to msan_compile invocation
llvm-svn: 309430
2017-07-28 20:29:29 +00:00
Chris Bieneman 20f45a3e73 [CMake] Add SharingPtr.h to the Framework header list
lldb-forward.h which is a public header uses SharingPtr, so we need to include that header as well.

llvm-svn: 309429
2017-07-28 20:27:38 +00:00
Chris Bieneman 6678e39aa4 [CMake] debugserver-nonui doesn't go in the framework
Small change to correct the install path of the nonui debugserver.

llvm-svn: 309428
2017-07-28 20:27:37 +00:00
Adrian Prantl 1fa1885acd Adopt to LLVM API change (llvm.dbg.value no longer has an offset)
llvm-svn: 309427
2017-07-28 20:21:08 +00:00
Adrian Prantl abe04759a6 Remove the obsolete offset parameter from @llvm.dbg.value
There is no situation where this rarely-used argument cannot be
substituted with a DIExpression and removing it allows us to simplify
the DWARF backend. Note that this patch does not yet remove any of
the newly dead code.

rdar://problem/33580047
Differential Revision: https://reviews.llvm.org/D35951

llvm-svn: 309426
2017-07-28 20:21:02 +00:00
Alexey Bataev e109655c90 [SLP] Allow vectorization of the instruction from the same basic blocks only, NFC.
Summary:
After some changes in SLP vectorizer we missed some additional checks to
limit the instructions for vectorization. We should not perform analysis
of the instructions if the parent of instruction is not the same as the
parent of the first instruction in the tree or it was analyzed already.

Subscribers: mzolotukhin

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

llvm-svn: 309425
2017-07-28 20:11:16 +00:00
Matt Morehouse 74ddba0c95 Add end-to-end tests for overflows of byval arguments.
Summary:
Included is one test for passing structs by value and one test for
passing C++
objects by value.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 309424
2017-07-28 19:52:31 +00:00
Sterling Augustine dd9173420f Add clear_cache implementation for ppc64. Fix buffer to meet ppc64 alignment.
llvm-svn: 309423
2017-07-28 19:49:22 +00:00
Reid Kleckner 9be82c3169 Fix conditional tail call branch folding when both edges are the same
The conditional tail call logic did the wrong thing when both
destinations of a conditional branch were the same:

BB#1: derived from LLVM BB %entry
    Live Ins: %EFLAGS
    Predecessors according to CFG: BB#0
        JE_1 <BB#5>, %EFLAGS<imp-use,kill>
        JMP_1 <BB#5>

BB#5: derived from LLVM BB %sw.epilog
    Predecessors according to CFG: BB#1
        TCRETURNdi64 <ga:@mergeable_conditional_tailcall>, 0, ...

We would fold the JE_1 to a TCRETURNdi64cc, and then remove our BB#5
successor. Then BB#5 would be deleted as it had no predecessors, leaving
a dangling "JMP_1 <BB#5>" reference behind to cause assertions later.

This patch checks that both conditional branch destinations are
different before doing the transform. The standard branch folding logic
is able to remove both the JMP_1 and the JE_1, and for my test case we
end up forming a better conditional tail call later.

Fixes PR33980

llvm-svn: 309422
2017-07-28 19:48:40 +00:00
Michael Kruse 0137d80ad4 [VirtualInstruction] Remove assertion. NFC.
ScopStmt::contains is currently implemented on the basis of BasicBlock
and does not take the instruction list into account. Therefore any
instruction copied by -polly-optree into another statement currently
triggers that assertion.

Remove that assertion for now. We might re-enable it when the
implementation of ScopStmt::contains changes.

llvm-svn: 309421
2017-07-28 19:26:24 +00:00
Matt Morehouse 6848e05d8b Revert r308677.
Incorrect directories were created by the patch.

llvm-svn: 309420
2017-07-28 19:11:16 +00:00
Matt Arsenault da9ab148f3 AMDGPU: Look through a bitcast user of an out argument
This allows handling of a lot more of the interesting
cases in Blender. Most of the large functions unlikely
to be inlined have this pattern.

This is a special case for what clang emits for OpenCL 3
element vectors. Annoyingly, these are emitted as
<3 x elt>* pointers, but accessed as <4 x elt>* operations.
This also needs to handle cases where a struct containing
a single vector is used.

llvm-svn: 309419
2017-07-28 19:06:16 +00:00
Jonathan Peyton 644f4e3d11 Fix comments and build messages concerning TSX
llvm-svn: 309418
2017-07-28 19:05:17 +00:00
Chad Rosier 2f49803c1f [Value Tracking] Refactor icmp comparison logic into helper. NFC.
llvm-svn: 309417
2017-07-28 18:47:43 +00:00
Matt Arsenault c06574ffc0 AMDGPU: Add pass to replace out arguments
It is better to return arguments directly in registers
if we are making a call rather than introducing expensive
stack usage. In one of sample compile from one of
Blender's many kernel variants, this fires on about
~20 different functions. Future improvements may be to
recognize simple cases where the pointer is indexing a small
array. This also fails when the store to the out argument
is in a separate block from the return, which happens in
a few of the Blender functions. This should also probably
be using MemorySSA which might help with that.

I'm not sure this is correct as a FunctionPass, but
MemoryDependenceAnalysis seems to not work with
a ModulePass.

I'm also not sure where it should run.I think it should
run  before DeadArgumentElimination, so maybe either
EP_CGSCCOptimizerLate or EP_ScalarOptimizerLate.

llvm-svn: 309416
2017-07-28 18:40:05 +00:00
Hiroshi Yamauchi 1b179bc5ff [LVI] Constant-propagate a zero extension of the switch condition value through case edges
Summary:
LazyValueInfo currently computes the constant value of the switch condition through case edges, which allows the constant value to be propagated through the case edges.

But we have seen a case where a zero-extended value of the switch condition is used past case edges for which the constant propagation doesn't occur.

This patch adds a small logic to handle such a case in getEdgeValueLocal().

This is motivated by the Python 2.7 eval loop in PyEval_EvalFrameEx() where the lack of the constant propagation causes longer live ranges and more spill code than necessary.

With this patch, we see that the code size of PyEval_EvalFrameEx() decreases by ~5.4% and a performance test improves by ~4.6%.




Reviewers: wmi, dberlin, sanjoy

Reviewed By: sanjoy

Subscribers: davide, davidxl, llvm-commits

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

llvm-svn: 309415
2017-07-28 18:35:25 +00:00
Leo Li 42698d09b8 [CMake] Add Android toolchain CMake cache files.
Summary: Thoes files are used to build Android toolchain. D32816 makes it possible to build runtimes for targets.

Reviewers: beanz, srhines

Reviewed By: srhines

Subscribers: pirama, jroelofs, srhines, cfe-commits, mgorny

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

llvm-svn: 309407
2017-07-28 17:40:28 +00:00
George Karpenkov a6f43a68d3 [sanitizers test CMake] further refactor testing CMake for tsan
TSan tests on Darwin first link all libraries into a static archive file.
With this change, the linking is done once per all architecture,
and previously the linking step was repeated per each architecture per
each add_tsan_test call.
Furthermore, the code is cleared up.

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

llvm-svn: 309406
2017-07-28 17:38:44 +00:00
George Karpenkov 831875b4bf [sanitizer tests CMake] Factor out CMake logic for compiling sanitizer tests
Currently there's a large amount of CMake logic duplication for
compiling sanitizer tests.
If we add more sanitizers, the duplication will get even worse.

This change factors out common compilation commands into a macro
available to all sanitizers.

llvm-svn: 309405
2017-07-28 17:32:37 +00:00