Craig Topper [Fri, 7 Feb 2020 05:31:44 +0000 (21:31 -0800)]
[X86] Turn vXi1 any_extends into sign_extends in PreprocessISelDAG and remove some isel patterns.
Similar to what we do for other vector any_extends, but instead
of zero_extend we need to use sign_extend.
Craig Topper [Fri, 7 Feb 2020 03:29:03 +0000 (19:29 -0800)]
[X86] Use SelectionDAG::getAllOnesConstant to simplify some code. NFC
Jason Molenda [Fri, 7 Feb 2020 04:28:40 +0000 (20:28 -0800)]
Except, get the TARGET_OS_OSX check correct.
Jason Molenda [Fri, 7 Feb 2020 04:28:06 +0000 (20:28 -0800)]
Fix my use of the TARGET_OS_OSX TargetConditional.
Justin Lebar [Wed, 8 Jan 2020 05:16:36 +0000 (21:16 -0800)]
Clarify how llvm-mca detects att vs intel syntax.
Reviewers: andreadb
Subscribers: tschuett, gbedwell, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72385
Matt Arsenault [Fri, 7 Feb 2020 01:33:47 +0000 (20:33 -0500)]
AMDGPU/GlobalISel: Fix non-pow-2 add/sub/mul for 16-bit insts
These wouldn't legalize between 16-bits and 32-bits on targets with
16-bit instructions.
Douglas Yung [Fri, 7 Feb 2020 02:17:04 +0000 (18:17 -0800)]
Fix test after test changes added in da3dc00 caused the test to break
on platforms that default to an older C standard (like the PS4).
This should fix the test failure on the PS4 bots.
River Riddle [Fri, 7 Feb 2020 02:05:32 +0000 (18:05 -0800)]
[mlir][AsmPrinter] Fix edge case when printing floating point values.
Summary: In some edge cases the default APFloat printer will generate something that we can't parse back in. In these cases, fallback to using hex instead.
Differential Revision: https://reviews.llvm.org/D74181
Jordan Rupprecht [Fri, 7 Feb 2020 01:48:06 +0000 (17:48 -0800)]
Revert "[Clang][Driver] Remove -M group options ..." and "[Clang] Avoid crashing when generating crash diagnostics when '#pragma clang __debug ..."
This reverts commits
f41ec709d9d388dc43469e6ac7f51b6313f7e4af and
5fedc2b410853a6aef05e8edf19ebfc4e071e28f. On some buildbots, Clang :: Driver/crash-report.c is broken with:
```
Command Output (stderr):
--
/home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm-project/clang/test/Driver/crash-report.c:48:11: error: CHECK: expected string not found in input
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
^
<stdin>:1:1: note: scanning from here
/home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm-project/clang/test/Driver/crash-report.c:50:1: error: unknown type name 'BAZ'
```
Example: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/21321/steps/test-stage1-compiler/logs/stdio
River Riddle [Fri, 7 Feb 2020 01:55:14 +0000 (17:55 -0800)]
[mlir][DialectConversion] Change erroneous return to a continue
This fixes a nasty bug where the loop would return prematurely when
notifying the argument converter that an operation was removed.
Peter Collingbourne [Thu, 6 Feb 2020 19:18:23 +0000 (11:18 -0800)]
Update hwasan docs to cover outlined checks and globals.
Differential Revision: https://reviews.llvm.org/D74150
Stanislav Mekhanoshin [Thu, 6 Feb 2020 22:47:10 +0000 (14:47 -0800)]
[AMDGPU] Cleanup assumptions about generated subregs
We are using countPopulation on a LaneBitmask to determine
a number of registers it covers. This is the assumption which
does not necessarily need to be true. It is not changed but
factored into a single call SIRegisterInfo::getNumCoveredRegs().
Some other places are cleaned up with respect to assumptions
about subreg indexes values and tablegen behavior.
Differential Revision: https://reviews.llvm.org/D74177
Stanislav Mekhanoshin [Fri, 7 Feb 2020 01:38:55 +0000 (17:38 -0800)]
Revert "AMDGPU: Limit the search in finding the instruction pattern for v_swap generation."
This reverts commit
982780648124243131c6617c0d97fc1cb02d4e75.
Jason Molenda [Fri, 7 Feb 2020 01:27:56 +0000 (17:27 -0800)]
Add final description of why attach failed with poss error string.
Craig Topper [Fri, 7 Feb 2020 00:23:54 +0000 (16:23 -0800)]
Recommit "[FPEnv][X86] Platform-specific builtin constrained FP enablement"
With REQUIRES: x86-register-target added to the tests.
Also remove some unneeded FIXMEs
But add a FIXME for bad IR generation for FMADDSUB/FMSUBADD with
constrained FP.
Original patch by Kevin P. Neal
Changpeng Fang [Fri, 7 Feb 2020 00:40:21 +0000 (16:40 -0800)]
AMDGPU: Limit the search in finding the instruction pattern for v_swap generation.
Summary:
Current implementation of matchSwap in SIShrinkInstructions searches the entire
use_nodbg_operands set to find the possible pattern to generate v_swap instruction.
This approach will lead to a O(N^3) in compile time for SIShrinkInstructions.
But in reality, the matching pattern only exists within nearby instructions in the
same basic block. This work limits the search to a maximum of 16 instructions, and has
a linear compile time comsumption.
Reviewers:
rampitec, arsenm
Differential Revision: https://reviews.llvm.org/D74180
Richard Smith [Fri, 7 Feb 2020 00:19:37 +0000 (16:19 -0800)]
C++ DR2026: static storage duration variables are not zeroed before
constant initialization.
Removing this zeroing regressed our code generation in a few cases, also
fixed here. We now compute whether a variable has constant destruction
even if it doesn't have a constant initializer, by trying to destroy a
default-initialized value, and skip emitting a trivial default
constructor for a variable even if it has non-trivial (but perhaps
constant) destruction.
Jessica Paquette [Fri, 7 Feb 2020 00:30:13 +0000 (16:30 -0800)]
Revert "[AArch64][GlobalISel] Emit TBNZ with G_BRCOND where the condition is SLT"
This reverts commit
a3738414072900ace9cbbe209d0195a3443d1d54.
It looks like this broke set_shadow_test.c, so I'm reverting until I can fix it.
I also reverted the SGT change because it's probably also broken.
Jessica Paquette [Fri, 7 Feb 2020 00:29:00 +0000 (16:29 -0800)]
Revert "[AArch64][GlobalISel] Emit TBZ for SGT cond branches against -1"
This reverts commit
d78cefb1601070cb028b61bbc1bd6f25a9c1837c.
One of this and the SLT change broke set_shadow_test.c, so I'm reverting until
I can fix it.
Alexandre Ganea [Fri, 7 Feb 2020 00:23:27 +0000 (19:23 -0500)]
[Support] When using SEH, create a impl instance for CrashRecoveryContext. NFCI.
Previously, the SEH codepath in CrashRecoveryContext didn't create a CrashRecoveryContextImpl. The other codepaths (VEH and Unix) were creating it.
When running with -fintegrated-cc1, this is needed to handle exit() as a jump to CrashRecoveryContext's exception filter, through a call to RaiseException. In that situation, we need a user-defined exception code, which is later interpreted as an exit() by the exception filter. This in turn needs to set RetCode accordingly, *inside* the exception filter, and *before* calling HandleCrash().
Differential Revision: https://reviews.llvm.org/D74078
Kevin P. Neal [Thu, 6 Feb 2020 23:58:24 +0000 (18:58 -0500)]
Revert "[FPEnv][X86] Platform-specific builtin constrained FP enablement"
This reverts commit
208470dd5d0a46bc3c24b66489b687eda4954262.
Tests fail:
error: unable to create target: 'No available targets are compatible with triple "x86_64-apple-darwin"'
This happens on clang-hexagon-elf, clang-cmake-armv7-quick, and
clang-cmake-armv7-quick bots.
If anyone has any suggestions on why then I'm all ears.
Differential Revision: https://reviews.llvm.org/D73570
Revert "[FPEnv][X86] Speculative fix for failures introduced by
eda495426."
This reverts commit
80e17e5fcc09dc5baa940022e6988fcb08c5d92d.
The speculative fix didn't solve the test failures on Hexagon, ARMv6, and
MSVC AArch64.
Jason Molenda [Fri, 7 Feb 2020 00:15:03 +0000 (16:15 -0800)]
Detect attach fail in debugserver due to non-interactive
debug session.
Jonas Devlieghere [Thu, 6 Feb 2020 23:26:10 +0000 (15:26 -0800)]
[CMake] Rename EXCLUDE_FROM_ALL and make it an argument to add_lit_testsuite
EXCLUDE_FROM_ALL means something else for add_lit_testsuite as it does
for something like add_executable. Distinguish between the two by
renaming the variable and making it an argument to add_lit_testsuite.
Differential revision: https://reviews.llvm.org/D74168
Huihui Zhang [Thu, 6 Feb 2020 23:27:10 +0000 (15:27 -0800)]
Revert "Reland "[AArch64] Fix data race on RegisterBank initialization.""
This reverts commit
8e1ca948ccfdf0ead90adf63d6127f56d9d46586.
New failing at
http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/25929
I did reproduce and pass the previous failure at
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/46803/steps/annotate/logs/stdio
Huihui Zhang [Thu, 6 Feb 2020 23:01:57 +0000 (15:01 -0800)]
Reland "[AArch64] Fix data race on RegisterBank initialization."
Update lambda function argument "[this](const auto &TRI)" with
[this](const TargetRegisterInfo &TRI).
Looks like a bug in g++-6, there is no issue compiling using g++-9.
Evgenii Stepanov [Thu, 6 Feb 2020 23:07:20 +0000 (15:07 -0800)]
Fix MSAN failure on Function destruction
Summary:
When Function is destroyed, GlobalValue base class is destroyed, then
Value destructor would call use_empty, which ultimately attempts to
downcast 'this' to GlobalValue. This is UB, and is caught my MSAN as
accessing uninitialized memory.
Call materialized_use_empty, which doesn't call
assertModuleIsMaterializedImpl().
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74161
Patch by Antonio Maiorano.
Amara Emerson [Thu, 6 Feb 2020 22:35:15 +0000 (14:35 -0800)]
[GlobalISel] Use G_ZEXTLOAD instead of an anyextending load for non-pow-2 legalization.
Fixes PR43288
Jonas Devlieghere [Thu, 6 Feb 2020 20:36:07 +0000 (12:36 -0800)]
[lldb/Reproducers] Add missing strings for redirect macro
Jonas Devlieghere [Thu, 6 Feb 2020 19:08:32 +0000 (11:08 -0800)]
[lldb/Reproducers] Refactor GetStopReasonExtendedBacktraces (NFC)
Refactore GetStopReasonExtendedBacktraces so that the reproducer macro
is passed an instrumented copy constructor rather than the constructor
taking a ThreadCollectionSP, which is not instrumented.
Petr Hosek [Thu, 6 Feb 2020 21:55:28 +0000 (13:55 -0800)]
Revert "[CMake] Link against ZLIB::ZLIB"
This reverts commit
00b3d49d3a86490f0596100b23cd2c3a49334c75 as this
broke the llvm-config output.
Dimitry Andric [Thu, 6 Feb 2020 21:46:35 +0000 (22:46 +0100)]
[compiler-rt] clang-format FreeBSD-specific sanitizer sources
Formatting only, no functional change intended.
Craig Topper [Thu, 6 Feb 2020 21:33:59 +0000 (13:33 -0800)]
[X86] Add the rest of the tests that were supposed to go with
90c31b0f428fe911255277a60782ea9114700475
I forgot to git add them when applying the patch from phab.
Craig Topper [Thu, 6 Feb 2020 21:10:32 +0000 (13:10 -0800)]
[X86] Use MVT::i8 instead of MVT::i64 for shift amount in BuildSDIVPow2
X86 uses i8 for shift amounts. This code can fail on a 32-bit target
if it runs after type legalization.
This code was copied from AArch64 and modified for X86, but the
shift amount wasn't changed to the correct type for X86.
Fixes PR44812
Saar Raz [Thu, 6 Feb 2020 21:19:18 +0000 (23:19 +0200)]
[Concepts] Fix incorrect check when instantiating abbreviated template type-constraints
We would incorrectly check whether the type-constraint had already been initialized, causing us
to ignore the invented template type constraints entirely.
Also, TemplateParameterList would store incorrect information about invented type parameters
when it observed them before their type-constraint was initialized, so we recreate it after
initializing the function type of an abbreviated template.
Alexandre Ganea [Thu, 6 Feb 2020 21:23:25 +0000 (16:23 -0500)]
[Clang][Driver] Remove -M group options before generating crash diagnostics
Previously, when using '-MF file.d' on the command line, 'file.d' would not be deleted after a compiler crash.
The code path in Compilation::initCompilationForDiagnostics() that was modifying 'TranslatedArgs' had no effect, because 'TCArgs' was already created after the crash.
This was covered by clang/test/Driver/output-file-cleanup.c, the test was succeeding by fluke because Driver::generateCompilationDiagnostics() would fail to launch the subsequent clang -E (see D74070 for a fix for this). So the test was only covering Driver.cpp, C.CleanupFileMap().
After this patch, both cleanup and removal of -MF are exercised.
Differential Revision: https://reviews.llvm.org/D74076
Alexandre Ganea [Thu, 6 Feb 2020 20:47:42 +0000 (15:47 -0500)]
[Clang] Avoid crashing when generating crash diagnostics when '#pragma clang __debug [assert|crash|parser_crash|llvm_fatal_error|llvm_unreachable|overflow_stack]' are used
Previously, when the above '#pragma clang __debug' were used, Driver::generateCompilationDiagnostics() wouldn't work as expected.
The 'clang -E' process created for diagnostics would crash, because it would reach again the intended crash in Pragma.cpp, PragmaDebugHandler::HandlePragma() while preprocessing.
When generating crash diagnostics, we now disable the intended crashing behavior with a new cc1 flag -disable-pragma-debug-crash.
Notes:
- #pragma clang __debug llvm_report_fatal isn't currently tested by crash-report.c, because it needs exit() to be handled differently in -fintegrated-cc1 mode. See https://reviews.llvm.org/D73742 for an upcoming fix.
- This is also needed to further validate that -MF is removed from the 'clang -E ' crash diagnostic cmd-line (currently not the case). See https://reviews.llvm.org/D74076 for an upcoming fix.
Differential Revision: https://reviews.llvm.org/D74070
Stella Stamenova [Thu, 6 Feb 2020 20:31:57 +0000 (12:31 -0800)]
[lldb\utils] Place lldb-repro in a per-configuration directory to support multi-configuration generators
Summary: Currently, lldb-repro is placed in the wrong location for multi-configuration generators. For example, in the case of VS, it is placed in a directory $(Configuration) instead of in each of Debug, Release, etc.
Reviewers: JDevlieghere
Reviewed By: JDevlieghere
Subscribers: mgorny, lldb-commits, asmith
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74148
Kevin P. Neal [Thu, 6 Feb 2020 20:24:02 +0000 (15:24 -0500)]
[FPEnv][X86] Speculative fix for failures introduced by
eda495426.
Differential Revision: https://reviews.llvm.org/D73570
Alexandre Ganea [Thu, 6 Feb 2020 20:25:26 +0000 (15:25 -0500)]
[Clang] Remove unused #pragma clang __debug handle_crash
As discussed in D70568, remove this because it isn't used anywhere, and I think it's better to go through real crashes for testing (#pragma clang __debug crash).
Also remove the support function llvm::CrashRecoveryContext::HandleCrash() which was added at the same time by @ddunbar.
Differential Revision: https://reviews.llvm.org/D74063
Richard Smith [Thu, 6 Feb 2020 03:01:33 +0000 (19:01 -0800)]
PR44684: Look through parens and similar constructs when determining
whether a call is to a builtin.
We already had a general mechanism to do this but for some reason
weren't using it. In passing, check for the other unary operators that
can intervene in a reasonably-direct function call (we already handled
'&' but missed '*' and '+').
This reverts commit
aaae6b1b617378362462c1685e754813ed82b394,
reinstating
af80b8ccc5772c14920d4554b7ca7e15f2fad1c4, with a fix to
clang-tidy.
Michael Liao [Thu, 6 Feb 2020 14:52:01 +0000 (09:52 -0500)]
[clang][driver] Clean up unnecessary reference to TC. NFC.
Jessica Paquette [Thu, 6 Feb 2020 17:56:09 +0000 (09:56 -0800)]
[AArch64][GlobalISel] Emit TBZ for SGT cond branches against -1
When we have a G_BRCOND fed by a sgt compare against -1, we can just emit a TBZ.
This is similar to the code in `AArch64TargetLowering::LowerBR_CC`.
Also while we're here, properly scope the commutative constant check in
`selectCompareBranch`, since it sometimes would call
`getConstantVRegValWithLookThrough` twice.
Differential Revision: https://reviews.llvm.org/D74149
Matt Arsenault [Thu, 6 Feb 2020 17:10:34 +0000 (12:10 -0500)]
AMDGPU: Add compile time hack for hasCFUser
Assume the control flow intrinsic results are never casted, and early
exit based on the type.
Konstantin Schwarz [Thu, 6 Feb 2020 18:01:57 +0000 (10:01 -0800)]
[GlobalISel] Legalize more G_FP(EXT|TRUNC) libcalls.
This adds a new helper function for retrieving the
floating point type corresponding to the specified
bit-width.
Fangrui Song [Wed, 5 Feb 2020 19:24:15 +0000 (11:24 -0800)]
[MC][ELF] Rename MC related "Associated" to "LinkedToSym"
"linked-to section" is used by the ELF spec. By analogy, "linked-to
symbol" is a good name for the signature symbol. The word "linked-to"
implies a directed edge and makes it clear its relation with "sh_link",
while one can argue that "associated" means an undirected edge.
Also, combine tests and add precise SMLoc to improve diagnostics.
Reviewed By: eugenis, grimar, jhenderson
Differential Revision: https://reviews.llvm.org/D74082
Kevin P. Neal [Thu, 6 Feb 2020 19:14:48 +0000 (14:14 -0500)]
[FPEnv][X86] Platform-specific builtin constrained FP enablement
When constrained floating point is enabled the X86-specific builtins don't
use constrained intrinsics in some cases. Fix that.
Differential Revision: https://reviews.llvm.org/D73570
Jan Kratochvil [Thu, 6 Feb 2020 19:04:23 +0000 (20:04 +0100)]
[lldb] [NFC] Refactor GetDWARFDeclContext to return DWARFDeclContext
Suggested by Pavel Labath.
Differential Revision: https://reviews.llvm.org/D73787
Pavel Labath [Thu, 6 Feb 2020 18:53:34 +0000 (10:53 -0800)]
[lldb] Explicitly qualify calls to std::static_pointer_cast
Due to a c++ quirk, these are found through ADL only when a function with that
name is found through regular lookup. We have one such function in SharingPtr.h,
but I am trying to remove it.
Med Ismail Bennani [Thu, 6 Feb 2020 18:46:19 +0000 (19:46 +0100)]
[lldb/Target] Remove extra semicolon in AssertFrameRecognizer (NFC)
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Craig Topper [Thu, 6 Feb 2020 18:42:11 +0000 (10:42 -0800)]
[X86] Custom isel floating point X86ISD::CMP on pre-CMOV targets. Eliminate ConvertCmpIfNecessary
If we don't have cmov, X87 compares write to FPSW and we need to
move the bits to EFLAGS to use as JCC/SETCC/CMOV conditions.
Previously this was done by calling ConvertCmpIfNecessary in
multiple places which would emit the extra code for the FNSTSW,
a shift, a truncate, and a SAHF instructions. Isel would then
select trunc+X86ISD::CMP to a FUCOM instruction that produces FPSW.
This patch centralizes all of the handling into a single custom
isel handler. This allows us to remove ConvertCmpIfNecessary and
a couple target specific ISD opcodes.
Differential Revision: https://reviews.llvm.org/D73863
Mitch Phillips [Thu, 6 Feb 2020 18:35:42 +0000 (10:35 -0800)]
[GWP-ASan] Use weak abort message definition.
Summary:
New shard out of the Check() function for GWP-ASan uses
android_set_abort_message. This is happily present on bionic Android,
but not Android for glibc host x86. Fix up to use the weak definition
always, so we don't have to worry.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: #sanitizers, llvm-commits, pcc, cferris
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74142
Hiroshi Yamauchi [Wed, 5 Feb 2020 18:02:12 +0000 (10:02 -0800)]
[PGO][PGSO] Enable profile guided size optimization for non-cold code under instrumentation PGO.
Summary:
This enables it for large working set size cases only.
This does not enable it under sample PGO.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74073
Stella Stamenova [Thu, 6 Feb 2020 18:27:10 +0000 (10:27 -0800)]
[lldb/tests] Correctly configure the lldb dotest arguments
Summary:
When the generator used for CMake is a multi-configuration generator (such as VS), the arguments passed to dotest are not currently configured correctly. There are a couple of issues:
1) The per-configuration files are all generated for the same configuration since the for loop overwrites the properties
2) Not all of the parameters are configured in the lit cfg, so they end up with %(build_mode)s as configuration and they point to non-existent paths
Reviewers: JDevlieghere
Reviewed By: JDevlieghere
Subscribers: mgorny, lldb-commits, asmith
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74093
Vedant Kumar [Thu, 6 Feb 2020 18:17:36 +0000 (10:17 -0800)]
[ubsan] Omit return value check when return block is unreachable
If the return block is unreachable, clang removes it in
CodeGenFunction::FinishFunction(). This removal can leave dangling
references to values defined in the return block if the return block has
successors, which it /would/ if UBSan's return value check is emitted.
In this case, as the UBSan check wouldn't be reachable, it's better to
simply not emit it.
rdar://
59196131
Craig Topper [Thu, 6 Feb 2020 17:42:01 +0000 (09:42 -0800)]
[X86] Remove SETB_C8r/SETB_C16r pseudo instructions. Use SETB_C32r and EXTRACT_SUBREG instead.
Only 32 and 64 bit SBB are dependency breaking instructons on some
CPUs. The 8 and 16 bit forms have to preserve upper bits of the GPR.
This patch removes the smaller forms and selects the wider form
instead. I had to do this with custom code as the tblgen generated
code glued the eflags copytoreg to the extract_subreg instead of
to the SETB pseudo.
Longer term I think we can remove X86ISD::SETCC_CARRY and use
(X86ISD::SBB zero, zero). We'll want to keep the pseudo and select
(X86ISD::SBB zero, zero) to either a MOV32r0+SBB for targets where
there is no dependency break and SETB_C32/SETB_C64 for targets
that have a dependency break. May want some way to avoid the MOV32r0
if the instruction that produced the carry flag happened to def a
register that we can use for the dependency.
I think the flag copy lowering should be using NEG instead of SUB to
handle SETB. That would avoid the MOV32r0 there. Or maybe it should
use a ADC with -1 to recreate the carry flag and keep the SETB?
That would avoid a MOVZX on the input of the SUB.
Differential Revision: https://reviews.llvm.org/D74024
Mitch Phillips [Thu, 6 Feb 2020 18:07:08 +0000 (10:07 -0800)]
[GWP-ASan] Fix PRNG to use IE TLS.
Summary:
GWP-ASan's PRNG didn't use Initial-Exec TLS. Fix that to ensure that we don't
have infinite recursion, and also that we don't allocate a DTV on Android when
GWP-ASan is touched.
Test coverage ensuring that the sample counter is UINT32_MAX for an
uninitialised GWP-ASan is provided by gwp_asan/tests/late_init.cpp.
Reviewers: pcc, cferris
Reviewed By: pcc
Subscribers: #sanitizers, llvm-commits, rprichard, eugenis
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74135
Pavel Labath [Thu, 6 Feb 2020 18:06:09 +0000 (10:06 -0800)]
[lldb] Remove reset(nullptr_t) overload from SharingPtr
std::shared_ptr has no such method. This makes the two more similar.
Matt Arsenault [Sat, 1 Feb 2020 16:29:41 +0000 (11:29 -0500)]
AMDGPU/GlobalISel: Avoid handling registers twice in waterfall loops
When multiple instructions are moved into a waterfall loop, it's
possible some of them re-use the same operands. Avoid creating
multiple sequences of readfirstlanes for them. None of the current
uses will hit this, but will be used in a future patch.
Peter Collingbourne [Thu, 6 Feb 2020 00:40:36 +0000 (16:40 -0800)]
scudo: Delete unused class ScudoByteMap. NFCI.
The class is only used in SizeClassAllocator32 in 64-bit mode, but we don't
use that class in 64-bit mode.
Differential Revision: https://reviews.llvm.org/D74099
Med Ismail Bennani [Tue, 4 Feb 2020 16:53:26 +0000 (17:53 +0100)]
[lldb/Target] Add Assert StackFrame Recognizer
When a thread stops, this checks depending on the platform if the top frame is
an abort stack frame. If so, it looks for an assert stack frame in the upper
frames and set it as the most relavant frame when found.
To do so, the StackFrameRecognizer class holds a "Most Relevant Frame" and a
"cooked" stop reason description. When the thread is about to stop, it checks
if the current frame is recognized, and if so, it fetches the recognized frame's
attributes and applies them.
rdar://
58528686
Differential Revision: https://reviews.llvm.org/D73303
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Michael Liao [Thu, 6 Feb 2020 17:19:55 +0000 (12:19 -0500)]
Fix warning on unused variables. NFC.
Chris Bowler [Thu, 6 Feb 2020 16:19:35 +0000 (11:19 -0500)]
[AIX] Implement caller arguments passed in stack memory.
This patch implements the caller side of placing function call arguments
in stack memory. This removes the current limitation where LLVM on AIX
will report fatal error when arguments can't be contained in registers.
There is a particular oddity that a float argument that passes in a
register and also in stack memory requires that the caller initialize
both. From what AIX "ABI" documentation I have it's not clear that this
needs to be done, however, it is necessary for compatibility with the
AIX XL compiler so I think it's best to implement it the same way.
Note a later patch will follow to address the callee side.
Differential Revision: https://reviews.llvm.org/D73209
Benjamin Kramer [Thu, 6 Feb 2020 17:03:15 +0000 (18:03 +0100)]
[mlir-tblgen] Stop leaking PredNodes
Technically a leak in tblgen is harmless, but this makes asan builds of
mlir very noisy. Just use a SpecificBumpPtrAllocator that knows how to
clean up after itself.
Mikhail Maltsev [Thu, 6 Feb 2020 16:49:45 +0000 (16:49 +0000)]
[ARM][MVE] Add fixed point vector conversion intrinsics
Summary:
This patch implements the following Arm ACLE MVE intrinsics:
* vcvtq_n_*
* vcvtq_m_n_*
* vcvtq_x_n_*
and two corresponding LLVM IR intrinsics:
* int_arm_mve_vcvt_fix (vcvtq_n_*)
* int_arm_mve_vcvt_fix_predicated (vcvtq_m_n_*, vcvtq_x_n_*)
Reviewers: simon_tatham, ostannard, MarkMurrayARM, dmgreen
Reviewed By: MarkMurrayARM
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74134
Mehdi Amini [Thu, 6 Feb 2020 16:42:55 +0000 (16:42 +0000)]
Revert "[mlir] Adds affine loop fusion transformation function to LoopFusionUtils."
This reverts commit
64871f778d528b34aabeae6286711a61ad9ea7ee.
ASAN indicates a use-after-free in in mlir::canFuseLoops(mlir::AffineForOp, mlir::AffineForOp, unsigned int, mlir::ComputationSliceState*) lib/Transforms/Utils/LoopFusionUtils.cpp:202:41
Petr Hosek [Thu, 6 Feb 2020 16:24:08 +0000 (08:24 -0800)]
Revert "[CMake] Passthrough CMAKE_SYSTEM_NAME to default builtin and runtimes target"
This reverts commit
491a4a7ac9e39fd4cc20a21e7da1961dfc7fc275 as it
broke the runtimes build on Darwin.
Haojian Wu [Thu, 6 Feb 2020 13:55:12 +0000 (14:55 +0100)]
[clangd] Set "spelled" flag for constructor references.
Summary:
DeclarationName for cxx constructor is special, it is not an identifier.
thus the "Spelled" flag are not set for all ctor references, this patch
fixes it.
Reviewers: kbobyrev
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74125
Sven van Haastregt [Thu, 6 Feb 2020 15:08:32 +0000 (15:08 +0000)]
[OpenCL] Reduce size of builtin function tables
Reduce the size of some of the TableGen'ed OpenCL builtin function
tables:
- Use bit fields for bools such that they are packed together. This
saves about 7kb.
- Use unsigned short for SignatureTable. This saves about 10kb.
Sjoerd Meijer [Thu, 6 Feb 2020 14:55:18 +0000 (14:55 +0000)]
[doc] typo in optimisation remark example
Fix typo in the vectorisation optimisation remarks example:
-Rpass-missed=loop-vectorized
=>
-Rpass-missed=loop-vectorize
Jeremy Morse [Wed, 5 Feb 2020 17:27:44 +0000 (17:27 +0000)]
Revert "[DebugInfo] Remove some users of DBG_VALUEs IsIndirect field"
This reverts commit
ed29dbaafa49bb8c9039a35f768244c394411fea.
I'm backing out D68945, which as the discussion for D73526 shows, doesn't
seem to handle the -O0 path through the codegen backend correctly. I'll
reland the patch when a fix is worked out, apologies for all the churn.
The two parent commits are part of this revert too.
Conflicts:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/DebugInfo/X86/dbg-addr-dse.ll
SelectionDAGBuilder conflict is due to a nearby change in
e39e2b4a79c6
that's technically unrelated. dbg-addr-dse.ll conflicted because
41206b61e30c (legitimately) changes the order of two lines.
There are further modifications to dbg-value-func-arg.ll: it landed after
the patch being reverted, and I've converted indirection to be represented
by the isIndirect field rather than DW_OP_deref.
Jeremy Morse [Wed, 5 Feb 2020 16:57:59 +0000 (16:57 +0000)]
Revert "[DebugInfo][DAG] Distinguish different kinds of location indirection"
This reverts commit
3137fe4d23eeb8df08c03e9111465325eeafe08e.
I'm backing out D68945, which this patch is a follow up for. It'll be
re-landed when D68945 is fixed.
The changes to dbg-value-func-arg.ll occur because our handling of certain
kinds of location now mixes up indirection that happens at different points
in a DIExpression. While this is a regression, it's a return to the prior
behaviour while a better patch is sought.
Jeremy Morse [Wed, 5 Feb 2020 15:19:00 +0000 (15:19 +0000)]
Revert "[SafeStack][DebugInfo] Insert DW_OP_deref in correct location"
This reverts commit
2d3174c4df6b5f4131346828d0a31675d80d6e2b.
The overall solution for this problem is reverting D68945, which wasn't
handling the -O0 path through the codegen backend correctly. See:
discussion in D73526.
Haojian Wu [Wed, 5 Feb 2020 11:31:11 +0000 (12:31 +0100)]
[clangd] don't rename on protobuf symbols.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74036
Sjoerd Meijer [Thu, 6 Feb 2020 14:36:48 +0000 (14:36 +0000)]
[ARM] peephole-bitcast test change. NFC.
This test case was XFAIL'ed because the peepholer was missing an optimisation.
But the peepholer is now able to handle this case, so enable this test. I will
close the corresponding and very old PR11364.
Sjoerd Meijer [Thu, 6 Feb 2020 14:13:31 +0000 (14:13 +0000)]
[RDA] getInstFromId: find instructions. NFC.
To find the instruction in the block for a given ID, first a count and then a
lookup was performed in the map, which is almost the same thing, thus doing
double the work.
Differential Revision: https://reviews.llvm.org/D73866
Sam Parker [Thu, 6 Feb 2020 13:53:09 +0000 (13:53 +0000)]
[ReachingDefs] Make isSafeToMove more strict.
Test that we're not moving the instruction through instructions with
side-effects.
Differential Revision: https://reviews.llvm.org/D74058
Michael Liao [Wed, 5 Feb 2020 01:28:30 +0000 (20:28 -0500)]
[clang][driver][ARM] Clean up ARM target & feature checking in clang driver.
Summary:
- Similar to other targets, instead of passing a toolchain, a driver
argument should be passed into `arm::getARMTargetFeatures`. Aslo, that
routine should honor the specified triple. Refactor
`arm::getARMFloatABI` with 2 separate interfaces. One has the original
parameters and the other uses the driver and the specified triple.
- That fixes an issue when target & features are queried during the
offload compilation, where the specified triple should be checked
instead of a effective triple. A previously failed test is re-enabled.
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74020
Raphael Isemann [Thu, 6 Feb 2020 13:36:09 +0000 (14:36 +0100)]
[lldb][NFC] Move call-overidden-method test to lang/cpp/ folder
Raphael Isemann [Thu, 6 Feb 2020 09:52:30 +0000 (10:52 +0100)]
[lldb] Add test for calling const functions
Clement Courbet [Thu, 6 Feb 2020 11:08:02 +0000 (12:08 +0100)]
[llvm-exegesis] Document `repetition-mode`.
Reviewers: gchatelet
Subscribers: tschuett, mstojanovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74114
Russell Gallop [Tue, 28 Jan 2020 16:05:13 +0000 (16:05 +0000)]
[LLD][ELF] Add time-trace to ELF LLD
This adds some of LLD specific scopes and picks up optimisation scopes
via LTO/ThinLTO. Makes use of TimeProfiler multi-thread support added in
77e6bb3c.
Differential Revision: https://reviews.llvm.org/D71060
Hans Wennborg [Thu, 6 Feb 2020 11:53:05 +0000 (12:53 +0100)]
Revert "[llvm-exegesis] Improve error reporting" and follow-up.
It broke e.g. all tests under tools/llvm-exegesis/X86/ when libpfm is
not available, see comment on D74085.
This reverts commit
b3576f60ebc8f660afad8120a72473be47517573 and
141915963b6ab36ee4e577d1b27673fa4d05b409.
Hans Wennborg [Thu, 6 Feb 2020 11:33:13 +0000 (12:33 +0100)]
Try to fix ilist.h after
529e6f8791b6
Hans Wennborg [Thu, 6 Feb 2020 11:27:02 +0000 (12:27 +0100)]
StringRef.h: __builtin_strlen seems to exist in VS 2017 MSVC 19.16 or later
This is a follow-up to
ff837aa63cd, as discussed on the llvm-commits
thread for that one.
Miloš Stojanović [Thu, 6 Feb 2020 10:03:15 +0000 (11:03 +0100)]
[llvm-exegesis] Improve error reporting in Target.cpp
Followup to D74085.
Replace the use of `report_fatal_error()` with returning the error to
`llvm-exegesis.cpp` and handling it there.
Differential Revision: https://reviews.llvm.org/D74113
Miloš Stojanović [Thu, 6 Feb 2020 09:48:41 +0000 (10:48 +0100)]
[llvm-exegesis] Improve error reporting
Fix inconsistencies in error reporting created by mixing
`report_fatal_error()` and `ExitOnErr()`, and add additional information
to the error message to make it more user friendly. Minimize the use
`report_fatal_error()` because it's meant for use in very rare cases and
it results in low information density of the error messages.
Summary of the new design:
* For command line argument errors output `llvm-exegesis: <error_message>`,
which is consistent with the error output format emitted by the backend
which checks correctness of the command line arguments.
* For other errors the format `llvm-exegesis error: <error_message>` is used.
** If the error occurred during file access `<error_message>` will have
of two parts: `'<file_name>': <rest_of_the_error_message>`
Differential Revision: https://reviews.llvm.org/D74085
Simon Pilgrim [Thu, 6 Feb 2020 11:22:06 +0000 (11:22 +0000)]
[ADT] Fix iplist_impl - use after move warnings (PR43943)
As detailed on PR43943, we're seeing static analyzer use after move warnings in the iplist_impl move constructor/operator as they call std::move to both the TraitsT and IntrusiveListT base classes.
As suggested by @dexonsmith this patch casts the moved value to the base classes to silence the warnings.
Differential Revision: https://reviews.llvm.org/D74062
Kirill Bobyrev [Thu, 6 Feb 2020 10:41:17 +0000 (11:41 +0100)]
Fix build after D74112
Kirill Bobyrev [Thu, 6 Feb 2020 09:28:47 +0000 (10:28 +0100)]
[clangd] Filter out implicit references while renaming
This patch is based on D72746 and prevents non-spelled references from
being renamed which would cause incorrect behavior otherwise.
Reviewed by: hokein
Differential Revision: https://reviews.llvm.org/D74112
Denis Antrushin [Mon, 27 Jan 2020 19:06:02 +0000 (22:06 +0300)]
[IRCE] Use SCEVExpander to modify loop bound
IRCE pass checks that it can calculate loop bounds by checking
SCEV availability at loop entry. However it is possible that loop
bound SCEV is loop invariant, but instruction used to compute it
resides within loop. In such case adjusting loop bound in preheader
using IRBuilder leads to malformed SSA.
Use SCEVExpander instead to generate proper instructions.
Reviewed-by: mkazantsev
Differential Revision: https://reviews.llvm.org/D73496
OuHangKresnik [Thu, 6 Feb 2020 09:25:55 +0000 (10:25 +0100)]
[mlir] Add AffineMaxOp
Differential Revision: https://reviews.llvm.org/D73848
Fangrui Song [Thu, 6 Feb 2020 09:21:49 +0000 (01:21 -0800)]
[llvm-readobj][test] Fix test after yaml2obj change (D74034)
Diogo Sampaio [Thu, 6 Feb 2020 08:54:30 +0000 (08:54 +0000)]
[ARM] Fix non-determenistic behaviour
Summary:
ARM Type Promotion pass does not clear
the container that defines if one variable
was visited or not, missing optimization
opportunities by luck when two llvm:Values
from different functions are allocated at
the same memory address.
Also fixes a comment and uses existing
method to pop and obtain last element
of the worklist.
Reviewers: samparker
Reviewed By: samparker
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73970
Miloš Stojanović [Thu, 6 Feb 2020 09:19:42 +0000 (10:19 +0100)]
[NFC] Fix error handling documentation
The default Error constructor can't be used since rL286561.
Differential Revision: https://reviews.llvm.org/D74069
Fangrui Song [Thu, 6 Feb 2020 09:14:42 +0000 (01:14 -0800)]
Fix lld test after D74034
Fangrui Song [Tue, 4 Feb 2020 18:45:07 +0000 (10:45 -0800)]
[yaml2obj] Refactor command line parsing
* Hide unrelated options.
* Add "OVERVIEW: " to yaml2obj -h/--help.
* Place options under a yaml2obj category.
* Disallow -docnum. Currently -docnum is the only yaml2obj specific long option that is affected.
* Specify `cl::init("-")` and `cl::Prefix` for OutputFilename. The
latter allows `-ofile`
Reviewed By: grimar, jhenderson
Differential Revision: https://reviews.llvm.org/D73982
Georgii Rymar [Wed, 5 Feb 2020 10:54:57 +0000 (13:54 +0300)]
[yaml2obj] - Change NameIndex to StName for Symbol.
It is consistent with the approach we use for Section struct.
Differential revision: https://reviews.llvm.org/D74034
Alexey Bader [Tue, 4 Feb 2020 11:05:16 +0000 (14:05 +0300)]
[SYCL][Driver] Add clang driver option to enable SYCL compilation mode
Summary:
As a first step this implementation enables compilation of the offload
code.
Reviewers: ABataev
Subscribers: ebevhan, Anastasia, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74048
Hans Wennborg [Thu, 6 Feb 2020 08:34:29 +0000 (09:34 +0100)]
Fix some typos in ArrayRef.h
Martin Storsjö [Wed, 5 Feb 2020 20:29:59 +0000 (22:29 +0200)]
[LLDB] Fix compilation with GCC 5
Differential Revision: https://reviews.llvm.org/D74084