Commit Graph

354878 Commits

Author SHA1 Message Date
Paula Toth
b2a485e37e [libc] Fix accidental inclusion of system libc headers.
Summary:
I found that because `--system-headers` flag was not included when running clang-tidy, errors produced from compiler provided headers were being suppressed. After passing this flag I realized that by including headers like stdint.h we were indirectly including headers from the system libc. To prevent this we pass `-ffreestanding`.
We don't want to pass `--system-headers` for all checks just the `llvmlibc-restrict-system-libc-headers` therefore we do a separate invocation of clang-tidy for this check.

Reviewers: abrachet, sivachandra

Reviewed By: sivachandra

Subscribers: mgorny, aheejin, tschuett, ecnelises, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D80178
2020-05-21 01:21:37 -07:00
Denis Antrushin
dedcefe09d [Statepoint] Constant fold FP deopt args.
We do not have any special handling for constant FP deopt arguments.
They are just spilled to stack or generated in register by MOVS
instruction. This is inefficient and, when we have too many such
constant arguments, may result in register allocation failure.
Instead, we can bitcast such constant FP operands to appropriately
sized integer and record as constant into statepoint and later, into
StackMap.

Reviewed By: skatkov
Differential Revision: https://reviews.llvm.org/D80318
2020-05-21 11:02:54 +03:00
Benjamin Kramer
5b0d1f04bf Fix a layering violation by not depending from Transforms/Utils on Transforms/Scalar.
NFC.
2020-05-21 09:51:58 +02:00
Haojian Wu
c2c36c4f4b [clang][index] Fix a crash for accessing a null field decl.
getField() may return a nullptr, we already did that in
BodyIndexer::VisitDesignatedInitExpr, but missed one place.
2020-05-21 09:47:36 +02:00
David Sherwood
1c3d9c2f36 [SVE] Remove IITDescriptor::ScalableVecArgument
I have refactored the code so that we no longer need the
ScalableVecArgument descriptor - the scalable property of vectors is
now encoded using the ElementCount class in IITDescriptor. This means
that when matching intrinsics we know precisely how to match the
arguments and return values.

Differential Revision: https://reviews.llvm.org/D80107
2020-05-21 08:15:10 +01:00
Chen Zheng
8086cdd1b0 [PowerPC] add more high latency opcodes for machine combiner pass
Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D80097
2020-05-21 02:39:20 -04:00
Sam Parker
de71def3f5 [CostModel] Unify Intrinsic Costs.
With the two getIntrinsicInstrCosts folded into one, now fold in the
scalar/code-size orientated getIntrinsicCost. This involved sinking
cost of the TTIImpl into the base implementation, as it performs no
target checks. The opcodes remaining were memcpy, cttz and ctlz which
now have special handling in the BasicTTI implementation.
getInstructionThroughput can now directly return the result of
getUserCost.

This had required a change in the AMDGPU backend for fabs and its
always 'free'. I've also changed the X86 backend to return '1' for
any intrinsic when the CostKind isn't RecipThroughput.

Though this intended to be a non-functional change, there are many
paths being combined here so I would be very surprised if this didn't
have an effect.

Differential Revision: https://reviews.llvm.org/D80012
2020-05-21 07:38:25 +01:00
Jonas Devlieghere
7606a54363 [lldb/Reproducers] Fix/skip passive replay failures in python_api subdir
Fixes or skips tests in the python_api subdirectory that were failing
with passive replay.
2020-05-20 23:23:53 -07:00
Jonas Devlieghere
78dea0e8fb Revert "[lit] GoogleTest framework should report failures if test binary crashes"
This reverts commit ef21031822 because it
breaks the Windows bot:

http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/16447

Failing Tests (2):
  ...
  lldb-unit :: API/./APITests.exe/failed_to_discover_tests_from_gtest
2020-05-20 23:22:47 -07:00
Sam Parker
fb3ba38021 [CostModel] Remove getExtCost
This has not been implemented by any backends which appear to cover
the functionality through getCastInstrCost. Sink what there is in the
default implementation into BasicTTI.

Differential Revision: https://reviews.llvm.org/D78922
2020-05-21 07:18:06 +01:00
Igor Kudrin
0e41d647ce [MC] Simplify MakeStartMinusEndExpr(). NFC.
The function does not need an MCStreamer per se; it was used only to get
access to the MCContext.

Differential Revision: https://reviews.llvm.org/D80205
2020-05-21 13:05:38 +07:00
Yevgeny Rouban
8138487468 [BrachProbablityInfo] Set edge probabilities at once and fix calcMetadataWeights()
Hide the method that allows setting probability for particular edge
and introduce a public method that sets probabilities for all
outgoing edges at once.
Setting individual edge probability is error prone. More over it is
difficult to check that the total probability is 1.0 because there is
no easy way to know when the user finished setting all
the probabilities.

Related bug is fixed in BranchProbabilityInfo::calcMetadataWeights().
Changing unreachable branch probabilities to raw(1) and distributing
the rest (oldProbability - raw(1)) over the reachable branches could
introduce total probability inaccuracy bigger than 1/numOfBranches.

Reviewers: yamauchi, ebrevnov
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79396
2020-05-21 12:52:37 +07:00
Craig Topper
ae5ab2f40a [LegalizeDAG] Modify ExpandLegalINT_TO_FP to swap data for little/big endian instead of the pointers.
Will make it easier to pass the pointer info and alignment
correctly to the loads/stores.

While there also make the i32 stores independent and use a token
factor to join before the load.
2020-05-20 22:29:59 -07:00
Mehdi Amini
5c3ebd7725 Revert "[mlir][gpu] Refactor ConvertGpuLaunchFuncToCudaCalls pass."
This reverts commit cdb6f05e2d.

The build is broken with:

  You have called ADD_LIBRARY for library obj.MLIRGPUtoCUDATransforms without any source files. This typically indicates a problem with your CMakeLists.txt file
2020-05-21 03:44:35 +00:00
Mehdi Amini
c32d695b09 Fix typo in CMake error message "LLVM_LIBC_ENABLE_PROJECTS"->"LLVM_ENABLE_PROJECTS" (NFC) 2020-05-21 03:08:47 +00:00
Julian Lettner
b3ca4f3431 [Darwin] Remove obsolete OS version checks
The oldest supported deployment target currently is 10.7 [1].  We can
remove a few outdated checks.

[1] 3db893b371/compiler-rt/cmake/config-ix.cmake (L397)

Reviewed By: delcypher

Differential Revision: https://reviews.llvm.org/D79958
2020-05-20 19:46:41 -07:00
Juneyoung Lee
58f7c938a1 add a test for D77524 2020-05-21 10:03:27 +09:00
LLVM GN Syncbot
ca85d5a848 [gn build] Port d9a4a24413 2020-05-21 00:30:02 +00:00
Juneyoung Lee
d9a4a24413 Add CanonicalizeFreezeInLoops pass
Summary:
If an induction variable is frozen and used, SCEV yields imprecise result
because it doesn't say anything about frozen variables.

Due to this reason, performance degradation happened after
https://reviews.llvm.org/D76483 is merged, causing
SCEV yield imprecise result and preventing LSR to optimize a loop.

The suggested solution here is to add a pass which canonicalizes frozen variables
inside a loop. To be specific, it pushes freezes out of the loop by freezing
the initial value and step values instead & dropping nsw/nuw flags from instructions used by freeze.
This solution was also mentioned at https://reviews.llvm.org/D70623 .

Reviewers: spatel, efriedma, lebedev.ri, fhahn, jdoerfert

Reviewed By: fhahn

Subscribers: nikic, mgorny, hiraditya, javed.absar, llvm-commits, sanwou01, nlopes

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77523
2020-05-21 09:29:29 +09:00
Jake Merdich
51dbda5438 [clang-format][docfix] Update predefined styles in docs
Summary:
The predefined styles that clang-format supports are listed in two
places, and neither is up-to-date. GNU style isn't mentioned at all!

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80309
2020-05-20 20:03:53 -04:00
Kirstóf Umann
48a8c7dcbf [analyzer] Make buildbots happy 2020-05-21 01:54:50 +02:00
Eli Friedman
b4f9b34701 [AArch64] Fix unwind info generated by outliner.
The offsets were wrong. The result is now the same as what the compiler
would generate for a function that spills lr normally.

Differential Revision: https://reviews.llvm.org/D80238
2020-05-20 16:39:00 -07:00
Eli Friedman
f26bdb539e Make Value::getPointerAlignment() return an Align, not a MaybeAlign.
If we don't know anything about the alignment of a pointer, Align(1) is
still correct: all pointers are at least 1-byte aligned.

Included in this patch is a bugfix for an issue discovered during this
cleanup: pointers with "dereferenceable" attributes/metadata were
assumed to be aligned according to the type of the pointer.  This
wasn't intentional, as far as I can tell, so Loads.cpp was fixed to
stop making this assumption. Frontends may need to be updated.  I
updated clang's handling of C++ references, and added a release note for
this.

Differential Revision: https://reviews.llvm.org/D80072
2020-05-20 16:37:20 -07:00
Francis Visoiu Mistrih
770ba4f051 [AArch64] Fix GlobalISel tests on non-darwin platforms
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/6998
2020-05-20 16:26:58 -07:00
Reid Kleckner
3508c1d8fb [LLD] Make scoped timers thread safe
Summary:
This is a pre-requisite to parallelizing PDB symbol and type merging.
Currently this timer usage would not be thread safe.

Reviewers: aganea, MaskRay

Subscribers: jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80298
2020-05-20 16:16:08 -07:00
Kirstóf Umann
1d393eac8f [analyzer] Fix a null FunctionDecl dereference bug after D75432 2020-05-21 01:05:15 +02:00
Francis Visoiu Mistrih
161122ea1c [AArch64] Provide Darwin variants of most calling conventions
With the new SVE stack layout, we now need to provide a Darwin variant
for all the calling conventions based on the main AAPCS CSR save order.

This also changes APCS_SwiftError to have a Darwin and a non-Darwin
version, assuming it could be used on other platforms these days, and
restricts the AArch64_CXX_TLS calling convention to Darwin.

Differential Revision: https://reviews.llvm.org/D73805
2020-05-20 16:03:48 -07:00
Stanislav Mekhanoshin
4eecf17164 [AMDGPU] Always expand ext/insertelement with divergent idx
Even though series of cmd/cndmask can produce quite a lot of
code that is still better than a loop. In case of doubles we
would even produce two loops.

Differential Revision: https://reviews.llvm.org/D80032
2020-05-20 15:51:29 -07:00
Craig Topper
17bd86bc9b [LegalizeVectorTypes] Create correct memoperands in SplitVecRes_INSERT_SUBVECTOR.
Previously this code just used a default constructed
MachinePointerInfo. But we know the accesses are to a fixed stack
object or at least somewhere on the stack.

While there fix the alignment passed to the full vector load/stores.

I don't think this function is currently exercised in tree so I
don't know how to test it. I just noticed it when I removed
non-constant index support in this function.

Differential Revision: https://reviews.llvm.org/D80058
2020-05-20 15:06:36 -07:00
Nicolas Vasilache
3393cc4ceb [mlir] NFC - Appease GCC 5 again.. 2020-05-20 17:58:18 -04:00
Wen-Heng (Jack) Chung
ad398164ba [mlir][gpu] Refactor functions for workgroup and private buffer attributions.
Summary:

Consolidate interfaces adding workgroup and private buffer attributions in GPU
dialect.

Note all private buffer attributions must follow workgroup buffer attributions.

Reviewers: herhut

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits

Tags: #llvm, #mlir

Differential Revision: https://reviews.llvm.org/D79508
2020-05-20 16:20:27 -05:00
Wen-Heng (Jack) Chung
cdb6f05e2d [mlir][gpu] Refactor ConvertGpuLaunchFuncToCudaCalls pass.
Due to similar APIs between CUDA and ROCm (HIP),
ConvertGpuLaunchFuncToCudaCalls pass could be used on both platforms with some
refactoring.

In this commit:

- Migrate ConvertLaunchFuncToCudaCalls from GPUToCUDA to GPUCommon, and rename.
- Rename runtime wrapper APIs be platform-neutral.
- Let GPU binary annotation attribute be specifiable as a PassOption.
- Naming changes within the implementation and tests.

Subsequent patches would introduce ROCm-specific tests and runtime wrapper
APIs.

Differential Revision: https://reviews.llvm.org/D80167
2020-05-20 16:11:48 -05:00
Jonas Devlieghere
8723f841aa [lldb/Test] Support arbitrary file extensions in TestPositionalArgs.test
On Windows the line must match:

  Use 'lldb.exe --help' for a complete list of options.
2020-05-20 14:09:19 -07:00
Nicolas Vasilache
ebf14d9b6d [mlir] NFC - Appease GCC 5 again.. 2020-05-20 16:47:45 -04:00
Stephen Neuendorffer
ef21031822 [lit] GoogleTest framework should report failures if test binary crashes
lit runs a gtest executable multiple times. First it runs it to
discover tests, then later it runs the executable again for each test.
However, if the discovery fails (perhaps because of a broken
executable), then no tests were previously run and no failures were
reported.  This patch creates a dummy test if discovery fails, which
will later fail when test are run and be reported as a failure.

Differential Revision: https://reviews.llvm.org/D80096
2020-05-20 13:36:08 -07:00
mydeveloperday
6ef45b0426 [clang-format] Added new option IndentExternBlock
Reviewers: MyDeveloperDay, krasimir, klimek, mitchell-stellar, Abpostelnicu

Patch By: MarcusJohnson91

Reviewed By: MyDeveloperDay, Abpostelnicu

Subscribers: sylvestre.ledru, Abpostelnicu, cfe-commits

Tags: #clang, #clang-format, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D75791
2020-05-20 21:27:15 +01:00
Nico Weber
bc1c3655bf Give microsoftDemangle() an outparam for how many input bytes were consumed.
Demangling Itanium symbols either consumes the whole input or fails,
but Microsoft symbols can be successfully demangled with just some
of the input.

Add an outparam that enables clients to know how much of the input was
consumed, and use this flag to give llvm-undname an opt-in warning
on partially consumed symbols.

Differential Revision: https://reviews.llvm.org/D80173
2020-05-20 16:17:31 -04:00
mydeveloperday
166ebefd27 [clang-format] Set of unit test to begin to validate that we don't change defaults
Summary:
This revision is to complement {D75791} so we can be sure that we don't change any default behavior.

For now just add rules to cover AfterExternBlock, but in the future we should add cases to cover the other BraceWrapping rules for each style. This will help guard us when we change code inside of the various getXXXStyle() functions to ensure we are not breaking everyone.

Reviewed By: MarcusJohnson91

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https:
2020-05-20 21:11:10 +01:00
Jonas Devlieghere
690993a09a [lldb/Reproducers] Add instrumentation to SBEnvironment
This class should've been instrumented when it landed. Whether the class
is "highly mutable" or not doesn't affect that.

With this patch TestSBEnvironment.py now passes when replayed.
2020-05-20 13:02:20 -07:00
Matt Morehouse
8817e6ab31 [sanitizer_symbolizer] Add __isinf to symbols list. 2020-05-20 12:39:40 -07:00
Jonas Devlieghere
ce19664d94 [lldb/Driver] Print snippet before exiting with unknown argument.
Print a little snippet before exiting when passed unrecognized
arguments. The goal is twofold:

 - Point users to lldb --help.
 - Make it clear that we exited the debugger.
2020-05-20 12:35:02 -07:00
Haibo Huang
04daba9670 [lldb] Cleans up system_libs
Summary:
Long long ago system_libs was appended to LLDB_SYSTEM_LIBS in
cmake/LLDBDependencies.cmake. After that file was removed, system_libs
is orphaned.

Currently the only user is source/Utility. Move the logic there and
remove system_libs.

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D80253
2020-05-20 12:30:08 -07:00
Haibo Huang
780d7d7732 [lldb] Allows customizing libxml2 for darwin
Summary:
This changes allows to disable or use customized libxml2 for lldb.

1. Removes redundant include_directories. The one in LLDBConfig.cmake should be enough.

2. Link to ${LIBXML2_LIBRARIES} if xml2 is enabled.

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D80257
2020-05-20 12:27:08 -07:00
Alexey Bataev
414afdf940 [OPENMP]Fix PR45911: Data sharing and lambda capture.
Summary:
No need to generate inlined OpenMP region for variables captured in
lambdas or block decls, only for implicitly captured variables in the
OpenMP region.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits, caomhin

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79966
2020-05-20 15:01:02 -04:00
MaheshRavishankar
0e88eb5c51 [mlir][spirv] Adapt subview legalization to the updated op semantics.
The subview semantics changes recently to allow for more natural
representation of constant offsets and strides. The legalization of
subview op for lowering to SPIR-V needs to account for this.
Also change the linearization to use the strides from the affine map
of a memref.

Differential Revision: https://reviews.llvm.org/D80270
2020-05-20 12:00:21 -07:00
Roman Lebedev
55430f53f3
[InstCombine] insertelement is negatible if both sources are negatible
----------------------------------------
define <2 x i4> @negate_insertelement(<2 x i4> %src, i4 %a, i32 %x, <2 x i4> %b) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %src
  %t1 = sub i4 0, %a
  %t2 = insertelement <2 x i4> %t0, i4 %t1, i32 %x
  %t3 = sub <2 x i4> %b, %t2
  ret <2 x i4> %t3
}
=>
define <2 x i4> @negate_insertelement(<2 x i4> %src, i4 %a, i32 %x, <2 x i4> %b) {
%0:
  %t2.neg = insertelement <2 x i4> %src, i4 %a, i32 %x
  %t3 = add <2 x i4> %t2.neg, %b
  ret <2 x i4> %t3
}
Transformation seems to be correct!
2020-05-20 21:44:31 +03:00
Roman Lebedev
a6097cebe9
[NFC][InstCombine] Negator: tests for insertelement negation 2020-05-20 21:44:31 +03:00
Roman Lebedev
ebed96fdbf
[InstCombine] Negator: extractelement is negatible if src is negatible
----------------------------------------
define i4 @negate_extractelement(<2 x i4> %x, i32 %y, i4 %z) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %x
  call void @use_v2i4(<2 x i4> %t0)
  %t1 = extractelement <2 x i4> %t0, i32 %y
  %t2 = sub i4 %z, %t1
  ret i4 %t2
}
=>
define i4 @negate_extractelement(<2 x i4> %x, i32 %y, i4 %z) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %x
  call void @use_v2i4(<2 x i4> %t0)
  %t1.neg = extractelement <2 x i4> %x, i32 %y
  %t2 = add i4 %t1.neg, %z
  ret i4 %t2
}
Transformation seems to be correct!
2020-05-20 21:44:31 +03:00
Roman Lebedev
952e7106b3
[NFC][InstCombine] Negator: tests for extractelement negation 2020-05-20 21:44:30 +03:00
Louis Dionne
9f19cc8cac [libcxx][test] Portability fix for some locale-dependent tests.
Tests for `std::system_error` constructor marked as slightly non-portable.
One (but not the only one) reason for such non-portability is that these
tests assume the default locale to be set to "C" (or "POSIX").

However, the default locale for the process depends on OS and
environment. This patch adds explicit setting of the correct
locale expected by the tests.

Thanks to Andrey Maksimov for the patch.

Differential Revision: https://reviews.llvm.org/D72456
2020-05-20 14:35:18 -04:00