Raphael Isemann [Mon, 13 Jul 2020 10:22:09 +0000 (12:22 +0200)]
[lldb][NFC] Remove misleading class_language variable in DWARFASTParserClang
There is a local 'class_language' veriable in DWARFASTParserClang which is named
as if it is related to the 'class_language' member of ParsedDWARFTypeAttributes.
However, it actually only has two possible enum values: 'ObjC' (which means the
current record is a Objective-C class) or 'Unknown' (which covers all other
cases).
This is confusing for the reader and also lead to some strange code where we
have several comparisons against the value "ObjC_plus_plus" (which is always
false).
This replaces the variable with either a const bool variable (if there are
multiple checks for that condition in a function) or a direct call to the
TypeSystemClang utility method for checking if it's a Objective-C
Object/Interface type.
Andre Vieira [Mon, 13 Jul 2020 10:52:58 +0000 (11:52 +0100)]
[libc][benchmark] Add display option to render.py3
Differential Revision: https://reviews.llvm.org/D83380
Ben Dunbobbin [Mon, 13 Jul 2020 10:58:30 +0000 (11:58 +0100)]
[LLD][ELF][Windows] small improvement to D82567
Bail early if there is no existing output file to be overwritten.
Differential Revision: https://reviews.llvm.org/D83272
Georgii Rymar [Thu, 9 Jul 2020 10:08:13 +0000 (13:08 +0300)]
[LLD][ELF] - Allow relocation sections to appear before their target sections.
It allows handling cases when we have SHT_REL[A] sections before target
sections in objects.
This fixes https://bugs.llvm.org/show_bug.cgi?id=46632
which says: "Normally it is not what compilers would emit. We have to support it,
because some custom tools might want to use this feature, which is not restricted by ELF gABI"
Differential revision: https://reviews.llvm.org/D83469
Anastasia Stulova [Mon, 13 Jul 2020 10:30:13 +0000 (11:30 +0100)]
[OpenCL] Defer addr space deduction for dependent type.
This patch removes deduction of address spaces in parsing
for types that depend on template parameter even if an
address space is already known. Deducing it early interferes
with template instantiation/specialization logic that uses
source address space where address space is not present.
Address space deduction for templates is therefore fully
moved to the template instantiation/specialization phase.
Patch by Ole Strohm (olestrohm)!
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82781
Benjamin Kramer [Mon, 13 Jul 2020 10:23:53 +0000 (12:23 +0200)]
[mlir][VectorOps] Lower vector.fma to llvm.fmuladd instead of llvm.fma
Summary:
These are semantically equivalent, but fmuladd allows decaying the op
into fmul+fadd if there is no fma instruction available. llvm.fma lowers
to scalar calls to libm fmaf, which is a lot slower.
Reviewers: nicolasvasilache, aartbik, ftynse
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D83666
Mirko Brkusanin [Mon, 13 Jul 2020 09:44:18 +0000 (11:44 +0200)]
[AMDGPU][GlobalISel] Select llvm.amdgcn.ballot
Select ballot intrinsic for GlobalISel.
Differential Revision: https://reviews.llvm.org/D83214
Haojian Wu [Mon, 13 Jul 2020 10:05:09 +0000 (12:05 +0200)]
[clang] Include type specifiers in typo correction when checking isCXXDeclarationSpecifiers.
- add more tests (the test added in https://github.com/llvm/llvm-project/commit/
2f448467e4254ddc3191136c968e6054bc009b88 is weak);
- improve the `MyTemplate<type_typo, int>();` case, with this patch, typo correction
suggests the type decl, and no regressions found.
Differential Revision: https://reviews.llvm.org/D83025
Kerry McLaughlin [Mon, 13 Jul 2020 09:08:40 +0000 (10:08 +0100)]
[SVE][Codegen] Add a helper function for pointer increment logic
Summary:
Helper used when splitting load & store operations to calculate
the pointer + offset for the high half of the split
Reviewers: efriedma, sdesmalen, david-arm
Reviewed By: efriedma
Subscribers: tschuett, hiraditya, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83577
Haojian Wu [Thu, 9 Jul 2020 10:55:46 +0000 (12:55 +0200)]
[clang][RecoveryExpr] Clarify the dependence-bits documentation.
The expr dependent-bits described that the expression somehow
depends on a template paramter.
With RecoveryExpr, we have generalized it to "the expression depends on
a template parameter, or an error". This patch updates/cleanups all related
comments of dependence-bits.
Differential Revision: https://reviews.llvm.org/D83213
Haojian Wu [Mon, 13 Jul 2020 09:26:45 +0000 (11:26 +0200)]
[clangd] Add metrics for recovery-expr type propagation.
Differential Revision: https://reviews.llvm.org/D83657
Ella Ma [Mon, 13 Jul 2020 09:22:16 +0000 (12:22 +0300)]
Fix bad doxygen result for class clang::ento::CallEvent and its derived classes
Summary: Fix bug https://bugs.llvm.org/show_bug.cgi?id=44753. This
patch is a workaround of a Doxygen bug, so that it can correctly
generate documents for class clang::ento::CallEvent and its derived
classes.
Differential Revision: https://reviews.llvm.org/D82356
Petar Avramovic [Mon, 13 Jul 2020 08:52:33 +0000 (10:52 +0200)]
[GlobalISel][InlineAsm] Fix buildCopy for inputs
Check that input size matches size of destination reg class.
Attempt to extend input size when needed.
Differential Revision: https://reviews.llvm.org/D83384
Frederik Gossen [Mon, 13 Jul 2020 08:28:13 +0000 (08:28 +0000)]
[MLIR][Shape] Lower `shape.any`
Lower `shape.any` to its first operand.
Differential Revision: https://reviews.llvm.org/D83123
Aleksandr Platonov [Mon, 13 Jul 2020 07:04:29 +0000 (09:04 +0200)]
[clangd] Fix tests build for GCC5
Summary:
Build log:
```
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::PreamblePatchTest_Define_Test::TestBody()’:
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"\012 #define BAR\012 [[BAR]]"’ from ‘const char*’ to ‘llvm::StringLitera ’
};
^
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"#line 0 \".*main.cpp\"\012#line 2\012#define BAR\012"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"\012 #define BAR \\\012\012 [[BAR]]"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"#line 0 \".*main.cpp\"\012#line 2\012#define BAR\012"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"\012 #define \\\012 BAR\012 [[BAR]]"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:267:3: error: could not convert ‘(const char*)"#line 0 \".*main.cpp\"\012#line 3\012#define BAR\012"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::PreamblePatchTest_LocateMacroAtWorks_Test::TestBody()’:
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
};
^
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012 #define $def^FOO\012 $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012 #define $def^FOO\012 #undef $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012 #define $def^FOO\012 #undef FOO\012 $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012 #define \\\012 $def^FOO\012 $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012 #\\\012 define /* FOO */\\\012 /* FOO */ $def^FOO\012 $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"#define FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:357:3: error: could not convert ‘(const char*)"\012 #define BAR\012 #define $def^FOO\012 $use^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::PreamblePatchTest_RefsToMacros_Test::TestBody()’:
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
};
^
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)"\012 #define ^FOO\012 ^[[FOO]]"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)"#define FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)"\012 #define BAR\012 #define ^FOO\012 ^[[FOO]]"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:445:3: error: could not convert ‘(const char*)"\012 #define ^FOO\012 #undef ^FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::PreamblePatch_ModifiedBounds_Test::TestBody()’:
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)""’ from ‘const char*’ to ‘llvm::StringLiteral’
};
^
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"\012 #define FOO\012 FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"#define FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"#define BAR"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"\012 #define FOO\012 #undef FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
llvm-project/clang-tools-extra/clangd/unittests/PreambleTests.cpp:512:3: error: could not convert ‘(const char*)"#define FOO"’ from ‘const char*’ to ‘llvm::StringLiteral’
```
Patch by @ArcsinX !
Reviewers: kadircet, sammccall
Reviewed By: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83548
Max Kazantsev [Mon, 13 Jul 2020 04:14:59 +0000 (11:14 +0700)]
[InstCombine] Improve select -> phi canonicalization: consider more blocks
We can try to replace select with a Phi not in its parent block alone,
but also in blocks of its arguments. We benefit from it when select's
argument is a Phi.
Differential Revision: https://reviews.llvm.org/D83284
Reviewed By: nikic
Kai Luo [Mon, 13 Jul 2020 04:31:04 +0000 (04:31 +0000)]
[PowerPC] Enhance tests for D83276. NFC.
Qiu Chaofan [Mon, 13 Jul 2020 04:15:44 +0000 (12:15 +0800)]
[PowerPC] Support constrained conversion in SPE target
This patch adds support for constrained int/fp conversion between
signed/unsigned i32 and f32/f64.
Reviewed By: jhibbits
Differential Revision: https://reviews.llvm.org/D82747
Fangrui Song [Mon, 13 Jul 2020 04:04:31 +0000 (21:04 -0700)]
[MC][RISCV] Set UseIntegratedAssembler to true
to align with most other targets. Also, -fintegrated-as is the default
for clang -target riscv*.
Atmn Patel [Mon, 13 Jul 2020 03:19:40 +0000 (22:19 -0500)]
[OpenMP] Add firstprivate as a default data-sharing attribute to clang
This implements the default(firstprivate) clause as defined in OpenMP
Technical Report 8 (2.22.4).
Reviewed By: jdoerfert, ABataev
Differential Revision: https://reviews.llvm.org/D75591
David Blaikie [Mon, 13 Jul 2020 03:29:19 +0000 (20:29 -0700)]
Revert "Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression"
Broke buildbots since I hadn't updated this patch in a while. Sorry for
the noise.
This reverts commit
49e5f603d40083dce9c05796e3cde3a185c3beba.
David Blaikie [Mon, 23 Mar 2020 22:07:51 +0000 (15:07 -0700)]
Rename/refactor isIntegerConstantExpression to getIntegerConstantExpression
There is a version that just tests (also called
isIntegerConstantExpression) & whereas this version is specifically used
when the value is of interest (a few call sites were actually refactored
to calling the test-only version) so let's make the API look more like
it.
Reviewers: aaron.ballman
Differential Revision: https://reviews.llvm.org/D76646
Craig Topper [Sun, 12 Jul 2020 23:58:27 +0000 (16:58 -0700)]
[X86] Rename X86_CPU_TYPE_COMPAT_ALIAS/X86_CPU_TYPE_COMPAT/X86_CPU_SUBTYPE_COMPAT macros. NFC
Remove _COMPAT. Drop the ARCHNAME. Remove the non-COMPAT versions
that are no longer needed.
We now only use these macros in places where we need compatibility
with libgcc/compiler-rt. So we don't need to call out _COMPAT
specifically.
Logan Smith [Sun, 12 Jul 2020 22:38:37 +0000 (15:38 -0700)]
[clang] Add -Wsuggest-override
This patch adds `-Wsuggest-override`, which allows for more aggressive enforcement of modern C++ best practices, as well as better compatibility with gcc, which has had its own `-Wsuggest-override` since version 5.1.
Clang already has `-Winconsistent-missing-override`, which only warns in the case where there is at least one function already marked `override` in a class. This warning strengthens that warning by suggesting the `override` keyword regardless of whether it is already present anywhere.
The text between suggest-override and inconsistent-missing-override is now shared, using `TextSubstitution` for the entire diagnostic text.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D82728
Shinji Okumura [Sun, 12 Jul 2020 10:11:49 +0000 (19:11 +0900)]
[Attributor] Add AAValueSimplifyCallSiteArgument::manifest
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D82861
Dimitry Andric [Sun, 12 Jul 2020 18:32:26 +0000 (20:32 +0200)]
Bump the default target CPU for i386-freebsd to i686
Summary:
Similar to what we have done downstream, some time ago:
https://svnweb.freebsd.org/changeset/base/353936
This followed some discussions on the freebsd-arch mailing lists, and
most people agreed that it was a better default, and also it worked
around several issues where clang generated libcalls to 64 bit atomic
primitives, instead of using cmpxchg8b.
Reviewers: emaste, brooks, rsmith
Reviewed By: emaste
Subscribers: arichardson, krytarowski, jfb, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83645
Alexey Lapshin [Sun, 12 Jul 2020 19:46:37 +0000 (22:46 +0300)]
Revert "[TRE] allow TRE for non-capturing calls."
This reverts commit
f7907e9d223d8484f9afd457ba614c2db2ae4743.
That commit caused error on multi-stage build.
River Riddle [Sun, 12 Jul 2020 21:11:39 +0000 (14:11 -0700)]
[mlir][ODS] Add support for specifying the namespace of an interface.
The namespace can be specified using the `cppNamespace` field. This matches the functionality already present on dialects, enums, etc. This fixes problems with using interfaces on operations in a different namespace than the interface was defined in.
Differential Revision: https://reviews.llvm.org/D83604
Craig Topper [Sun, 12 Jul 2020 19:58:23 +0000 (12:58 -0700)]
[X86] Remove model number based detection for 'pentiumpro', 'pentium2', 'pentium3', 'pentium-m', and 'yonah' from getHostCPUName.
For model 6 CPUs, we have a fallback detection method based on
available features. That mechanism should be enough to detect
these early family 6 CPUs as they only differ in the features
used by the detection anyway.
Craig Topper [Sun, 12 Jul 2020 19:58:17 +0000 (12:58 -0700)]
[X86] Add CPU string output to getIntelProcessorTypeAndSubtype/getAMDProcessorTypeAndSubtype in Host.cpp
Rather than converting type/subtype into strings, just directly
select the string as part of family/model decoding. This avoids
the need for creating fake Type/SubTypes for CPUs not supported
by compiler-rtl. I've left the Type/SubType in place where it matches
compiler-rt so that the code can be diffed, but the Type/SubType
is no longer used by Host.cpp.
compiler-rt was already updated to select strings that aren't used
so the code will look similar.
Craig Topper [Sun, 12 Jul 2020 19:58:10 +0000 (12:58 -0700)]
[X86] Add CPU name strings to getIntelProcessorTypeAndSubtype and getAMDProcessorTypeAndSubtype in compiler-rt.
These aren't used in compiler-rt, but I plan to make a similar
change to the equivalent code in Host.cpp where the mapping from
type/subtype is an unnecessary complication. Having the CPU strings
here will help keep the code somewhat synchronized.
Sanjay Patel [Sun, 12 Jul 2020 19:56:26 +0000 (15:56 -0400)]
[InstCombine] fold mul of zext/sext bools to 'and'
Similar to rG40fcc42:
The base case only worked because we were relying on a
poison-unsafe select transform; if that is fixed, we
would regress on patterns like this.
The extra use tests show that the select transform can't
be applied consistently. So it may be a regression to have
an extra instruction on 1 test, but that result was not
created safely and does not happen reliably.
Sjoerd Meijer [Sun, 12 Jul 2020 18:19:25 +0000 (19:19 +0100)]
Revert "[Matrix] Tighten LangRef definitions and Verifier checks."
This reverts commit
f4d29d6e8c43cfd924d9d7cc1ac0c269b2788e75.
Hm, some build bot failures, reverting it while I investigate that.
Sjoerd Meijer [Thu, 9 Jul 2020 12:30:50 +0000 (13:30 +0100)]
[Matrix] Tighten LangRef definitions and Verifier checks.
This tightens the matrix intrinsic definitions in LLVM LangRef and adds
correspondings checks to the IR Verifier.
Differential Revision: https://reviews.llvm.org/D83477
mydeveloperday [Sun, 12 Jul 2020 17:57:14 +0000 (18:57 +0100)]
[polly] NFC clang-format change following D83564
Craig Topper [Sun, 12 Jul 2020 17:30:27 +0000 (10:30 -0700)]
[X86] Consistently use 128 as the PSHUFB/VPPERM index for zero
Bit 7 of the index controls zeroing, the other bits are ignored when bit 7 is set. Shuffle lowering was using 128 and shuffle combining was using 255. Seems like we should be consistent.
This patch changes shuffle combining to use 128 to match lowering.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D83587
Craig Topper [Sun, 12 Jul 2020 17:29:45 +0000 (10:29 -0700)]
[X86] Fix two places that appear to misuse peekThroughOneUseBitcasts
peekThroughOneUseBitcasts checks the use count of the operand of the bitcast. Not the bitcast itself. So I think that means we need to do any outside haseOneUse checks before calling the function not after.
I was working on another patch where I misused the function and did a very quick audit to see if I there were other similar mistakes.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D83598
mydeveloperday [Sun, 12 Jul 2020 17:43:14 +0000 (18:43 +0100)]
[clang-format] PR46609 clang-format does not obey `PointerAlignment: Right` for ellipsis in declarator for pack
Summary:
https://bugs.llvm.org/show_bug.cgi?id=46609
Ensure `*...` obey they left/middle/right rules of Pointer alignment
Reviewed By: curdeius
Differential Revision: https://reviews.llvm.org/D83564
Ayal Zaks [Thu, 9 Jul 2020 09:57:45 +0000 (12:57 +0300)]
[LV] Fixing versioning-for-unit-stide of loops with small trip count
This patch fixes D81345 and PR46652.
If a loop with a small trip count is compiled w/o -Os/-Oz, Loop Access Analysis
still generates runtime checks for unit strides that will version the loop.
In such cases, the loop vectorizer should either re-run the analysis or bail-out
from vectorizing the loop, as done prior to D81345. The latter is applied for
now as the former requires refactoring.
Differential Revision: https://reviews.llvm.org/D83470
Yonghong Song [Sun, 12 Jul 2020 02:08:21 +0000 (19:08 -0700)]
BPF: permit .maps section variables with typedef type
Currently, llvm when see a global variable in .maps section,
it ensures its type must be a struct type. Then pointee
will be further evaluated for the structure members.
In normal cases, the pointee type will be skipped.
Although this is what current all bpf programs are doing,
but it is a little bit restrictive. For example, it is legitimate
for users to have:
typedef struct { int key_size; int value_size; } __map_t;
__map_t map __attribute__((section(".maps")));
This patch lifts this restriction and typedef of
a struct type is also allowed for .maps section variables.
To avoid create unnecessary fixup entries when traversal
started with typedef/struct type, the new implementation
first traverse all map struct members and then traverse
the typedef/struct type. This way, in internal BTFDebug
implementation, no fixup entries are generated.
Two new unit tests are added for typedef and const
struct in .maps section. Also tested with kernel bpf selftests.
Differential Revision: https://reviews.llvm.org/D83638
Ayke van Laethem [Thu, 25 Jun 2020 11:57:58 +0000 (13:57 +0200)]
[LLD][ELF][AVR] Implement the missing relocation types
Implements the missing relocation types for AVR target.
The results have been cross-checked with binutils.
Original patch by LemonBoy. Some changes by me.
Differential Revision: https://reviews.llvm.org/D78741
Nikita Popov [Sun, 12 Jul 2020 15:48:05 +0000 (17:48 +0200)]
[SCCP] Extend nonnull metadata test (NFC)
Fangrui Song [Sun, 12 Jul 2020 15:14:52 +0000 (08:14 -0700)]
[AVRInstPrinter] printOperand: support llvm-objdump --print-imm-hex
Differential Revision: https://reviews.llvm.org/D83634
Rahul Joshi [Sat, 11 Jul 2020 22:15:22 +0000 (15:15 -0700)]
[NFC] Fix comment style in MLIR unittests to conform to LLVM coding standards.
Differential Revision: https://reviews.llvm.org/D83632
Sanjay Patel [Sun, 12 Jul 2020 12:51:49 +0000 (08:51 -0400)]
[DAGCombiner] tighten fast-math constraints for fma fold
fadd (fma A, B, (fmul C, D)), E --> fma A, B, (fma C, D, E)
This is only allowed when "reassoc" is present on the fadd.
As discussed in D80801, this transform goes beyond
what is allowed by "contract" FMF (-ffp-contract=fast).
That is because we are fusing the trailing add of 'E' with a
multiply, but without "reassoc", the code mandates that the
products A*B and C*D are added together before adding in 'E'.
I've added this example to the LangRef to try to clarify the
meaning of "contract". If that seems reasonable, we should
probably do something similar for the clang docs because
there does not appear to be any formal spec for the behavior
of -ffp-contract=fast.
Differential Revision: https://reviews.llvm.org/D82499
Ten Tzen [Sun, 12 Jul 2020 08:37:56 +0000 (01:37 -0700)]
[Windows SEH] Fix the frame-ptr of a nested-filter within a _finally
This change fixed a SEH bug (exposed by test58 & test61 in MSVC test xcpt4u.c);
when an Except-filter is located inside a finally, the frame-pointer generated today
via intrinsic @llvm.eh.recoverfp is the frame-pointer of the immediate
parent _finally, not the frame-ptr of outermost host function.
The fix is to retrieve the Establisher's frame-pointer that was previously saved in
parent's frame.
The prolog of a filter inside a _finally should be like code below:
%0 = call i8* @llvm.eh.recoverfp(i8* bitcast (@"?fin$0@0@main@@"), i8*%frame_pointer)
%1 = call i8* @llvm.localrecover(i8* bitcast (@"?fin$0@0@main@@"), i8*%0, i32 0)
%2 = bitcast i8* %1 to i8**
%3 = load i8*, i8** %2, align 8
Differential Revision: https://reviews.llvm.org/D77982
Nikita Popov [Sun, 12 Jul 2020 08:12:48 +0000 (10:12 +0200)]
[SCCP] Add test for predicate info condition handling (NFC)
Zequan Wu [Sun, 12 Jul 2020 03:49:26 +0000 (20:49 -0700)]
[COFF] Fix endianness of .llvm.call-graph-profile section data
Fangrui Song [Sat, 11 Jul 2020 23:44:34 +0000 (16:44 -0700)]
[llvm-objdump][test] Move tests after
dc4a6f5db4f0178bae43ef615cc8902c759d6195
Move RISCV/ to ELF/RISCV/ as well.
kuter [Sat, 11 Jul 2020 23:23:21 +0000 (02:23 +0300)]
[Attributor] Introudce attribute seed allow list.
Nikita Popov [Sat, 11 Jul 2020 20:51:25 +0000 (22:51 +0200)]
[NewGVN] Regenerate test checks (NFC)
Michael Liao [Sat, 11 Jul 2020 20:19:09 +0000 (16:19 -0400)]
Fix `-Wreturn-type` warning. NFC.
Mehdi Amini [Sat, 11 Jul 2020 20:05:37 +0000 (20:05 +0000)]
Fix one memory leak in the MLIRParser by using std::unique_ptr to hold the new block pointer
This is NFC when there is no parsing error.
Differential Revision: https://reviews.llvm.org/D83619
Mehdi Amini [Sat, 11 Jul 2020 20:05:28 +0000 (20:05 +0000)]
Fix some memory leak in MLIRContext with respect to registered types/attributes interfaces
Differential Revision: https://reviews.llvm.org/D83618
Craig Topper [Sat, 11 Jul 2020 19:21:41 +0000 (12:21 -0700)]
[X86] Add test cases for missed opportunities to use vpternlog due to a bitcast between the logic ops.
These test cases fail to use vpternlog because the AND was converted
to a blend shuffle and then converted back to AND during shuffle lowering.
This results in the AND having a different type than it started with.
This prevents our custom matching logic from seeing the two logic ops.
Stephen Neuendorffer [Sat, 11 Jul 2020 18:47:07 +0000 (11:47 -0700)]
[examples] fix ExceptionDemo
Code didn't compile in a release build. Guard debug output with
ifndef NDEBUG.
Differential Revision: https://reviews.llvm.org/D83628
clementval [Sat, 11 Jul 2020 16:59:14 +0000 (12:59 -0400)]
[openmp] Remove unused variable in DirectiveEmitter
Johannes Doerfert [Sat, 11 Jul 2020 16:57:17 +0000 (11:57 -0500)]
[OpenMP] Silence unused symbol warning with proper ifdefs
Yaxun (Sam) Liu [Sat, 11 Jul 2020 14:04:27 +0000 (10:04 -0400)]
Fix regression due to test hip-version.hip
Added RocmInstallationDetector to Darwin and MinGW.
Fixed duplicate ROCm detector in ROCm toolchain.
Valentin Clement [Sat, 11 Jul 2020 16:42:05 +0000 (12:42 -0400)]
[flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.
Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert
Reviewed By: DavidTruby, ichoyjx
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83326
Yash Jain [Sat, 11 Jul 2020 15:24:18 +0000 (20:54 +0530)]
[MLIR] Parallelize affine.for op to 1-D affine.parallel op
Introduce pass to convert parallel affine.for op into 1-D affine.parallel op.
Run using --affine-parallelize. Removes test-detect-parallel: pass for checking
parallel affine.for ops.
Signed-off-by: Yash Jain <yash.jain@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D83193
Michael Liao [Sat, 11 Jul 2020 14:09:09 +0000 (10:09 -0400)]
Fix `-Wunused-variable` warnings. NFC.
Michael Liao [Fri, 10 Jul 2020 14:56:28 +0000 (10:56 -0400)]
[fix-irreducible] Skip unreachable predecessors.
Summary:
- Skip unreachable predecessors during header detection in SCC. Those
unreachable blocks would be generated in the switch lowering pass in
the corner cases or other frontends. Even though they could be removed
through the CFG simplification, we should skip them during header
detection.
Reviewers: sameerds
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83562
sstefan1 [Sat, 11 Jul 2020 12:24:56 +0000 (14:24 +0200)]
[Attributor][NFC] Add more debug output for deleted functions
Christudasan Devadasan [Fri, 10 Jul 2020 18:49:51 +0000 (00:19 +0530)]
[AMDGPU] Move LowerSwitch pass to CodeGenPrepare.
It is possible that LowerSwitch pass leaves certain blocks
unreachable from the entry. If not removed, these dead blocks
can cause undefined behavior in the subsequent passes.
It caused a crash in the AMDGPU backend after the instruction
selection when a PHI node has its incoming values coming from
these unreachable blocks.
In the AMDGPU pass flow, the last invocation of UnreachableBlockElim
precedes where LowerSwitch is currently placed and eventually
missed out on the opportunity to get these blocks eliminated.
This patch ensures that LowerSwitch pass get inserted earlier
to make use of the existing unreachable block elimination pass.
Reviewed By: sameerds, arsenm
Differential Revision: https://reviews.llvm.org/D83584
Alexey Lapshin [Fri, 19 Jun 2020 20:55:05 +0000 (23:55 +0300)]
[TRE] allow TRE for non-capturing calls.
The current implementation of Tail Recursion Elimination has a very restricted
pre-requisite: AllCallsAreTailCalls. i.e. it requires that no function
call receives a pointer to local stack. Generally, function calls that
receive a pointer to local stack but do not capture it - should not
break TRE. This fix allows us to do TRE if it is proved that no pointer
to the local stack is escaped.
Reviewed by: efriedma
Differential Revision: https://reviews.llvm.org/D82085
Roman Lebedev [Sat, 11 Jul 2020 10:52:33 +0000 (13:52 +0300)]
Revert "Reland "[InstCombine] Lower infinite combine loop detection thresholds"""
And there's a new hit: https://bugs.llvm.org/show_bug.cgi?id=46680
This reverts commit
7103c87596efccd532e9fe04a6ba6a200fed8481.
Nico Weber [Sat, 11 Jul 2020 10:43:28 +0000 (06:43 -0400)]
[gn build] (manually) merge
943660fd15f193
Nathan James [Sat, 11 Jul 2020 10:42:05 +0000 (11:42 +0100)]
Reland Fix gn build after 943660f
Nathan James [Sat, 11 Jul 2020 09:45:17 +0000 (10:45 +0100)]
Revert "Fix gn builds after
943660fd1"
This reverts commit
4abdcdb45ee22d77dd64a71cb41e967d35361280.
Nathan James [Sat, 11 Jul 2020 09:42:57 +0000 (10:42 +0100)]
Fix gn builds after
943660fd1
Nathan James [Sat, 11 Jul 2020 09:10:59 +0000 (10:10 +0100)]
[clang-tidy] Reworked enum options handling(again)
Reland b9306fd after fixing the issue causing mac builds to fail unittests.
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
Johannes Doerfert [Sat, 11 Jul 2020 07:36:07 +0000 (02:36 -0500)]
[OpenMP][FIX] remove unused variable and long if-else chain
MSVC throws an error if you use "too many" if-else in a row:
`Frontend/OpenMP/OMPKinds.def(570): fatal error C1061: compiler limit:
blocks nested too deeply`
We work around it now...
Mehdi Amini [Sat, 11 Jul 2020 07:17:28 +0000 (07:17 +0000)]
Remove unused variable `KMPC_KERNEL_PARALLEL_WORK_FN_PTR_ARG_NO` (NFC)
This fixes a compiler warning.
Johannes Doerfert [Tue, 7 Jul 2020 00:57:37 +0000 (19:57 -0500)]
[OpenMP] Replace function pointer uses in GPU state machine
In non-SPMD mode we create a state machine like code to identify the
parallel region the GPU worker threads should execute next. The
identification uses the parallel region function pointer as that allows
it to work even if the kernel (=target region) and the parallel region
are in separate TUs. However, taking the address of a function comes
with various downsides. With this patch we will identify the most common
situation and replace the function pointer use with a dummy global
symbol (for identification purposes only). That means, if the parallel
region is only called from a single target region (or kernel), we do not
use the function pointer of the parallel region to identify it but a new
global symbol.
Fixes PR46450.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D83271
Johannes Doerfert [Tue, 7 Jul 2020 00:26:01 +0000 (19:26 -0500)]
[OpenMP] Compute a proper module slice for the CGSCCC pass
The module slice describes which functions we can analyze and transform
while working on an SCC as part of the CGSCC OpenMPOpt pass. So far, we
simply restricted it to the SCC. In a follow up we will need to have a
bigger scope which is why this patch introduces a proper identification
of the module slice. In short, everything that has a transitive
reference to a function in the SCC or is transitively referenced by one
is fair game.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D83270
Johannes Doerfert [Tue, 7 Jul 2020 00:19:12 +0000 (19:19 -0500)]
[OpenMP] Identify GPU kernels (aka. OpenMP target regions)
We now identify GPU kernels, that is entry points into the GPU code.
These kernels (can) correspond to OpenMP target regions. With this patch
we identify and on request print them via remarks.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D83269
Johannes Doerfert [Tue, 7 Jul 2020 00:30:14 +0000 (19:30 -0500)]
[OpenMP][NFC] Add convenient helper and early exit check
Johannes Doerfert [Tue, 7 Jul 2020 00:29:23 +0000 (19:29 -0500)]
[OpenMP][NFC] Fix some typos
Johannes Doerfert [Tue, 7 Jul 2020 00:13:37 +0000 (19:13 -0500)]
[OpenMP][NFC] Remove unused (always fixed) arguments
There are various runtime calls in the device runtime with unused, or
always fixed, arguments. This is bad for all sorts of reasons. Clean up
two before as we match them in OpenMPOpt now.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D83268
Eric Christopher [Sat, 11 Jul 2020 05:52:04 +0000 (22:52 -0700)]
Fix signed vs unsigned comparison warnings a different way.
Johannes Doerfert [Fri, 10 Jul 2020 21:45:02 +0000 (16:45 -0500)]
[OpenMP][CUDA] Fix std::complex in GPU regions
The old way worked to some degree for C++-mode but in C mode we actually
tried to introduce variants of macros (e.g., isinf). To make both modes
work reliably we get rid of those extra variants and directly use NVIDIA
intrinsics in the complex implementation. While this has to be revisited
as we add other GPU targets which want to reuse the code, it should be
fine for now.
Reviewed By: tra, JonChesterfield, yaxunl
Differential Revision: https://reviews.llvm.org/D83591
Jonas Devlieghere [Sat, 11 Jul 2020 04:14:06 +0000 (21:14 -0700)]
[lldb/Test] Fix missing yaml2obj in Xcode standalone build.
Rather than trying to find the yaml2obj from dotest we should pass it in
like we do for dsymutil and FileCheck.
Yaxun (Sam) Liu [Wed, 1 Jul 2020 04:00:04 +0000 (00:00 -0400)]
[HIP] Fix rocm detection
Do not detect device library by default in rocm detector.
Only detect device library in Rocm and HIP toolchain.
Separate detection of HIP runtime and Rocm device library.
Detect rocm path by version file in host toolchains.
Also added detecting rocm version and printing rocm
installation path and version with -v.
Fixed include path and device library detection for
ROCm 3.5.
Added --hip-version option. Renamed --hip-device-lib-path
to --rocm-device-lib-path.
Fixed default value for -fhip-new-launch-api.
Added default -std option for HIP.
Differential Revision: https://reviews.llvm.org/D82930
Wang, Pengfei [Fri, 10 Jul 2020 06:12:24 +0000 (14:12 +0800)]
[X86][MMX] Optimize MMX shift intrinsics.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D83534
Jinsong Ji [Sat, 11 Jul 2020 02:23:40 +0000 (02:23 +0000)]
[PowerPC][MachinePipeliner] Enable pipeliner if hasInstrSchedModel
P9 is the only one with InstrSchedModel, but we may have more in the
future, we should not hardcoded it to P9, check hasInstrSchedModel
instead.
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D83590
Ben Shi [Sat, 11 Jul 2020 01:32:57 +0000 (18:32 -0700)]
[RISCV][test] Add a test for (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2) transformation
Reviewed By: lenary, MaskRay
Differential Revision: https://reviews.llvm.org/D83159
Vy Nguyen [Fri, 10 Jul 2020 03:19:06 +0000 (23:19 -0400)]
Summary: [clang] Provide a way for WhileStmt to report the location of its LParen and RParen.
Summary: This helps avoiding hacks downstream.
Reviewers: shafik
Subscribers: martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83529
Thomas Lively [Sat, 11 Jul 2020 01:27:52 +0000 (18:27 -0700)]
[WebAssembly] Prefer v128.const for constant splats
In BUILD_VECTOR lowering, we used to generally prefer using splats
over v128.const instructions because v128.const has a very large
encoding. However, in
d5b7a4e2e8 we switched to preferring consts
because they are expected to be more efficient in engines. This patch
updates the ISel patterns to match this current preference.
Differential Revision: https://reviews.llvm.org/D83581
Valentin Clement [Sat, 11 Jul 2020 00:57:00 +0000 (20:57 -0400)]
[openmp] Fix warning in generated OMP.cpp
Mauricio Sifontes [Sat, 11 Jul 2020 00:46:55 +0000 (00:46 +0000)]
Create TestReducer pass
- Create a pass that generates bugs based on trivially defined behavior for the purpose of testing the MLIR Reduce Tool.
- Implement the functionality inside the pass to crash mlir-opt in the presence of an operation with the name "crashOp".
- Register the pass as a test pass in the mlir-opt tool.
Reviewed by: jpienaar
Differential Revision: https://reviews.llvm.org/D83422
Akira Hatanaka [Sat, 11 Jul 2020 00:40:30 +0000 (17:40 -0700)]
Fix build error
sstefan1 [Fri, 10 Jul 2020 23:06:46 +0000 (01:06 +0200)]
Reland "[OpenMPOpt] ICV Tracking"
This reverts commit
1d542f0ca83fa1411d6501a8d088450d83abd5b8.
`recollectUses()` is added to prevent looking at dead uses after
Attributor run.
This is the first and most basic ICV Tracking implementation. For this
first version, we only support deduplication within the same BB.
Reviewers: jdoerfert, JonChesterfield, hamax97, jhuber6, uenoku,
baziotis, lebedev.ri
Differential Revision: https://reviews.llvm.org/D81788
Akira Hatanaka [Sat, 11 Jul 2020 00:24:12 +0000 (17:24 -0700)]
[CodeGen] Store the return value of the target function call to the
thunk's return value slot directly when the return type is an aggregate
instead of doing so via a temporary
This fixes PR45997 (https://bugs.llvm.org/show_bug.cgi?id=45997), which
is caused by a bug that has existed since we started passing and
returning C++ structs with ObjC strong pointer members (see
https://reviews.llvm.org/D44908) or structs annotated with trivial_abi
directly.
rdar://problem/
63740936
Differential Revision: https://reviews.llvm.org/D82513
Sanjay Patel [Fri, 10 Jul 2020 22:56:26 +0000 (18:56 -0400)]
[InstSimplify] add tests for maxnum (PR46627); NFC
Adrian Prantl [Sat, 11 Jul 2020 00:09:39 +0000 (17:09 -0700)]
Fix nesting of #ifdef
This fixes a compile error when building for an arm64 host.
Differential Revision: https://reviews.llvm.org/D83582
Valentin Clement [Sat, 11 Jul 2020 00:11:11 +0000 (20:11 -0400)]
[openmp] Remove OMPConstants.cpp and replace it by OMP.cpp generated by tablegen
Summary:
Diff D83176 moved the last piece of code from OMPConstants.cpp and now this file was only
useful to include the tablegen generated file. This patch replace OMPConstants.cpp with OMP.cpp
generated by tablegen.
Reviewers: sstefan1, jdoerfert, jdenny
Reviewed By: sstefan1
Subscribers: mgorny, yaxunl, hiraditya, guansong, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83583
Johannes Doerfert [Tue, 7 Jul 2020 21:44:33 +0000 (16:44 -0500)]
[OpenMP][NFC] Remove unused and untested code from the device runtime
Summary:
We carried a lot of unused and untested code in the device runtime.
Among other reasons, we are planning major rewrites for which reduced
size is going to help a lot.
The number of code lines reduced by 14%!
Before:
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
CUDA 13 489 841 2454
C/C++ Header 14 322 493 1377
C 12 117 124 559
CMake 4 64 64 262
C++ 1 6 6 39
-------------------------------------------------------------------------------
SUM: 44 998 1528 4691
-------------------------------------------------------------------------------
After:
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
CUDA 13 366 733 1879
C/C++ Header 14 317 484 1293
C 12 117 124 559
CMake 4 64 64 262
C++ 1 6 6 39
-------------------------------------------------------------------------------
SUM: 44 870 1411 4032
-------------------------------------------------------------------------------
Reviewers: hfinkel, jhuber6, fghanim, JonChesterfield, grokos, AndreyChurbanov, ye-luo, tianshilei1992, ggeorgakoudis, Hahnfeld, ABataev, hbae, ronlieb, gregrodgers
Subscribers: jvesely, yaxunl, bollu, guansong, jfb, sstefan1, aaron.ballman, openmp-commits, cfe-commits
Tags: #clang, #openmp
Differential Revision: https://reviews.llvm.org/D83349
Zequan Wu [Fri, 26 Jun 2020 03:35:03 +0000 (20:35 -0700)]
[COFF] Add cg_profile directive and .llvm.call-graph-profile section
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83597
Walter Erquinigo [Sat, 11 Jul 2020 00:05:23 +0000 (17:05 -0700)]
Revert "[lldb-vscode] Fix TestVSCode_module"
This reverts commit
881af6eb0030986876d3b80668193e5c3c04a87c.
Revert "[lldb-vscode] Add Compile Unit List to Modules View"
This reverts commit
03ef61033ff5e1e40518f14f642e4ad8d686974c.
Revert "[lldb-vscode] Add Support for Module Event"
This reverts commit
f7f80159753ba725f7e32529fcc369bc358efbb3.
The debian buildbot has reported issues with the modules test.
http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/13767/steps/test/logs/stdio
Reverting it for now.