Commit Graph

358694 Commits

Author SHA1 Message Date
Alex Zinenko fbeceb9ced [mlir] Modernize LLVM dialect rountrip test
This test largely predates MLIR testing guidelines. Update it to match the
guidelines. In particular, avoid pattern-matching SSA value names, avoid
unnecessary CHECK-NEXT, relax assumptions about the form of SSA names.
Value-returning operations are still matched agaist _any_ name in order to
check that the operation indeed produces values.

Differential Revision: https://reviews.llvm.org/D82656
2020-06-29 09:47:36 +02:00
Kadir Cetinkaya 117b9230a7
[clangd][Hover] Dont crash on null types
Reviewers: hokein, sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82701
2020-06-29 09:10:03 +02:00
Nico Weber 8f73c4432b Revert "[clang-tidy] Reworked enum options handling(again)"
This reverts commit b9306fd042
and follow-up 42a51587c7.

It seems to build check-clang-tools on macOS, see comments on
https://reviews.llvm.org/D82188
2020-06-28 21:49:29 -04:00
Fady Ghanim 80e15b4574 [Clang][OpenMP][OMPBuilder] Moving OMP allocation and cache creation code to OMPBuilderCBHelpers
Summary:
Modified the OMPBuilderCBHelpers in the following ways:
- Moved location of class definition and deleted all constructors
- Moved OpenMP-specific address allocation of local variables
- Moved threadprivate variable creation for the current thread

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79676
2020-06-28 19:04:20 -04:00
Sergey Dmitriev 1becd298b8 [NFC] CallGraph related cleanup
Summary: Tidy up some CallGraph-related code in preparation for D82572.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82686
2020-06-28 15:27:39 -07:00
Nikita Popov a28d38a6bc [SimplifyCFG] Make test more robust (NFC)
Avoid changing this test if blocks get merged.
2020-06-28 20:51:03 +02:00
Nikita Popov d5a482acf9 [SimplifyCFG] Regenerate test checks (NFC) 2020-06-28 20:51:02 +02:00
Craig Topper 20a60f46f5 [X86] Explicitly add popcnt feature to Intel CPUs with SSE4.2 in the frontend.
Previously we inferred it if sse4.2 ended up being enabled after
all feature processing. But writing -march=nehalem -mno-sse4.2
should have popcnt enabled.
2020-06-28 11:06:40 -07:00
cgyurgyik b07feef873 [libc] This commit fixes the strcmp fuzzing test. It uses a single input and
splits it into two by using the value of the first byte to determine the
length of the first string. Reviewed-by: PaulkaToast, Differential
Revision: https://reviews.llvm.org/D82427

Summary:
[libc] Since only one input is given, it is necessary to split the string into two containers so that they can be compared for the purposes of this fuzz test. This is done in the following manner:

1. Take the value of the first byte; this is size1. (Credits to @PaulkaToast for this idea).
2. size2 is the value of size - size1.
3. Copy the characters to new containers, data1 and data2 with corresponding sizes.
4. Add a null terminator to the first container, and verify the second container has a null terminator.
5. Verify output of strcmp.

A simpler alternative considered was simply splitting the input data into two, but this means the two strings are always within +- 1 character of each other. This above implementation avoids this.

ninja check-libc was run; no issues.

Reviewers: PaulkaToast, sivachandra

Reviewed By: PaulkaToast

Subscribers: mgorny, tschuett, ecnelises, libc-commits, PaulkaToast

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D82427
2020-06-28 12:50:04 -05:00
Roman Lebedev 25521150d7
[NFC][ScalarEvolution] Add a test showing SCEV failure to recognize 'urem'
While InstCombine trivially converts that `srem` into a `urem`,
it might happen later than wanted. SCEV should recognize this natively.
2020-06-28 20:35:02 +03:00
Xun Li c8755b6378 [Coroutines] Optimize the lifespan of temporary co_await object
Summary:
If we ever assign co_await to a temporary variable, such as foo(co_await expr),
we generate AST that looks like this: MaterializedTemporaryExpr(CoawaitExpr(...)).
MaterializedTemporaryExpr would emit an intrinsics that marks the lifetime start of the
temporary storage. However such temporary storage will not be used until co_await is ready
to write the result. Marking the lifetime start way too early causes extra storage to be
put in the coroutine frame instead of the stack.
As you can see from https://godbolt.org/z/zVx_eB, the frame generated for get_big_object2 is 12K, which contains a big_object object unnecessarily.
After this patch, the frame size for get_big_object2 is now only 8K. There are still room for improvements, in particular, GCC has a 4K frame for this function. But that's a separate problem and not addressed in this patch.

The basic idea of this patch is during CoroSplit, look for every local variable in the coroutine created through AllocaInst, identify all the lifetime start/end markers and the use of the variables, and sink the lifetime.start maker to the places as close to the first-ever use as possible.

Reviewers: lewissbaker, modocache, junparser

Reviewed By: junparser

Subscribers: hiraditya, llvm-commits, rsmith, ChuanqiXu, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D82314
2020-06-28 10:18:15 -07:00
Sanjay Patel 931411136a [VectorCombine] add test for scalable vectors; NFC 2020-06-28 12:44:44 -04:00
Sanjay Patel 2f3549f813 Revert "[VectorCombine] add test for scalable vectors; NFC"
This reverts commit 700ec6b848.
An extra test diff snuck here.
2020-06-28 12:43:11 -04:00
Sanjay Patel 700ec6b848 [VectorCombine] add test for scalable vectors; NFC 2020-06-28 12:42:00 -04:00
Sanjay Patel af01642424 [x86] add tests for rsqrt opportunities; NFC 2020-06-28 12:42:00 -04:00
Esme-Yi 2b325f69ca [NFC][PowerPC] Add run lines to test DivRemPairsPass. 2020-06-28 16:26:05 +00:00
Nikita Popov 8758e14c6f [InstCombine] Add tests for assume implication (NFC) 2020-06-28 16:18:44 +02:00
Nathan James bfd99be0fc
[clang-tidy] Update lang restrictions on perf module 2020-06-28 15:18:08 +01:00
Nikita Popov 614b995cac [LVI] Refactor value from icmp cond handling (NFC)
Rewrite this in a way that is more amenable to extension.
2020-06-28 15:04:02 +02:00
Nikita Popov 70c5d95248 [CVP] Add tests for icmp or and/or edge conds (NFC) 2020-06-28 14:54:55 +02:00
Simon Pilgrim e07a982693 [X86] combineScalarToVector - handle (v2i64 scalar_to_vector(aextload)) as well as (v2i64 scalar_to_vector(aext))
We already fold (v2i64 scalar_to_vector(aext)) -> (v2i64 bitcast(v4i32 scalar_to_vector(x))), this adds support for similar aextload cases and also handles v2f64 cases that wrap the i64 extension behind bitcasts.

Fixes the remaining issue with PR39016
2020-06-28 13:00:32 +01:00
madhur13490 299dee91b3 Revert accidentally landed patch citing o build errors
Summary: This reverts commit c73966c2f7.

Reviewers:

Subscribers:
2020-06-28 11:52:33 +00:00
madhur13490 c73966c2f7 Improve stack object printing. NFC.
Reviewers: madhur13490

Reviewed By: madhur13490

Subscribers: qcolombet, arsenm, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82712
2020-06-28 11:43:33 +00:00
dfukalov c7bcd431d9 SpeculativeExecution: fix incorrect debug info move
Summary:
Debug info related instructions got zero cost so hoisted unconditionally

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=46267

Reviewers: arsenm, nhaehnle, chandlerc, aprantl

Reviewed By: aprantl

Subscribers: ormris, uabelho, wdng, aprantl, hiraditya, llvm-commits

Tags: #llvm, #debug-info

Differential Revision: https://reviews.llvm.org/D81730
2020-06-28 14:35:00 +03:00
Simon Pilgrim 9de26b5642 [X86] Rename dagcombine-cse.ll i386 test prefix X86 instead of X32. 2020-06-28 12:11:56 +01:00
Nathan James 42a51587c7
Fix build errors after b9306fd0 2020-06-28 11:02:19 +01:00
Nathan James b9306fd042
[clang-tidy] Reworked enum options handling(again)
Following on from D77085, I was never happy with the passing a mapping to the option get/store functions. This patch addresses this by using explicit specializations to handle the serializing and deserializing of enum options.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D82188
2020-06-28 10:18:33 +01:00
Nathan James abafb655c8
[clang][docs] Remove untracked files from formatted status
Currently on http://clang.llvm.org/docs/ClangFormattedStatus.html there are format stats on files no actually inside the tree but generated by build scripts. These are usually copied from somewhere else. Right now for example there are files from `llvm/utils/release/llvm-package...`. Adding these files bloats the list while not giving an accurate representation of how formatted the repo is.
This addresses this issue by checking the git index and ignoring any folder that doesn't contain tracked files.

I'm still unsure whether it would be better to just do away with the `os.walk` method and just check over every file returned from `git ls-index <project-root>`.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D82707
2020-06-28 09:49:39 +01:00
Chen Zheng ab4627364a [MachineLICM] testcase for hoisting rematerializable instruction, nfc 2020-06-28 03:16:57 -04:00
Brad Smith 66b7ba52b7 Add OpenBSD support to be able to retrieve the thread id 2020-06-27 21:14:44 -04:00
Mike Edwards 8cd117c24f [LIT] Correcting max-failures option in lit documentation. 2020-06-27 14:57:04 -07:00
Benjamin Kramer 85b53598a9 [RISCV] Silence unused variable warning in Release builds. NFC. 2020-06-27 23:24:28 +02:00
Nikita Popov 323cb26cef [ValueTracking] Use a switch statement (NFC) 2020-06-27 22:42:43 +02:00
Simon Pilgrim 393b4bd136 [X86] SimplifyDemandedVectorEltsForTargetNode - merge shuffle/pack lower demanded elements handling.
Generalize the vector operand extraction code for shuffle/pack ops - we can assume that the vector operands are the same width as the result, and any non-vector values can be reused directly in the smaller width op.
2020-06-27 19:10:13 +01:00
Hsiangkai Wang d698ff92a5 [RISCV] Support experimental v extensions.
This follows the design as discussed on the mailing lists in the
following RFC:
http://lists.llvm.org/pipermail/llvm-dev/2020-January/138364.html

Support for the vector 'v' extension v0.8.

Differential revision: https://reviews.llvm.org/D81188
2020-06-28 00:54:07 +08:00
Hsiangkai Wang 66da87dcba [RISCV] Assemble/Disassemble v-ext instructions.
Assemble/disassemble RISC-V V extension instructions according to
latest version spec in https://github.com/riscv/riscv-v-spec/.

I have tested this patch using GNU toolchain. The encoding is aligned
to GNU assembler output. In this patch, there is a test case for each
instruction at least.

The V register definition is just for assemble/disassemble. Its type
is not important in this stage. I think it will be reviewed and modified
as we want to do codegen for scalable vector types.

This patch does not include Zvamo, Zvlsseg, and Zvediv.

Differential revision: https://reviews.llvm.org/D69987
2020-06-28 00:54:07 +08:00
Roman Lebedev f0634100cd
[Analysis] isDereferenceableAndAlignedPointer(): don't crash on `bitcast <1 x ???*> to ???*` 2020-06-27 18:30:59 +03:00
Simon Pilgrim 74dc081ef2 Update polly tests to use -disable-basicaa to -disable-basic-aa
These were missed in rG4cd19a6e15120cb
2020-06-27 15:56:01 +01:00
Simon Pilgrim e855efe424 [X86][AVX] SimplifyDemandedVectorEltsForTargetNode - reduce width of X86ISD::VPERMIL2
If we don't need the elements of the upper lanes, reduce the width of the X86ISD::VPERMIL2 node.
2020-06-27 15:06:49 +01:00
Simon Pilgrim d56c6475a6 [X86][AVX] SimplifyDemandedVectorEltsForTargetNode - reduce width of X86ISD::VPERMILPV
If we don't need the elements of the upper lanes, reduce the width of the X86ISD::VPERMILPV node.
2020-06-27 14:43:03 +01:00
mydeveloperday a43b99a1e3 [clang-format] NFC 1% improvement in the overall clang-formatted status 2020-06-27 12:18:23 +01:00
lh123 43e3c39327 Revert "[Docs] Fix typo and test git commit access. NFC."
This reverts commit c19e82c6b3.
2020-06-27 18:58:03 +08:00
Simon Pilgrim 8b9e9753ea ThreadPool.h - remove unused BitVector.h include. NFC. 2020-06-27 11:37:46 +01:00
mydeveloperday eb50838ba0 [clang-format] [PR462254] fix indentation of default and break correctly in whitesmiths style
Summary:
https://bugs.llvm.org/show_bug.cgi?id=46254

Reviewed By: curdeius, jbcoe

Differential Revision: https://reviews.llvm.org/D8201
2020-06-27 11:35:22 +01:00
Simon Pilgrim 892df9e706 FileCollector.h - reduce Twine.h include to forward declaration. NFC. 2020-06-27 11:16:25 +01:00
Simon Pilgrim 6bdb3ce452 [DAG] reduceBuildVecExtToExtBuildVec - don't combine if it would break a splat.
reduceBuildVecExtToExtBuildVec was breaking a splat(zext(x)) pattern into buildvector(x, 0, x, 0, ..) resulting in much more complex insert+shuffle codegen.

We already go to some lengths to avoid this in SimplifyDemandedVectorElts etc. when we encounter splat buildvectors.

It should be OK to fold all splat(aext(x)) patterns - we might need to tighten this if we find a case where we mustn't introduce a buildvector(x, undef, x, undef, ..) but I can't find one.

Fixes PR46461.
2020-06-27 11:03:57 +01:00
Simon Pilgrim 878a24d369 [X86] Add PR46461 test case 2020-06-27 10:43:11 +01:00
Simon Pilgrim 5883f6f977 [X86] Add AVX tests buildvec-insertvec.ll 2020-06-27 10:43:11 +01:00
Simon Pilgrim b392fb3376 Fix unused type alias warning. NFC.
The "using InsertPointTy" line is an unnecessary copy + paste from other builder tests.
2020-06-27 10:43:10 +01:00
David Zarzycki dab859d1bf Reland: [clang driver] Move default module cache from system temporary directory
This fixes a unit test. Otherwise here is the original commit:

1) Shared writable directories like /tmp are a security problem.
2) Systems provide dedicated cache directories these days anyway.
3) This also refines LLVM's cache_directory() on Darwin platforms to use
   the Darwin per-user cache directory.

Reviewers: compnerd, aprantl, jakehehrlich, espindola, respindola, ilya-biryukov, pcc, sammccall

Reviewed By: compnerd, sammccall

Subscribers: hiraditya, llvm-commits, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D82362
2020-06-27 05:35:15 -04:00