David Tenty [Tue, 11 Aug 2020 14:27:41 +0000 (10:27 -0400)]
[AIX] Try to not use LLVM tools while building runtimes
Since 64-bit XCOFF and the big AR format is not yet supported in some of these tools, this patch avoids additional setup of these tools. This patch is not intended to prevent picking up the LLVM tools if they happen to be available otherwise.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D85329
Florian Hahn [Thu, 24 Sep 2020 20:38:08 +0000 (21:38 +0100)]
[SCEV] Swap operands if LHS is not unknown.
Currently we only use information from guards for unknown expressions.
Swap LHS/RHS and predicate, if LHS is not unknown.
Stefan Pintilie [Fri, 25 Sep 2020 14:47:08 +0000 (09:47 -0500)]
[PowerPC][NFC] Merged two switch entries.
Two switch entries did exactly the same thing. This patch merges them.
Simon Pilgrim [Fri, 25 Sep 2020 14:45:53 +0000 (15:45 +0100)]
[InstCombine] Add some extra bswap tests from PR39793
Also test for cases where recognizeBSwapOrBitReverseIdiom checks for a truncated bswap pattern.
Aaron Ballman [Fri, 25 Sep 2020 14:36:45 +0000 (10:36 -0400)]
Fix some of the more egregious 80-col and whitespace issues; NFC
Simon Pilgrim [Fri, 25 Sep 2020 14:28:01 +0000 (15:28 +0100)]
[InstCombine] Add 'partial' bswap tests from PR39793
Tests for basic zext(bswap(trunc(x))) patterns shown on PR39793
Aaron Ballman [Fri, 25 Sep 2020 14:25:17 +0000 (10:25 -0400)]
Typo fix; NFC
Florian Hahn [Thu, 24 Sep 2020 17:01:55 +0000 (18:01 +0100)]
[SCEV] Extract code to collect conditions to lambda (NFC).
This makes re-using the common functionality easier in follow-up
patches.
Louis Dionne [Wed, 23 Sep 2020 13:20:03 +0000 (09:20 -0400)]
[libc++] Initial support for pre-commit CI with Buildkite
This commit adds basic files and scripts that are used for the Buildkite
pre-commit CI setup. This was tested to mostly work on a fork of llvm-project,
however some adjustments will have to be made as we complete the real
setup.
Florian Hahn [Fri, 25 Sep 2020 12:53:58 +0000 (13:53 +0100)]
[SCEV] Add more tests using info from loop guards for BTC.
LLVM GN Syncbot [Fri, 25 Sep 2020 12:13:19 +0000 (12:13 +0000)]
[gn build] Port
e336b74c995
Benjamin Kramer [Fri, 25 Sep 2020 12:08:45 +0000 (14:08 +0200)]
[Analyzer] Fix unused variable warning in Release builds
clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:377:19: warning: unused variable 'Init'
Manuel Klimek [Tue, 7 Jul 2020 10:17:14 +0000 (12:17 +0200)]
[clang-format] Add a MacroExpander.
Summary:
The MacroExpander allows to expand simple (non-resursive) macro
definitions from a macro identifier token and macro arguments. It
annotates the tokens with a newly introduced MacroContext that keeps
track of the role a token played in expanding the macro in order to
be able to reconstruct the macro expansion from an expanded (formatted)
token stream.
Made Token explicitly copy-able to enable copying tokens from the parsed
macro definition.
Reviewers: sammccall
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83296
Aart Bik [Fri, 25 Sep 2020 10:32:05 +0000 (03:32 -0700)]
[mlir] [VectorOps] generalize printing support for integers
This generalizes printing beyond just i1,i32,i64 and also accounts
for signed and unsigned interpretation in the output.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D88290
Chris Bowler [Fri, 25 Sep 2020 11:36:49 +0000 (07:36 -0400)]
[PPC] [AIX] Implement calling convention IR for C99 complex types on AIX
Add AIX calling convention logic to Clang for C99 complex types on AIX
Differential Revision: https://reviews.llvm.org/D88130
Simon Pilgrim [Fri, 25 Sep 2020 11:32:08 +0000 (12:32 +0100)]
[InstCombine] Add bswap tests from funnel shift intrinsics
Based on (WIP) patch in D87452 - I'm intending to add the intrinsics handling to collectBitParts as a separate patch to make the changes clearer.
Stefan Pintilie [Tue, 22 Sep 2020 23:44:54 +0000 (18:44 -0500)]
[PowerPC][LLD] Extend R2 save stub to support offsets of more than 26 bits
The R2 save stub will now support offsets up to 64 bits.
There are three cases that will be used.
1) The offset fits in 26 bits.
```
b <26 bit offset>
```
2) The offset does not fit in 26 bits but fits in 34 bits.
```
paddi r12, 0, <34 bit offset>, 1
mtctr r12
bctr
```
3) The offset does not fit in 34 bits. Since this is an R2 save stub we can use
the TOC in R2. We are not loading the offset but the actual address we want to
branch to.
```
addis r12, r2, <address in TOC lo>
ld r12 <address in TOC hi>(r12)
mtctr r12
bctr
```
In case 1) the stub is only 8 bytes while in cases 2) and 3) the stub will be
20 bytes.
Reviewed By: MaskRay, sfertile, NeHuang
Differential Revision: https://reviews.llvm.org/D87916
Whisperity [Fri, 25 Sep 2020 11:32:56 +0000 (13:32 +0200)]
[CMake][CTE] Add "check-clang-extra-..." targets to test only a particular Clang extra tool
Create targets `check-clang-extra-clang-tidy`, `check-clang-extra-clang-query`
similar to how `check-clang-sema`, `check-clang-parser`, etc. are
auto-generated from the directory structure.
This allows running only a particular sub-tool's tests, not having to wait
through the entire `check-clang-tools` execution.
Differential Revision: http://reviews.llvm.org/D84176
Adam Balogh [Wed, 5 Aug 2020 19:38:15 +0000 (21:38 +0200)]
[Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers
For /C++/ constructor initializers `ExprEngine:computeUnderConstruction()`
asserts that they are all member initializers. This is not neccessarily
true when this function is used to get the return value for the
construction context thus attempts to fetch return values of base and
delegating constructor initializers result in assertions. This small
patch fixes this issue.
Differential Revision: https://reviews.llvm.org/D85351
Momchil Velikov [Fri, 25 Sep 2020 10:45:22 +0000 (11:45 +0100)]
[AArch64] PAC/BTI code generation for LLVM generated functions
PAC/BTI-related codegen in the AArch64 backend is controlled by a set
of LLVM IR function attributes, added to the function by Clang, based
on command-line options and GCC-style function attributes. However,
functions, generated in the LLVM middle end (for example,
asan.module.ctor or __llvm_gcov_write_out) do not get any attributes
and the backend incorrectly does not do any PAC/BTI code generation.
This patch record the default state of PAC/BTI codegen in a set of
LLVM IR module-level attributes, based on command-line options:
* "sign-return-address", with non-zero value means generate code to
sign return addresses (PAC-RET), zero value means disable PAC-RET.
* "sign-return-address-all", with non-zero value means enable PAC-RET
for all functions, zero value means enable PAC-RET only for
functions, which spill LR.
* "sign-return-address-with-bkey", with non-zero value means use B-key
for signing, zero value mean use A-key.
This set of attributes are always added for AArch64 targets (as
opposed, for example, to interpreting a missing attribute as having a
value 0) in order to be able to check for conflicts when combining
module attributed during LTO.
Module-level attributes are overridden by function level attributes.
All the decision making about whether to not to generate PAC and/or
BTI code is factored out into AArch64FunctionInfo, there shouldn't be
any places left, other than AArch64FunctionInfo, which directly
examine PAC/BTI attributes, except AArch64AsmPrinter.cpp, which
is/will-be handled by a separate patch.
Differential Revision: https://reviews.llvm.org/D85649
Jay Foad [Fri, 25 Sep 2020 10:38:17 +0000 (11:38 +0100)]
[AMDGPU] Fix declaration parameter names to match definition
This fixes the declaration of AMDGPULegalizerInfo::legalizeBufferLoad to
match the definition. It is still confusing that that parameter order is
different from legalizeBufferStore.
https://bugs.llvm.org/show_bug.cgi?id=47535
Jay Foad [Mon, 21 Sep 2020 11:32:13 +0000 (12:32 +0100)]
[SplitKit] In
addDeadDef tolerate parent range that defines more lanes
Following on from D87757 "[SplitKit] Only copy live lanes", in
SplitEditor::
addDeadDef, when we're checking whether the parent live
interval has a subrange defining the same lanes, tolerate the case
where the parent subrange defines a superset of the lanes. This can
happen when the child subrange comes from SplitEditor::buildCopy
decomposing a partial copy into a sequence of subreg copies that cover
the required lanes.
Differential Revision: https://reviews.llvm.org/D88020
Simon Pilgrim [Fri, 25 Sep 2020 10:31:14 +0000 (11:31 +0100)]
Revert rGe55410f8b260 : "AArch64/GlobalISel: Add testcase for bug 47619"
This reverts commit
e55410f8b260a2868d600ca99fe5ee80f9cd4fc5.
This is failing on EXPENSIVE_CHECKS buildbots
Vitaly Buka [Fri, 25 Sep 2020 09:20:33 +0000 (02:20 -0700)]
[msan] Remove redundant test
The test needs to control intercept_strcmp option.
It's already implemented as lit.test strcmp.c.
Vitaly Buka [Fri, 25 Sep 2020 08:28:23 +0000 (01:28 -0700)]
[msan] Fix gethostent tests
gethostent should follow sethostent.
Georgii Rymar [Thu, 24 Sep 2020 14:39:11 +0000 (17:39 +0300)]
[Object/yaml2obj/obj2yaml][test] - Split, cleanup and move MIPS abi-flags.yaml test. NFCI.
We have the `Object/Mips/abi-flags.yaml` which tests how yaml2obj/obj2yaml
handle `SHT_MIPS_ABIFLAGS` sections.
This patch splits it into two tests: one for obj2yaml and one for yaml2obj
and moves the result to right places.
Differential revision: https://reviews.llvm.org/D88231
Amara Emerson [Fri, 25 Sep 2020 08:28:50 +0000 (01:28 -0700)]
[AArch64][GlobalISel] Manually select G_DUP with s8/s16 gpr scalar operands.
These don't get selected by the imported patterns, and avoiding generating them
is a whole load of not-worth-it-hassle (until we have fp types in GlobalISel).
Amara Emerson [Thu, 24 Sep 2020 20:06:03 +0000 (13:06 -0700)]
[AArch64][GlobalISel] Make <8 x s16> for G_INSERT_VECTOR_ELT legal.
Andrzej Warzynski [Fri, 25 Sep 2020 08:52:49 +0000 (09:52 +0100)]
[flang][driver] Add missing dependency (shared library builds, NFC)
`FlangFrontendTests` depends on libclangFrontend (it uses
DiagnosticConsumer classes from there). This patch adds the missing
dependency in CMake.
The missing dependency manifests itself only with BUILD_SHARED_LIBS=ON.
This symbol is linked in statically with libflangFrontend when
BUILD_SHARED_LIBS=OFF.
Sam Parker [Tue, 22 Sep 2020 09:43:18 +0000 (10:43 +0100)]
[ARM] Find VPT implicitly predicated by VCTP
On failing to find a VCTP in the list of instructions that explicitly
predicate the entry of a VPT block, inspect whether the block is
controlled via VPT which is implicitly predicated due to it's
predicated operand(s).
Differential Revision: https://reviews.llvm.org/D87819
Artur Bialas [Fri, 25 Sep 2020 07:21:16 +0000 (09:21 +0200)]
[mlir][SCFToGPU] LaunchOp propagate optional attributes
Allow propagating optional user defined attributes during SCF to GPU conversion. Gives opportunity to use user defined attributes in the further lowering. For example setting subgroup size, or other options for GPU dispatch. This does not break backward compatibility and does not require new attributes, just allow passing optional ones.
Differential Revision: https://reviews.llvm.org/D88203
Anthony Steinhauser [Fri, 25 Sep 2020 05:03:52 +0000 (22:03 -0700)]
[libc] Using llvm_libc memcpy in mem* benchmarks.
Currently the mem* benchmarks use memcpy from Glibc and memset from LLVM libc.
That's misleading and produces inconsistent results and behaviors.
This change makes Memcpy.cpp consistent with Memset.cpp:
https://github.com/llvm/llvm-project/blob/master/libc/benchmarks/Memset.cpp#L49
Reviewers: sivachandra
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D88271
Ian Levesque [Fri, 25 Sep 2020 04:20:14 +0000 (00:20 -0400)]
Fix uninitialized XRayArg
Thomas Lively [Fri, 25 Sep 2020 03:35:29 +0000 (20:35 -0700)]
[lld][WebAssembly] Allow `atomics` feature with unshared memory
https://github.com/WebAssembly/threads/issues/144 updated the
WebAssembly threads proposal to make atomic operations on unshared memories
valid. This change updates the feature checking in the linker accordingly.
Production WebAssembly engines have recently been updated to allow this
behvaior, but after this change users who accidentally use atomics with unshared
memories on older versions of the engines will get validation errors at runtime
rather than link errors.
Differential Revision: https://reviews.llvm.org/D79530
Chris Bowler [Thu, 24 Sep 2020 23:06:56 +0000 (19:06 -0400)]
[NFC] [PPC] Add PowerPC expected IR tests for C99 complex
Adding this test so that I can extend it in a follow on patch with
expected IR for AIX when I implement complex handling in
AIXABIInfo.
Reviewed By: daltenty, ZarkoCA
Differential Revision: https://reviews.llvm.org/D88105
Ian Levesque [Fri, 18 Sep 2020 18:45:51 +0000 (14:45 -0400)]
[xray] Function coverage groups
Add the ability to selectively instrument a subset of functions by dividing the functions into N logical groups and then selecting a group to cover. By selecting different groups over time you could cover the entire application incrementally with lower overhead than instrumenting the entire application at once.
Differential Revision: https://reviews.llvm.org/D87953
Richard Smith [Fri, 25 Sep 2020 01:07:05 +0000 (18:07 -0700)]
PR47176: Don't read from an inactive union member if a friend function
has default arguments and an exception specification.
Mehdi Amini [Fri, 25 Sep 2020 01:50:40 +0000 (01:50 +0000)]
Hint how to get a symbolized stack trace if llvm-symbolizer is not found on crashes
Most users of LLVM tools hit the raw traces and don't know how to get LLVM to
symbolize automatically for them.
When we print the non-symbolized stack trace, we will add information about
how to get it symbolized.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D88269
Krzysztof Parzyszek [Fri, 25 Sep 2020 00:00:15 +0000 (19:00 -0500)]
[Hexagon] Avoid crash on CONCAT_VECTORS with illegal element types
Legal vector element types may not be legal as scalar types. When
CONCAT_VECTORS is converted to BUILD_VECTOR, the individual vector
elements become standalone operands to the build operation. If they
have illegal (scalar) types, they need to be made legal. In doing
so, the case of TRUNCATE was not handled, causing an assertion to
fail.
Fangrui Song [Fri, 25 Sep 2020 01:01:26 +0000 (18:01 -0700)]
[lld] Clean up in lld::{coff,elf}::link after D70378
Library users should not need to call errorHandler().reset() explicitly.
google/iree calls lld::elf::link and without the patch some global
variables are not cleaned up in the next invocation.
Juneyoung Lee [Fri, 25 Sep 2020 00:49:13 +0000 (09:49 +0900)]
[ValueTracking] Make isGuaranteedNotToBeUndefOrPoison exit early when MetadataAsValue is given
It is set to conservatively return false, otherwise noundef attributes are added to function calls with metadata arguments.
Juneyoung Lee [Thu, 24 Sep 2020 09:52:30 +0000 (18:52 +0900)]
[ValueTracking] Check uses of Argument if it is given to isGuaranteedNotToBeUndefOrPoison
This is a patch that allows isGuaranteedNotToBeUndefOrPoison to return more precise result
when an argument is given, by looking through its uses at the entry block (and following blocks as well, if it is checking poison only).
This is useful when there is a function call with noundef arguments at the entry block.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D88207
Reid Kleckner [Thu, 24 Sep 2020 23:47:15 +0000 (16:47 -0700)]
Revert "[NFCI][IR] ConstantRangeTest: add basic scaffolding for next-gen precision/correctness testing"
This reverts commit
9bcf7b1c7a139a455400df109d81c638b9e75150.
Breaks build with MSVC.
Reid Kleckner [Thu, 24 Sep 2020 23:39:46 +0000 (16:39 -0700)]
Revert "Add a static_assert confirming that DiagnosticBuilder is small"
This reverts commit
a32feed0dbeac7606d042d0d7e041c9eaf12cd51.
This assert doesn't hold in 32-bit builds, I didn't do the math right.
Reid Kleckner [Thu, 24 Sep 2020 23:38:07 +0000 (16:38 -0700)]
Add a static_assert confirming that DiagnosticBuilder is small
Walter Erquinigo [Thu, 24 Sep 2020 20:39:21 +0000 (13:39 -0700)]
[intel-pt] Refactor the JSON parsing
Recently https://reviews.llvm.org/D88103 introduced a nice API for
converting a JSON object into C++ types, which include nice error
messaging.
I'm using that new functioniality to perform the parsing in a much more
elegant way. As a result, the code looks simpler and more maintainable,
as we aren't parsing anymore individual fields manually.
I updated the test cases accordingly.
Differential Revision: https://reviews.llvm.org/D88264
Reid Kleckner [Thu, 24 Sep 2020 21:11:06 +0000 (14:11 -0700)]
[MS] For unknown ISAs, pass non-trivially copyable arguments indirectly
Passing them directly is likely to be non-conforming, since it usually
involves copying the bytes of the record. For unknown architectures, we
don't know what MSVC does or will do, but we should at least try to
conform as well as we can.
Reid Kleckner [Thu, 24 Sep 2020 20:42:41 +0000 (13:42 -0700)]
[MS] Simplify rules for passing C++ records
Regardless of the target architecture, we should always use the C rules
(RAA_Default) for records that "canBePassedInRegisters". Those are
trivially copyable things, and things marked with [[trivial_abi]].
This should be NFC, although it changes where the final decision about
x86_32 overaligned records is made. The current x86_32 C rules say that
overaligned things are passed indirectly, so there is no functional
difference.
Stanislav Mekhanoshin [Thu, 24 Sep 2020 23:07:15 +0000 (16:07 -0700)]
[AMDGPU] Fixes typo in the test. NFC.
denormal-fp-math-fp32 -> denormal-fp-math-f32
Evandro Menezes [Thu, 17 Sep 2020 23:20:50 +0000 (18:20 -0500)]
[RISCV] Merge the pipeline models for Rocket
Merge the 32 and 64 bit pipeline models for Rocket into a single file.
Differential Revision: https://reviews.llvm.org/D87873
Snehasish Kumar [Thu, 17 Sep 2020 04:40:00 +0000 (21:40 -0700)]
[llvm] Add -bbsections-cold-text-prefix to emit cold clusters to a different section.
This change adds an option to basic block sections to allow cold
clusters to be assigned a custom text prefix. With a custom prefix such
as ".text.split." (D87840), lld can place them in a separate output section.
The benefits are -
* Empirically shown to improve icache and itlb metrics by 3-5%
(absolute) compared to placing split parts in .text.unlikely.
* Mitigates against poor profiles, eg samplePGO profiles used with the
machine function splitter. Optimizations such as hugepage remapping can
make different decisions at the section granularity.
* Enables section granularity hotness monitoring (checking on the
decisions made during compilation vs sample data from production).
Differential Revision: https://reviews.llvm.org/D87813
Joseph Huber [Thu, 24 Sep 2020 16:49:58 +0000 (12:49 -0400)]
[OpenMP] OpenMPOpt Support for Globalization Remarks
Summary:
This patch add support for printing analysis messages relating to data
globalization on the GPU. This occurs when data is shared between the
threads in a GPU context and must be pushed to global or shared memory.
Reviewers: jdoerfert
Subscribers: guansong hiraditya llvm-commits ormris sstefan1 yaxunl
Tags: #OpenMP #LLVM
Differential Revision: https://reviews.llvm.org/D88243
Bill Wendling [Thu, 24 Sep 2020 22:20:47 +0000 (15:20 -0700)]
Fix regex in test.
Snehasish Kumar [Thu, 17 Sep 2020 17:04:03 +0000 (10:04 -0700)]
[lld] Make -z keep-text-section-prefix recognize .text.split. as a prefix.
".text.split." holds symbols which are split out from functions in
other input sections. For example, with -fsplit-machine-functions,
placing the cold parts in .text.split instead of .text.unlikely mitigates
against poor profile inaccuracy. Techniques such as hugepage remapping can
make conservative decisions at the section granularity.
Differential Revision: https://reviews.llvm.org/D87840
Jez Ng [Thu, 24 Sep 2020 22:00:56 +0000 (15:00 -0700)]
[lld-macho][re-land] Implement and test resolution of common symbols
Earlier build break fixed in
c32e69b2ce7abfb151a87ba363ac9e25abf7d417.
This reverts commit
c367f93e8539c4d0bcdc86ad7ea7923e06231a93.
Jez Ng [Thu, 24 Sep 2020 21:44:14 +0000 (14:44 -0700)]
[lld-macho][re-land] Initial support for common symbols
Fix earlier build break via a static_cast.
This reverts commit
8112d494d344dc0935d5c078f066a43d7c984e0c.
Differential Revision: https://reviews.llvm.org/D86909
Vedant Kumar [Tue, 8 Sep 2020 20:39:52 +0000 (13:39 -0700)]
[Instruction] Add dropLocation and updateLocationAfterHoist helpers
Introduce a helper which can be used to update the debug location of an
Instruction after the instruction is hoisted. This can be used to safely
drop a source location as recommended by the docs.
For more context, see the discussion in https://reviews.llvm.org/D60913.
Differential Revision: https://reviews.llvm.org/D85670
Thomas Lively [Thu, 24 Sep 2020 21:56:19 +0000 (14:56 -0700)]
[WebAssembly] Make SjLj lowering globals thread-local
Emscripten's longjump and exception mechanism depends on two global variables,
`__THREW__` and `__threwValue`, which are changed to be defined as thread-local
in https://github.com/emscripten-core/emscripten/pull/12056. This patch updates
the corresponding code in the WebAssembly backend to properly declare these
globals as thread-local as well.
Differential Revision: https://reviews.llvm.org/D88262
shafik [Thu, 24 Sep 2020 21:31:31 +0000 (14:31 -0700)]
[LLDB] Add a defensive check for member__f_
I only have a crash log and was not able to come up with a test case for this.
rdar://problem/
69403150
Amy Huang [Wed, 16 Sep 2020 16:58:39 +0000 (09:58 -0700)]
[DebugInfo] Fix bug in constructor homing with classes with trivial
constructors.
This changes the code to avoid using constructor homing for aggregate
classes and classes with trivial default constructors, instead of trying
to loop through the constructors.
Differential Revision: https://reviews.llvm.org/D87808
Sriraman Tallam [Thu, 24 Sep 2020 21:37:56 +0000 (14:37 -0700)]
Temporary fix for D85085 debug_loc bug with basic block sections.
Until then, this one line fix removes the assert fail with basic block sections
with debug info. Bug tracking this: #47549
This fix does not generate loc list or DW_AT_const_value if the argument is
mentioned in a different section than the start of the function.
Temporarily fixes bugzilla : https://bugs.llvm.org/show_bug.cgi?id=47549
Differential Revision: https://reviews.llvm.org/D87787
Zequan Wu [Wed, 23 Sep 2020 23:58:57 +0000 (16:58 -0700)]
Reland [CodeGen] emit CG profile for COFF object file
This reverts commit
90242caca2074dab5a9b76e5bc36d9fafd2179a7.
Error fixed at
f5435399e823746bbe1737b95c853d77a42e1ac3
Differential Revision: https://reviews.llvm.org/D87811
Roman Lebedev [Thu, 24 Sep 2020 21:30:54 +0000 (00:30 +0300)]
[NFCI][IR] ConstantRangeTest: add basic scaffolding for next-gen precision/correctness testing
I have long complained that while we have exhaustive tests
for ConstantRange, they are, uh, not good.
The approach of groking our own constant range
via exhaustive enumeration is, mysterious.
It neither tells us without doubt that the result is
conservatively correct, nor the precise match to the ConstantRange
result tells us that the result is precise.
But yeah, it's fast, i give it that.
In short, there are three things that we need to check:
1. That ConstantRange result is conservatively correct
2. That ConstantRange range is reasonable
3. That ConstantRange result is reasonably precise
So let's not just check the middle one, but all three.
This provides precision test coverage for D88178.
Roman Lebedev [Thu, 24 Sep 2020 14:13:09 +0000 (17:13 +0300)]
[NFCI][IR] ConstantRangeTest: refactor operation range gatherers
We do the same dance to acquire the "exact" range of an op via
an exhaustive approach in many places.
Let's not invent the wheel each time.
Bill Wendling [Thu, 24 Sep 2020 21:35:15 +0000 (14:35 -0700)]
Revert "[CodeGen] Postprocess PHI nodes for callbr"
Accidental commit.
This reverts commit
7f4c940bd0b526f25e11c51bb4d58a85024330ae.
Bill Wendling [Thu, 24 Sep 2020 21:34:08 +0000 (14:34 -0700)]
Fix testcase.
Bill Wendling [Thu, 20 Aug 2020 02:51:20 +0000 (19:51 -0700)]
[CodeGen] Postprocess PHI nodes for callbr
When processing PHI nodes after a callbr, we need to make sure that the
PHI nodes on the default branch are resolved after the callbr
(inserted after INLINEASM_BR). The PHI node values on the indirect
branches are processed before the INLINEASM_BR.
Differential Revision: https://reviews.llvm.org/D86260
Artem Belevich [Thu, 24 Sep 2020 17:47:45 +0000 (10:47 -0700)]
[CUDA] Added conversion functions to builtin vars.
This is needed to compile some headers in CUDA-11 that assume that threadIdx is
implicitly convertible to dim3. With NVCC, threadIdx is uint3 and there's
dim3(uint3) constructor. Clang uses a special type for the builtin variables, so
that path does not work. Instead, this patch adds conversion function to the
builtin variable classes. that will allow them to be converted to dim3 and uint3.
Differential Revision: https://reviews.llvm.org/D88250
Daniel Kiss [Thu, 24 Sep 2020 18:24:12 +0000 (20:24 +0200)]
[AArch64] __builtin_return_address for PAuth.
This change adds the support for __builtin_return_address
for ARMv8.3A Pointer Authentication.
Location of the authentication code in the pointer depends on
the system configuration, therefore a dedicated instruction is used for
effectively removing the authentication code without
authenticating the pointer.
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D75044
Diego Caballero [Thu, 24 Sep 2020 19:29:56 +0000 (12:29 -0700)]
[mlir][NFC] Promote memory space to BaseMemRefType
This patch moves the memory space field from MemRefType and UnrankedMemRefType
to their base class BaseMemRefType so that it can be retrieved from it without
downcasting it to the specific memref.
Reviewed By: silvas
Differential Revision: https://reviews.llvm.org/D87649
Bill Wendling [Thu, 24 Sep 2020 02:09:10 +0000 (19:09 -0700)]
Remove stale assert.
This is triggered during serialization. The test is for modules, but
will occur for any serialization effort using asm goto.
Reviewed By: nickdesaulniers, jyknight
Differential Revision: https://reviews.llvm.org/D88195
Sam McCall [Thu, 24 Sep 2020 12:26:11 +0000 (14:26 +0200)]
[AST] Use data-recursion when building ParentMap, avoid stack overflow.
The following crashes on my system before this patch, but not after:
void foo(int i) {
switch (i) {
case 1:
case 2:
... 100000 cases ...
;
}
}
clang-query -c="match stmt(hasAncestor(stmt()))" deep.c
I'm not sure it's actually a sane testcase to run though, it's pretty slow :-)
Differential Revision: https://reviews.llvm.org/D88222
David Tenty [Fri, 4 Sep 2020 20:44:40 +0000 (16:44 -0400)]
[CMake][AIX] Set LLVM_ENABLE_PER_TARGET_RUNTIME_DIR appropriately for AIX
AIX by default usually folds 32-bit & 64-bit arch libraries into a single
archive, a behaviour we may want for the runtime libraries in the future,
so we don't necessarily want to opt into the multlib layout introduce in
D45604, which is currently the default for runtime builds.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D88169
Alexey Bataev [Thu, 24 Sep 2020 18:46:06 +0000 (14:46 -0400)]
[OPENMP]Fix PR47621: Variable used by task inside a template function is not made firstprivate by default
Need to fix a check for the variable if it is declared in the inner
OpenMP region to be able to firstprivatize it.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D88240
Andrzej Warzynski [Thu, 24 Sep 2020 19:57:46 +0000 (20:57 +0100)]
[flang][driver] Add missing dependency (shared library builds, NFC)
`flang-new` depends on libclangFrontend (it uses DiagnosticConsumer
classes from there). This patch adds the missing dependency in CMake.
clang::TextDiagnosticBuffer is only reported as missing when compiling
`flang-new` with BUILD_SHARED_LIBS=ON. This symbol is linked in
statically with libflangFrontend when BUILD_SHARED_LIBS=OFF.
Erich Keane [Thu, 24 Sep 2020 20:04:36 +0000 (13:04 -0700)]
Remove dead branch identified by @rsmith on post-commit for D88236
Andrew Litteken [Thu, 17 Sep 2020 21:29:43 +0000 (16:29 -0500)]
[IRSim] Adding wrapper pass for IRSimilarityIdentfier
This introduces an analysis pass that wraps IRSimilarityIdentifier,
and adds a printer pass to examine in what function similarities are
being found.
Test for what the printer pass can find are in
test/Analysis/IRSimilarityIdentifier.
Reviewed by: paquette, jroelofs
Differential Revision: https://reviews.llvm.org/D86973
Matt Arsenault [Thu, 24 Sep 2020 19:36:42 +0000 (15:36 -0400)]
AArch64/GlobalISel: Add testcase for bug 47619
This is asserting on the 11 release branch, and wasn't covered by
exisiting tests at the time. This was fixed by
b98f902f1877c3d679f77645a267edc89ffcd5d6.
Volodymyr Sapsai [Thu, 24 Sep 2020 19:36:06 +0000 (12:36 -0700)]
Revert "[Modules] Add stats to measure performance of building and loading modules."
This reverts commit
c4bacc3c9b333bb7032fb96f41d6f5b851623132.
Test "LLVM :: ThinLTO/X86/funcimport-stats.ll" is failing. Reverting now
and will recommit after making the test not fail with the added stats.
Sanjay Patel [Thu, 24 Sep 2020 19:11:27 +0000 (15:11 -0400)]
[SLP] clean up - use 'const' and ArrayRef constructor; NFC
Follow-on tidying suggested in the post-commit review of 6a23668.
Mircea Trofin [Thu, 24 Sep 2020 03:10:42 +0000 (20:10 -0700)]
[NFC][regalloc] Remove unused API in AllocationOrder
Differential Revision: https://reviews.llvm.org/D88197
Sean Silva [Fri, 18 Sep 2020 20:55:52 +0000 (13:55 -0700)]
[mlir][shape] Start a pass that lowers shape constraints.
This pass converts shape.cstr_* ops to eager (side-effecting)
error-handling code. After that conversion is done, the witnesses are
trivially satisfied and are replaced with `shape.const_witness true`.
Differential Revision: https://reviews.llvm.org/D87941
Volodymyr Sapsai [Mon, 6 Jan 2020 19:55:55 +0000 (11:55 -0800)]
[Modules] Add stats to measure performance of building and loading modules.
Measure amount of high-level or fixed-cost operations performed during
building/loading modules and during header search. High-level operations
like building a module or processing a .pcm file are motivated by
previous issues where clang was re-building modules or re-reading .pcm
files unnecessarily. Fixed-cost operations like `stat` calls are tracked
because clang cannot change how long each operation takes but it can
perform fewer of such operations to improve the compile time.
Also tracking such stats over time can help us detect compile-time
regressions. Added stats are more stable than the actual measured
compilation time, so expect the detected regressions to be less noisy.
rdar://problem/
55715134
Reviewed By: aprantl, bruno
Differential Revision: https://reviews.llvm.org/D86895
Matt Arsenault [Tue, 28 Jul 2020 14:15:42 +0000 (10:15 -0400)]
GlobalISel: Use unmerge when copying wide vectors to result registers
Avoid using G_EXTRACT and move towards a more consistent vector
legalization strategy.
Mehdi Amini [Thu, 24 Sep 2020 19:13:51 +0000 (19:13 +0000)]
Add support for setting the path to llvm-symbolizer through an environment variable
This allows to point to an executable that isn't named exactly
"llvm-symbolizer" and not necessarily in the current PATH.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D88192
Erich Keane [Thu, 24 Sep 2020 15:52:54 +0000 (08:52 -0700)]
[PR47636] Fix tryEmitPrivate to handle non-constantarraytypes
As mentioned in the bug report, tryEmitPrivate chokes on the
MaterializeTemporaryExpr in the reproducers, since it assumes that if
there are elements, than it must be a ConstantArrayType. However, the
MaterializeTemporaryExpr (which matches exactly the AST when it is NOT a
global/static) has an incomplete array type.
This changes the section where the number-of-elements is non-zero to
properly handle non-CAT types by just extracting it as an array type
(since all we needed was the element type out of it).
Alexandre Ganea [Thu, 24 Sep 2020 19:00:43 +0000 (15:00 -0400)]
[LLD][COFF] Cover usage of LLD-as-a-library in tests
In lit tests, we run each LLD invocation twice (LLD_IN_TEST=2), without shutting down the process in-between. This ensures a full cleanup is properly done between runs.
Only active for the COFF driver for now. Other drivers still use LLD_IN_TEST=1 which executes just one iteration with full cleanup, like before.
When the environment variable LLD_IN_TEST is unset, a shortcut is taken, only one iteration is executed, no cleanup for faster exit, like before.
A public API, lld::safeLldMain(), is also available when using LLD as a library.
Differential Revision: https://reviews.llvm.org/D70378
Alexandre Ganea [Thu, 24 Sep 2020 17:12:55 +0000 (13:12 -0400)]
[LLD][COFF] Avoid overwriting inputs in tests
Before this patch, these two tests were emitting both a .DLL and .LIB. The output .LIB file name also happens to be an input .LIB file name. This prevented the test from executing a second time when LLD is re-entrant (LLD_IN_TEST=2).
This is a support patch for https://reviews.llvm.org/D70378.
Saleem Abdulrasool [Thu, 24 Sep 2020 18:50:11 +0000 (18:50 +0000)]
Basic: add an extra newline for sphinx (NFC)
This should resolve the "Bullet list ends without a blank line" warning.
Alexey Bataev [Thu, 24 Sep 2020 18:41:14 +0000 (14:41 -0400)]
Revert "[OPENMP]Fix PR47621: Variable used by task inside a template function is not made firstprivate by default"
This reverts commit
d1419c9fdab141617b6aa9f028191b9bfc8be260 to fix the
buffer overflow detected by address sanitiizer.
Jinsong Ji [Thu, 24 Sep 2020 18:20:57 +0000 (18:20 +0000)]
[llvm-exegesis] Add whitespace between words in error message
Reid Kleckner [Thu, 24 Sep 2020 18:14:05 +0000 (11:14 -0700)]
Revert "Recommit [NFC] Refactor DiagnosticBuilder and PartialDiagnostic"
This reverts commit
8e780a1653e6f87755a447e921b8f929d8b70996.
DiagnosticBuilder is a value type, created on the stack everywhere. IMO
we should not be adding a vtable to it, and making very operator<< use a
virtual interface. There are other feasible designs for implementing
this. The original review, D84362, was approved by @tra, who is
responsible for Clang's CUDA support, but it wasn't reviewed by @rsmith
or anyone responsible for clang's diagnostic library.
Reid Kleckner [Thu, 24 Sep 2020 18:13:42 +0000 (11:13 -0700)]
Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions""
This reverts commit
e39da8ab6a286ac777d5fe7799f1eb782cf99938.
This depends on a change that needs additional design review and needs
to be reverted.
Sanjay Patel [Thu, 24 Sep 2020 17:44:29 +0000 (13:44 -0400)]
[APFloat] prevent NaN morphing into Inf on conversion (PR43907)
We shift the significand right on a truncation, but that needs to be made NaN-safe:
always set at least 1 bit in the significand.
https://llvm.org/PR43907
See D88238 for the likely follow-up (but needs some plumbing fixes before it can proceed).
Differential Revision: https://reviews.llvm.org/D87835
Craig Topper [Thu, 24 Sep 2020 16:55:39 +0000 (09:55 -0700)]
[SLP] Remove LHS and RHS from OperationData.
These were only really used for 2 things. One was to check if the operand matches the phi if it exists. The other was for the createOp method to build the reduction.
For the first case we still have the operation we just need to know how to index its operands. So I've modified getLHS/getRHS to just use the opcode/kind to know how to find the right operands on an instruction that is now passed in.
For the other case we had to create an OperationData object to set the LHS/RHS values and copy the opcode/kind from another object. We would then just call createOp on that temporary object. Instead I've made LHS/RHS arguments to createOp and removed all these temporary objects.
Differential Revision: https://reviews.llvm.org/D88193
Alexey Bataev [Thu, 24 Sep 2020 13:07:24 +0000 (09:07 -0400)]
[OPENMP]Fix PR47621: Variable used by task inside a template function is not made firstprivate by default
Need to fix a check for the variable if it is declared in the inner
OpenMP region to be able to firstprivatize it.
Differential Revision: https://reviews.llvm.org/D88240
Simon Pilgrim [Thu, 24 Sep 2020 17:28:21 +0000 (18:28 +0100)]
[Scalar] ConstantHoistingPass - iterate with const references. NFCI.
Fix some clang-tidy warnings.
Simon Pilgrim [Thu, 24 Sep 2020 17:03:59 +0000 (18:03 +0100)]
[AArch64] Regenerate dag-numsignbits.ll checks
To improve the codegen diff in D87502
Stanislav Mekhanoshin [Thu, 17 Sep 2020 18:44:52 +0000 (11:44 -0700)]
[AMDGPU] global-isel support for RT
Differential Revision: https://reviews.llvm.org/D87847
Alexey Bataev [Wed, 23 Sep 2020 19:27:51 +0000 (15:27 -0400)]
[OPENMP]PR47606: Do not update the lastprivate item if it was captured by reference as firstprivate data member.
No need to make final copy from the firsptrivate/lastprivate copy to the original item if the item is a data memeber.
Firstprivate copy creates a copy by reference and the original item gets
updated correctly when updating the lastprivate shared variable.
Differential Revision: https://reviews.llvm.org/D88179