Commit Graph

372237 Commits

Author SHA1 Message Date
Sanjay Patel 8ec7ea3ddc [CostModel] make default size cost for libcalls small (again)
This was changed recently with D90554 / f7eac51b9b
...because we had a regression testing blindspot for intrinsics
that are expected to be lowered to libcalls.

In general, we want the *size* cost for a scalar call to be cheap
even if the other costs are expensive - we expect it to just be
a branch with some optional stack manipulation.

It is likely that we will want to carve out some
exceptions/overrides to this rule as follow-up patches for
calls that have some general and/or target-specific difference
to the expected lowering.

This was noticed as a regression in unrolling, so we have a test
for that now along with a couple of direct cost model tests.

If the assumed scalarization costs for the oversized vector
calls are not realistic, that would be another follow-up
refinement of the cost models.
2020-11-14 08:15:35 -05:00
Sanjay Patel df09f82599 [CostModel] add tests for math library calls; NFC 2020-11-14 08:15:35 -05:00
Arnold Schwaighofer 8fb73cecfd [Coroutines] Make sure that async coroutine context size is a multiple of the alignment requirement
This simplifies the code the allocator has to executed

Differential Revision: https://reviews.llvm.org/D91471
2020-11-14 04:56:56 -08:00
mydeveloperday db6f7e0e9e [git-clang-format] Process CUDA header files
Clang supports compiling CUDA source files,
CUDA header files may contain CUDA specific code
that is why they have special extension, which
can be recognized by nvcc (CUDA compiler driver)
as CUDA source file.
Format them by default as well.

Reviewed By: MyDeveloperDay

Patch By: tomilov

Differential Revision: https://reviews.llvm.org/D90780
2020-11-14 12:39:16 +00:00
Paul C. Anagnostopoulos c044709b8f [TableGen] Clean up more .td files
Differential Revision: https://reviews.llvm.org/D91431
2020-11-14 07:32:25 -05:00
Roman Lebedev 6861d938e5
Revert "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM"
See discussion in https://bugs.llvm.org/show_bug.cgi?id=45073 / https://reviews.llvm.org/D66324#2334485
the implementation is known-broken for certain inputs,
the bugreport was up for a significant amount of timer,
and there has been no activity to address it.
Therefore, just completely rip out all of misexpect handling.

I suspect, fixing it requires redesigning the internals of MD_misexpect.
Should anyone commit to fixing the implementation problem,
starting from clean slate may be better anyways.

This reverts commit 7bdad08429,
and some of it's follow-ups, that don't stand on their own.
2020-11-14 13:12:38 +03:00
Vitaly Buka e51631ca4c [sanitizer] Fix Android API level parsing on arm 2020-11-14 01:54:45 -08:00
Fangrui Song bc7df035ae Make -fintegrated-cc1 work with cc1as
Tested 0.018s faster on my machine.
2020-11-14 01:16:16 -08:00
Vitaly Buka c8f4e06b29
[sanitizer] Fix test on arm 32bit
Make test values suitable for PC alignment arithmetic used
in StackTrace::Print().
2020-11-14 00:02:29 -08:00
Craig Topper 9d62ef6bc9 [RISCV] Add test cases for fsrw/fslw that don't sign extend the result. NFC
These currently fail to select fsrw/fslw.
2020-11-13 23:31:16 -08:00
Arthur Eubanks 325d95e72d [test] Fix const-addr-no-neg-offset.ll under NPM 2020-11-13 23:29:58 -08:00
Roland McGrath 6ef07111a4 [scudo/standalone] Fix leak in ThreadedGlobalQuarantine test
This unit test code was using malloc without a corresponding free.
When the system malloc is not being overridden by the code under
test, it might an asan/lsan allocator that notices leaks.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D91472
2020-11-13 22:24:44 -08:00
Zinovy Nis 4364539b3a [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups
Bug: https://bugs.llvm.org/show_bug.cgi?id=48008

Differential Revision: https://reviews.llvm.org/D91037
2020-11-14 08:35:21 +03:00
Mehdi Amini ac06b1af40 Revert "Switch libLLVMFrontendOpenACC to be a regular CMake library and not a "component""
This reverts commit e7ed276532.

Build is broken with  -DLLVM_LINK_LLVM_DYLIB=ON
2020-11-14 04:14:17 +00:00
Jonas Devlieghere 875be9f454 [lldb] Mark command-process-connect as unsupported on Windows
Windows doesn't support remote connections.
2020-11-13 20:02:05 -08:00
Aart Bik 9ddb464d37 [mlir] refactor common idiom into AffineMap method
motivated by a refactoring in the new sparse code (yet to be merged), this avoids some lengthy code dup

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D91465
2020-11-13 19:18:13 -08:00
Mehdi Amini e7ed276532 Switch libLLVMFrontendOpenACC to be a regular CMake library and not a "component"
This library is only used in Flang at the moment and not tested withing LLVM.
Having it as a component is breaking llvm-config:

  $ bin/llvm-config --shared-mode
  llvm-config: error: component libraries and shared library

  llvm-config: error: missing: [...]/lib/libLLVMFrontendOpenACC.a

This will reverted when unit-tests are provided for it.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D91470
2020-11-14 02:18:25 +00:00
Jonas Devlieghere 6c0cd5676e [lldb] Make `process connect` behave the same in sync and async mode.
I think the check for whether the process is connected is totally bogus
in the first place, but on the off-chance that's it's not, we should
behave the same in synchronous and asynchronous mode.
2020-11-13 17:39:30 -08:00
Mehdi Amini 2c196bbc6b Add an assertion in SmallVector::push_back()
This assertion ensures the input value isn't part of the vector when
growing is required. In such cases the vector will grow and the input
value is invalidated before being read from.

This found 14 failed Tests.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D84293
2020-11-14 00:55:34 +00:00
Mehdi Amini 42e88bd6b1 Replace sequences of v.push_back(v[i]); v.erase(&v[i]); with std::rotate (NFC)
The code has a few sequence that looked like:

    Ops.push_back(Ops[0]);
    Ops.erase(Ops.begin());

And are equivalent to:

    std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end());

The latter has the advantage of never reallocating the vector, which
would be a bug in the original code as push_back would read from the
memory it deallocated.
2020-11-14 00:55:33 +00:00
Sean Silva 703ef17e7a [mlir] Make linalg-bufferize run on FuncOp
That way, it runs in parallel across functions.
2020-11-13 15:43:24 -08:00
Peter Steinfeld 5795a81cba [flang] Fix "EQ" comparison of arrays
When comparing arrays whose shapes do not conform, the contant folding
code ran into problems trying to get the value of an extent that did not
exist.  There were actually two problems.  First, the routine
"CheckConformance()" was returning "true" when the compiler was unable
to get the extent of an array.  Second, the function
"ApplyElementwise()" was calling "CheckConformance()" prior to folding
the elements of two arrays, but it was ignoring the return value.

Differential Revision: https://reviews.llvm.org/D91440
2020-11-13 15:18:13 -08:00
Arthur Eubanks 52f05fb2c2 [MemProf][NewPM] Make memprof passes required
Just like other sanitizers.
Fixes check-memprof under NPM.

Reviewed By: leonardchan

Differential Revision: https://reviews.llvm.org/D91389
2020-11-13 15:15:27 -08:00
Stanislav Mekhanoshin c9821cec74 [AMDGPU] Mark sin/cos load folding as modifying the function.
When the load value is folded into the sin/cos operation, the
AMDGPU library calls simplifier could still mark the function
as unmodified. Instead ensure if there is an early return,
return whether the load was folded into the sin/cos call.

Authored by MJDSys

Differential Revision: https://reviews.llvm.org/D91401
2020-11-13 14:49:33 -08:00
Duncan P. N. Exon Smith cfde3edeae Frontend: Remove unused parameter from ASTUnit::LoadFromCompilerInvocationAction, NFC
Drop `IncludeBriefCommentsInCodeCompletion` since it is always `false`.

Differential Revision: https://reviews.llvm.org/D91295
2020-11-13 17:47:17 -05:00
Sam Clegg a083b28a31 [WebAssembly] Move GlobalTLSAddress handling to WebAssemblyISelLowering. NFC
I'm not why it was added to DAGToDAG oringally but it seems
to make sense alongside the non-TLS version:  LowerGlobalAddress

Differential Revision: https://reviews.llvm.org/D91432
2020-11-13 14:35:51 -08:00
Vladimir Vereschaka b09154ebf9 [CMake] Explicity set up RPATH for the runtime libs on Win to ARM Linux cross builds.
Since RPATH initialization was disabled for the runtime libraries to
avoid overwriting RPATH unconditionally we need to explicity set up it
for the Win to Arm Linux cross builds.

See some details here: https://reviews.llvm.org/D91099
2020-11-13 14:32:35 -08:00
Lang Hames f2980e8849 [ORC] Fix missing return value. 2020-11-14 09:31:20 +11:00
Sanjay Patel 618d555e8d [LoopUnroll] add test for full unroll that is sensitive to cost-model; NFC
See discussion in D90554.
2020-11-13 17:15:23 -05:00
Akira Hatanaka 2ed3a76745 [ObjC][ARC] Add and use a function which finds and returns the single
dependency. NFC

Use findSingleDependency in place of FindDependencies and stop passing a
set of Instructions around. Modify FindDependencies to return a boolean
flag which indicates whether the dependencies it has found are all
valid.
2020-11-13 14:02:58 -08:00
Akira Hatanaka 00d0974e62 Move variable declarations to functions in which they are used. NFC 2020-11-13 14:02:58 -08:00
Jessica Paquette d6a88e7e19 [GlobalISel] Add convenience matchers for nots and all-ones constants
Add a convenience matcher which handles

```
G_XOR %not_reg, -1
```

And a convenience matcher which returns true if an integer constant is
all-ones.

Differential Revision: https://reviews.llvm.org/D91459
2020-11-13 13:54:08 -08:00
Arthur Eubanks 6e098189db [DFSan][NewPM] Handle dfsan under NPM
Make it required. Since it's a module pass, optnone won't test it, so
extend the clang test to also use opt-bisect now that it's supported.

14/16 check-dfsan tests failed with NPM enabled, now all pass.

Reviewed By: leonardchan

Differential Revision: https://reviews.llvm.org/D91385
2020-11-13 13:41:38 -08:00
Nikita Popov 9a85643cd3 [KnownBits] Combine abs() implementations
ValueTracking was using a more powerful abs() implementation. Roll
it into KnownBits::abs(). Also add an exhaustive test for abs(),
in both the poisoning and non-poisoning variants.
2020-11-13 22:23:50 +01:00
Duncan P. N. Exon Smith a2f2c2f3a4 Serialization: Merge three diagnostics to simplify ASTReader::getInputFile, NFC
Clean up the logic for `err_fe_{pch,module,ast}_file_modified` to use a
`select` like other ASTReader diagnostics. There should be no
functionality change here, just a cleanup.

Differential Revision: https://reviews.llvm.org/D91367
2020-11-13 16:23:04 -05:00
Rahul Joshi d843755220 [NFC] Refactor function declaration addition in AsyncToLLVM
- Extract repeated code into helper function/lambdas.

Differential Revision: https://reviews.llvm.org/D91453
2020-11-13 12:53:19 -08:00
Craig Topper 835c462eae [RISCV] Add test case showing failure to use GREVIW for i32 bitreverse if result is not sign extended. NFC 2020-11-13 12:41:41 -08:00
Thomas Raoux 6ad31c0f4a [mlir][vector] Support N-D vector in InsertMap/ExtractMap op
Support multi-dimension vector for InsertMap/ExtractMap op and update the
transformations. Currently the relation between IDs and dimension is implicitly
deduced from the types. We can then calculate an AffineMap based on it. In the
future the AffineMap could be part of the operation itself.

Differential Revision: https://reviews.llvm.org/D90995
2020-11-13 12:40:17 -08:00
Nawrin Sultana 938f1b8581 [OpenMP] Add omp_calloc implementation
This patch adds omp_calloc implementation according to OpenMP 5.1
specification.

Differential Revision: https://reviews.llvm.org/D90967
2020-11-13 14:35:46 -06:00
MaheshRavishankar bf3861bf71 [mlir][Linalg] Change LinalgDependenceGraph to use LinalgOp.
Using LinalgOp will reduce the repeated conversion from Operation <->
LinalgOp.

Differential Revision: https://reviews.llvm.org/D91101
2020-11-13 12:34:38 -08:00
Matt Arsenault a8db144169 emacs: Add callbr to keyword list 2020-11-13 15:20:06 -05:00
Matt Arsenault b53025bb1d GlobalISel: Fix typos 2020-11-13 15:19:26 -05:00
Heejin Ahn 902ea588ea [WebAssembly] Rename atomic.notify and *.atomic.wait
- atomic.notify -> memory.atomic.notify
- i32.atomic.wait -> memory.atomic.wait32
- i64.atomic.wait -> memory.atomic.wait64

See https://github.com/WebAssembly/threads/pull/149.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D91447
2020-11-13 12:04:48 -08:00
Guozhi Wei a20220d25b [AlwaysInliner] Call mergeAttributesForInlining after inlining
Like inlineCallIfPossible and InlinerPass, after inlining mergeAttributesForInlining
should be called to merge callee's attributes to caller. But it is not called in
AlwaysInliner, causes caller's attributes inconsistent with inlined code.

Attached test case demonstrates that attribute "min-legal-vector-width"="512" is
not merged into caller without this patch, and it causes failure in SelectionDAG
when lowering the inlined AVX512 intrinsic.

Differential Revision: https://reviews.llvm.org/D91446
2020-11-13 12:01:35 -08:00
Craig Topper bafa934fe5 [RISCV] Add test case for failure to use GREVIW for i32 bswap if result is not sign extended. NFC 2020-11-13 11:59:12 -08:00
Heejin Ahn 01d8715369 [WebAssembly] Remove a temporarily added RUN line
This RUN line was added as a temporary measure to undo the damage done
by D79655. Everyone's build system should be fine by now.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D91448
2020-11-13 11:57:09 -08:00
Jianzhou Zhao 06c9b4aaa9 Extend the dfsan store/load callback with write/read address
This helped debugging.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D91236
2020-11-13 19:46:32 +00:00
Jim Ingham 5a4b2e1541 The AssertRecognizer used the module from a frames SC without checking it was non-null.
I only have a crash report for this.  I could reproduce it with a slightly older
lldb by running an expression that called pthread_kill, but we started making modules
for our expression JIT code, so that no longer triggers the bug.  I can't think of another
good way to test it but the fix is obvious.
2020-11-13 11:41:32 -08:00
Duncan P. N. Exon Smith b764a62f02 Serialization: Rename three AST diagnostics, NFC
All three diagnostics have a select between "PCH", "module", and "AST"
in the text. The most generic of these is "AST", so rename them from
`err_module_...` to `err_ast_...`.

Differential Revision: https://reviews.llvm.org/D91436
2020-11-13 14:09:00 -05:00
Craig Topper 67fa016ac1 [RISCV] Add RORW/ROLW/RORIW/ROLIW test cases that don't sign extend the result. NFC
This shows that we currently fail to select RORIW/ROLIW.
2020-11-13 10:59:32 -08:00