Commit Graph

338643 Commits

Author SHA1 Message Date
Craig Topper 6a0564adcf [X86] Improve v4i32->v4f64 uint_to_fp for AVX1/AVX2 targets.
Use zext+or+fsub to do the conversion. Similar to D71971.

Differential Revision: https://reviews.llvm.org/D71971
2020-01-06 14:07:35 -08:00
Jonas Devlieghere 317cbdad4d [lldb/Docs] Describe optional dependencies on build page.
List the different CMake flags controlling the optional dependencies as
per the discussion on the mailing list:

http://lists.llvm.org/pipermail/lldb-dev/2020-January/015867.html
2020-01-06 13:59:24 -08:00
Craig Topper 62f3403bfc [LegalizeTypes] Add widening support for STRICT_FSETCC/FSETCCS
This patch adds widening which really just scalarizes because we don't have a strategy for the extra elements we would need to pad with.

Differential Revision: https://reviews.llvm.org/D72193
2020-01-06 13:45:55 -08:00
Craig Topper ca868002d3 [X86] Rename vec-strict-*-cmp.ll to vec-strict-cmp-*.ll to match other strict files wich have the size at the end. NFC 2020-01-06 13:45:55 -08:00
Alexey Bataev 7b518dcb29 [OPENMP50]Support lastprivate conditional updates in inc/dec unary ops.
Added support for checking of updates of variables used in unary
pre(pos) inc/dec expressions.
2020-01-06 16:37:01 -05:00
stevewan 02f694b69a [NFC] Test commit, revert whitespace change
As per the Developer Policy, upon obtaining commit access.
2020-01-06 16:28:13 -05:00
stevewan b73fea6a7c [NFC] Test commit, whitespace change
As per the Developer Policy, upon obtaining commit access.
2020-01-06 16:24:27 -05:00
Sanjay Patel 22cec48dac [x86] add tests for concat self + shuffle; NFC 2020-01-06 15:28:33 -05:00
Kelvin Li 19433b199d [OpenMP] Fix incorrect property of __has_attribute() macro
__has_attribute(fallthough) -> __has_attribute(fallthrough)

Submitted by: kiszk (Kazuaki Ishizaki <ishizaki@jp.ibm.com>)

Differential Revision: https://reviews.llvm.org/D72287
2020-01-06 15:00:10 -05:00
Evgenii Stepanov 40a80a0a19 Lower TAGPstack with negative offset to SUBG.
Summary:
This never really occurs in the current codegen, so only a MIR test is
possible.

Reviewers: ostannard, pcc

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72123
2020-01-06 11:48:35 -08:00
Amara Emerson df3f4e0d77 [X86] Fix an 8 bit testb being selected when folding a volatile i32 load pattern.
Differential Revision: https://reviews.llvm.org/D71581
2020-01-06 11:46:42 -08:00
Jinsong Ji e29a2e6be4 [PowerPC][LoopVectorize] Extend getRegisterClassForType to consider double and other floating point type
In https://reviews.llvm.org/D67148, we use isFloatTy to test floating
point type, otherwise we return GPRRC.
So 'double' will be classified as GPRRC, which is not accurate.

This patch covers other floating point types.

Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D71946
2020-01-06 18:44:59 +00:00
Kazuaki Ishizaki 7ae3d33546 [lld] Fix trivial typos in comments
Reviewed By: ruiu, MaskRay

Differential Revision: https://reviews.llvm.org/D72196
2020-01-06 10:25:48 -08:00
Siva Chandra Reddy 5b24c08817 [libc] Move all tests to a top level `test` directory.
A toplevel target, `check-libc` has also been added.

Reviewers: abrachet, phosek

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D72177
2020-01-06 10:14:43 -08:00
Jonas Devlieghere 0239526ccc [lldb/Docs] Fix capitalization typo.
This has been bothering me for way too long.
2020-01-06 10:08:05 -08:00
Jonas Devlieghere 8c8ffd461d [lldb/CMake] Only set PYTHON_HOME on Windows
My earlier change for Python auto-detection caused PYTHON_HOME to be set
unconditionally, while before the change this only happened for Windows.
This caused the PythonDataObjectsTest to fail with an import error.
2020-01-06 10:07:46 -08:00
Fangrui Song bbfebd7b8a [CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_DYLIB on *nix
Summary:
lib/python2.7/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
which depends on lib/libLLVM*.so (-DBUILD_SHARED_LIBS=ON) or lib/libLLVM-10git.so
(-DLLVM_LINK_LLVM_DYLIB=ON). Add an additional rpath `$ORIGIN/../../../../lib` so
that _lldb.so can be loaded from Python.

This fixes an import error from lib/python2.7/dist-packages/lldb/__init__.py

  from . import _lldb
  ImportError: libLLVMAArch64CodeGen.so.10git: cannot open shared object file: No such file or directory

 The following configurations will work:

* -DBUILD_SHARED_LIBS=ON
* -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON
* -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON -DCLANG_LINK_CLANG_DYLIB=ON
  (-DCLANG_LINK_CLANG_DYLIB=ON depends on -DLLVM_LINK_LLVM_DYLIB=ON)

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D71800
2020-01-06 10:01:55 -08:00
Nico Weber f6544934b9 Make check-llvm run 50% faster on macOS, 18% faster on Windows.
While looking at cycle time graphs of some of my bots, I noticed
that 327894859c made check-llvm noticeably slower on macOS and
Windows.

As it turns out, the 5 substitutions added in that change were
enough to cause lit to thrash the build-in cache in re.compile()
(re.sub() is implemented as re.compile().sub()), and apparently
applySubstitutions() is on the cricital path and slow when all
regexes need to compile all the time.

(See `_MAXCACHE = 512` in cpython/Lib/re.py)

Supporting full regexes for lit substitutions seems a bit like
overkill, but for now add a simple unbounded cache to recover
the lost performance.

No intended behavior change.
2020-01-06 12:57:42 -05:00
Jonas Devlieghere 3abc2927cb [lldb/Test] Move @skipIfAsan from test class to test methods.
skipTestIfFn can only be used to decorate a test method.
2020-01-06 09:53:06 -08:00
Fangrui Song 896b84ac2c [llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimal
This matches GNU readelf and llvm-readobj.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D72234
2020-01-06 09:25:45 -08:00
LLVM GN Syncbot ba4ca37b81 [gn build] Port 350da402ef 2020-01-06 17:22:13 +00:00
Tamás Zolnai 350da402ef [clang-tidy] new check: bugprone-signed-char-misuse
Summary:
This check searches for signed char -> integer conversions which might
indicate programming error, because of the misinterpretation of char
values. A signed char might store the non-ASCII characters as negative
values. The human programmer probably expects that after an integer
conversion the converted value matches with the character code
(a value from [0..255]), however, the actual value is in
[-128..127] interval.

See also:
STR34-C. Cast characters to unsigned char before converting to larger integer sizes
<https://wiki.sei.cmu.edu/confluence/display/c/STR34-C.+Cast+characters+to+unsigned+char+before+converting+to+larger+integer+sizes>

By now this check is limited to assignment / variable declarations.
If we would catch all signed char -> integer conversion, then it would
produce a lot of findings and also false positives. So I added only
this use case now, but this check can be extended with additional
use cases later.
The CERT documentation mentions another use case when the char is
used for array subscript. Next to that a third use case can be
the signed char - unsigned char comparison, which also a use case
where things happen unexpectedly because of conversion to integer.

Reviewers: alexfh, hokein, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: sylvestre.ledru, whisperity, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D71174
2020-01-06 18:21:26 +01:00
Jonas Devlieghere 8eba3fbb12 [lldb/Test] Temporarily skip TestFoundationDisassembly on the ASan bot.
This test is timing out on the sanitized bot on GreenDragon. Temporarily
disable it to increase the signal-to-noise ration.
2020-01-06 09:06:09 -08:00
Jonas Devlieghere b3757f3091 [lldb/CMake] Autodetect Python dependency
Python was the last remaining "optional" dependency for LLDB. This moves
the code to find Python into FindPythonInterpAndLibs using the same
principles as FindCursesAndPanel.

Differential revision: https://reviews.llvm.org/D72107
2020-01-06 09:05:05 -08:00
diggerlin 83ec9b51ed [AIX] Use csect reference for function address constants
SUMMARY:
We currently emit a reference for function address constants as labels;
for example:

foo_ptr:
.long foo
however, there may be no such label in the case where the function is
undefined. Although the label exists when the function is defined, we
will (to be consistent) also use a csect reference in that case.

Address one comment
https://reviews.llvm.org/D71144#inline-653255

Reviewers: daltenty,hubert.reinterpretcast,jasonliu,Xiangling_L
Subscribers: cebowleratibm, wuzish, nemanjai

Differential Revision: https://reviews.llvm.org/D71144
2020-01-06 11:45:00 -05:00
Guillaume Chatelet 3e1f3b164c [llvm-libc] Fix missing virtual destructor
Summary: This patch adds a virtual destructor to the Command class.

Reviewers: sivachandra

Subscribers: mgorny, MaskRay, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D72253
2020-01-06 17:42:05 +01:00
David Green f88d52728b [ARM] Use the correct opcodes for Thumb2 segmented stack frame lowering
The segmented stack lowering code appears to be using ARM opcodes under
Thumb2. The MRC opcode will be the same for Thumb and ARM, but t2LDR
seems wrong. Either way, using the correct thumb vs arm opcodes is more
correct.

Differential Revision: https://reviews.llvm.org/D72074
2020-01-06 16:38:49 +00:00
David Green 0eb981b8ce [ARM] Use correct TRAP opcode for thumb in FastISel
We were previously unconditionally using the ARM::TRAP opcode, even
under Thumb. My understanding is that these are essentially the same
thing (they both result in a trap under Thumb), but the ARM::TRAP opcode
is marked as requiring IsARM, so it is more correct to use ARM::tTRAP.

Differential Revision: https://reviews.llvm.org/D72075
2020-01-06 16:38:49 +00:00
diggerlin 61b5e727b7 [AIX] Use csect reference for function address constants
SUMMARY:
We currently emit a reference for function address constants as labels;
for example:

foo_ptr:
.long foo
however, there may be no such label in the case where the function is
undefined. Although the label exists when the function is defined, we
will (to be consistent) also use a csect reference in that case.

Reviewers: daltenty,hubert.reinterpretcast,jasonliu,Xiangling_L
Subscribers: cebowleratibm, wuzish, nemanjai

Differential Revision: https://reviews.llvm.org/D71144
2020-01-06 11:38:22 -05:00
Mark de Wever eec0240f97 Adds -Wrange-loop-analysis to -Wall
This makes the range loop warnings part of -Wall.

Fixes PR32823: Warn about accidental coping of data in range based for

Differential Revision: https://reviews.llvm.org/D68912

Recomitted after fixing the warnings it created.
2020-01-06 17:37:47 +01:00
Mark de Wever 1d549cff48 [NFC] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

Differential Revision: https://reviews.llvm.org/D72210
2020-01-06 17:37:41 +01:00
Simon Pilgrim ea2c159f96 [AMDGPU] Fix "use of uninitialized variable" static analyzer warning. NFCI.
Add "unreachable" default case to AMDGPUTargetStreamer::getArchNameFromElfMach
2020-01-06 16:36:56 +00:00
Simon Pilgrim 5bcc747393 Fix "use of uninitialized variable" static analyzer warnings. NFCI.
Add "unreachable" default cases like we do for the other switch()s in X86MCInstLower::Lower
2020-01-06 16:36:56 +00:00
Simon Pilgrim ea5abf1453 Fix "use of uninitialized variable" static analyzer warning. NFCI. 2020-01-06 16:36:56 +00:00
Simon Tatham 34817e04fe [ARM,MVE] Fix many signedness errors in MVE intrinsics.
Summary:
Running an end-to-end test last week I noticed that a lot of the ACLE
intrinsics that operate differently on vectors of signed and unsigned
integers were ending up generating the signed version of the
instruction unconditionally. This is because the IR intrinsics had no
way to distinguish signed from unsigned: the LLVM type system just
calls them both `v8i16` (or whatever), so you need either separate
intrinsics for signed and unsigned, or a flag parameter that tells
ISel which one to choose.

This patch fixes all the problems of that kind that I've noticed, by
adding an i32 flag parameter to many of the IR intrinsics which is set
to 1 for unsigned (matching the existing practice in cases where we
got it right), and conditioning all the isel patterns on that flag. So
the fundamental change is in `IntrinsicsARM.td`, changing the
low-level IR intrinsics API; there are knock-on changes in
`arm_mve.td` (adjusting code gen for the ACLE intrinsics to use the
modified API) and in `ARMInstrMVE.td` (adjusting isel to expect the
new unsigned flags). The rest of this patch is boringly updating tests.

Reviewers: dmgreen, miyuki, MarkMurrayARM

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D72270
2020-01-06 16:33:16 +00:00
Simon Tatham 4978296cd8 [ARM,MVE] Support -ve offsets in gather-load intrinsics.
Summary:
The ACLE intrinsics with `gather_base` or `scatter_base` in the name
are wrappers on the MVE load/store instructions that take a vector of
base addresses and an immediate offset. The immediate offset can be up
to 127 times the alignment unit, and it can be positive or negative.

At the MC layer, we got that right. But in the Sema error checking for
the wrapping intrinsics, the offset was erroneously constrained to be
positive.

To fix this I've adjusted the `imm_mem7bit` class in the Tablegen that
defines the intrinsics. But that causes integer literals like
`0xfffffffffffffe04` to appear in the autogenerated calls to
`SemaBuiltinConstantArgRange`, which provokes a compiler warning
because that's out of the non-overflowing range of an `int64_t`. So
I've also tweaked `MveEmitter` to emit that as `-0x1fc` instead.

Updated the tests of the Sema checks themselves, and also adjusted a
random sample of the CodeGen tests to actually use negative offsets
and prove they get all the way through code generation without causing
a crash.

Reviewers: dmgreen, miyuki, MarkMurrayARM

Reviewed By: dmgreen

Subscribers: kristof.beyls, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D72268
2020-01-06 16:33:07 +00:00
Simon Tatham b99ef32d04 [ARM,MVE] Generate the right instruction for vmaxnmq_m_f16.
Summary:
Due to a copy-paste error in the isel patterns, the predicated version
of this intrinsic was expanding to the `VMAXNMT.F32` instruction
instead of `VMAXNMT.F16`. Similarly for vminnm.

Reviewers: dmgreen, miyuki, MarkMurrayARM

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72269
2020-01-06 16:28:20 +00:00
Matt Arsenault e4464bf3d4 AMDGPU/GlobalISel: Select scalar v2s16 G_BUILD_VECTOR 2020-01-06 11:19:33 -05:00
Michał Górny bc763c42bb [lldb] [Process/NetBSD] Remove unused orig_*ax use
orig_*ax logic is Linux-specific, and was never used on NetBSD.
In fact, its support seems to be a dead code entirely.

Differential Revision: https://reviews.llvm.org/D72195
2020-01-06 17:10:55 +01:00
Matt Arsenault f1c85ecdfc AMDGPU/GlobalISel: Select more G_EXTRACTs correctly
This assumed a 32-bit extract size, which would produce invalid copies
with 64-bit extracts. Handle the easy case. Ideally we would have a
way to get the proper subreg index for any 32-bit offset, but there
should probably be a tablegenerated way of getting the subreg index
for any size and offset.
2020-01-06 11:10:13 -05:00
Nicolas Vasilache d67c4cc2eb [mlir][Linalg] Reimplement and extend getStridesAndOffset
Summary: This diff reimplements getStridesAndOffset in a significantly simpler way by operating on the AffineExpr and calling into simplifyAffineExpr instead of rolling its own saturating arithmetic.

As a consequence it becomes quite simple to extend the behavior of getStridesAndOffset to encompass more cases by manipulating the AffineExpr more directly.
The divisions are still filtered out and continue to yield fully dynamic strides.
Simplifying the divisions is left for a later time if compelling use cases arise.

Relevant tests are added.

Reviewers: ftynse

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72098
2020-01-06 09:41:38 -05:00
Mitchell Balan d45aafa2fb [clang-format] fix conflict between FormatStyle::BWACS_MultiLine and BeforeCatch/BeforeElse
Summary:
Found a bug introduced with BraceWrappingFlags AfterControlStatement MultiLine. This feature conflicts with the existing BeforeCatch and BeforeElse flags.

For example, our team uses BeforeElse.

if (foo ||
    bar) {
  doSomething();
}
else {
  doSomethingElse();
}

If we enable MultiLine (which we'd really love to do) we expect it to work like this:

if (foo ||
    bar)
{
  doSomething();
}
else {
  doSomethingElse();
}

What we actually get is:

if (foo ||
    bar)
{
  doSomething();
}
else
{
  doSomethingElse();
}

Reviewers: MyDeveloperDay, Bouska, mitchell-stellar

Patch by: pastey

Subscribers: Bouska, cfe-commits

Tags: clang

Differential Revision: https://reviews.llvm.org/D71939
2020-01-06 09:21:41 -05:00
Simon Pilgrim de735247c8 [X86] Add extra PR43971 test case mentioned in D70267 2020-01-06 13:44:55 +00:00
Simon Pilgrim 5d986a68a5 [CostModel][X86] Add missing scalar i64->f32 uitofp costs 2020-01-06 13:17:02 +00:00
Simon Pilgrim 6fa6000e3e [DAG] DAGCombiner::XformToShuffleWithZero - use APInt::extractBits helper. NFCI. 2020-01-06 13:17:02 +00:00
James Henderson 89b1184325 [test][DebugInfo][NFC] Rename method for clarity
The checkGetOrParseLineTableEmitsError function could end up generating
both recoverable and unrecoverable errors, but it is only intended for
handling the latter.

Reviewed by: dblaikie

Differential Revision: https://reviews.llvm.org/D72156
2020-01-06 11:30:26 +00:00
James Henderson d68904f957 [NFC] Fix trivial typos in comments
Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D72143

Patch by Kazuaki Ishizaki.
2020-01-06 10:50:26 +00:00
Simon Pilgrim 7180d9568d Fix MSVC "not all control paths return a value" warning. NFCI. 2020-01-06 10:20:20 +00:00
Sjoerd Meijer 0efc9e5a8c [ARM][MVE] More MVETailPredication debug messages. NFC.
I've added a few more debug messages to MVETailPredication because I wanted to
trace better which instructions are added/removed. And while I was at it, I
factored out one function which I thought was clearer, and have added some
comments to describe better the flow between MVETailPredication and
ARMLowOverheadLoops.

Differential Revision: https://reviews.llvm.org/D71549
2020-01-06 09:56:02 +00:00
Shengchen Kan 5173bfcbc4 Add interface emitPrefix for MCCodeEmitter
Differential Revision: https://reviews.llvm.org/D72047
2020-01-06 17:51:14 +08:00