Jean-Michel Gorius [Thu, 21 May 2020 14:51:32 +0000 (16:51 +0200)]
[x86] NFC: Fix typo in command line option description
Simon Pilgrim [Thu, 21 May 2020 14:48:36 +0000 (15:48 +0100)]
GenericDomTree.h - remove unused PointerIntPair.h include. NFC.
jerryyin [Tue, 19 May 2020 19:59:58 +0000 (19:59 +0000)]
[mlir][rocdl] Exposing buffer load/store intrinsic
Summary:
* Updated ROCDLOps tablegen
* Added parsing and printing function for new intrinsic
* Added unit tests
Reviewers: ftynse
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80233
Benjamin Kramer [Thu, 21 May 2020 13:23:12 +0000 (15:23 +0200)]
[BitcodeReader] Simplify code. NFCI.
Benjamin Kramer [Thu, 21 May 2020 13:22:33 +0000 (15:22 +0200)]
[StringRef] Use some trickery to avoid initializing the std::string returned by upper()/lower()
Wen-Heng (Jack) Chung [Mon, 18 May 2020 18:01:54 +0000 (13:01 -0500)]
[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
Kirstóf Umann [Sun, 5 Apr 2020 17:53:22 +0000 (19:53 +0200)]
[analyzer][CallAndMessage] Add checker options for each bug type
iAs listed in the summary D77846, we have 5 different categories of bugs we're
checking for in CallAndMessage. I think the documentation placed in the code
explains my thought process behind my decisions quite well.
A non-obvious change I had here is removing the entry for
CallAndMessageUnInitRefArg. In fact, I removed the CheckerNameRef typed field
back in D77845 (it was dead code), so that checker didn't really exist in any
meaningful way anyways.
Differential Revision: https://reviews.llvm.org/D77866
Yaxun (Sam) Liu [Fri, 15 May 2020 03:09:30 +0000 (23:09 -0400)]
Fix debug info for NoDebug attr
NoDebug attr does not totally eliminate debug info about a function when
inlining is enabled. This is inconsistent with when inlining is disabled.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D79967
David Nicuesa [Thu, 21 May 2020 12:46:42 +0000 (13:46 +0100)]
Fix compile for -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY
Summary: Compilation with -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY was failing due to missing declarations of functions used in libcxx/include/atomic. The lines this commit affects are the places where those functions are defined, now moved to be always defined.
Reviewers: #libc, ldionne
Reviewed By: #libc, ldionne
Subscribers: miyuki, dexonsmith, ldionne, jfb, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D80372
James Henderson [Wed, 13 May 2020 09:29:02 +0000 (10:29 +0100)]
On Windows, handle interrupt signals without crash message
For LLVM on *nix systems, the signal handlers are not run on signals
such as SIGINT due to CTRL-C. See sys::CleanupOnSignal. This makes
sense, as such signals are not really crashes. Prior to this change,
this wasn't the case on Windows, however. This patch changes the Windows
behaviour to be consistent with Linux, and adds testing that verifies
this.
The test uses llvm-symbolizer, but any tool with an interactive mode
would do the job.
Fixes https://bugs.llvm.org/show_bug.cgi?id=45754.
Reviewed by: MaskRay, rnk, aganea
Differential Revision: https://reviews.llvm.org/D79847
Sam Parker [Thu, 21 May 2020 12:13:25 +0000 (13:13 +0100)]
[CostModel] Sink intrinsic costs to base TTI.
Recommitting part of "[CostModel] Unify Intrinsic Costs."
de71def3f59dc9f12f67141b5040d8e15c84d08a
Move the switch statement from TTImpl::getIntrinsicCost to
TTI::getIntrinsicInstrCost. This enables BasicTTI to understand
more 'free' intrinsics instead of defaulting to a cost of 1.
Differential Revision: https://reviews.llvm.org/D80012
Sam Parker [Thu, 21 May 2020 11:50:24 +0000 (12:50 +0100)]
Revert "[CostModel] Unify Intrinsic Costs."
This reverts commit
de71def3f59dc9f12f67141b5040d8e15c84d08a.
This is causing some very large changes, so I'm first going to break
this patch down and re-commit in parts.
Ehud Katz [Thu, 21 May 2020 11:06:44 +0000 (14:06 +0300)]
[FlattenCFG] Fix `MergeIfRegion` in case then-path is empty
In case the then-path of an if-region is empty, then merging with the
else-path should be handled with the inverse of the condition (leading
to that path).
Fix PR37662
Differential Revision: https://reviews.llvm.org/D78881
Kirstóf Umann [Sun, 5 Apr 2020 17:53:22 +0000 (19:53 +0200)]
[analyzer][CallAndMessage][NFC] Split up checkPreCall
The patch aims to use CallEvents interface in a more principled manner, and also
to highlight what this checker really does. It in fact checks for 5 different
kinds of errors (from checkPreCall, that is):
* Invalid function pointer related errors
* Call of methods from an invalid C++ this object
* Function calls with incorrect amount of parameters
* Invalid arguments for operator delete
* Pass of uninitialized values to pass-by-value parameters
In a previous patch I complained that this checker is responsible for emitting
a lot of different diagnostics all under core.CallAndMessage's name, and this
patch shows where we could start to assign different diagnostics to different
entities.
Differential Revision: https://reviews.llvm.org/D77846
Simon Pilgrim [Thu, 21 May 2020 10:38:09 +0000 (11:38 +0100)]
MachineMemOperand.h - reduce GlobalValue.h include to just DerivedTypes.h. NFC.
We don't need anything specifically from GlobalValue.h
Roman Lebedev [Thu, 21 May 2020 09:54:58 +0000 (12:54 +0300)]
[IndVarSimplify][LoopUtils] Avoid TOCTOU/ordering issues (PR45835)
Summary:
Currently, `rewriteLoopExitValues()`'s logic is roughly as following:
> Loop over each incoming value in each PHI node.
> Query whether the SCEV for that incoming value is high-cost.
> Expand the SCEV.
> Perform sanity check (`isValidRewrite()`, D51582)
> Record the info
> Afterwards, see if we can drop the loop given replacements.
> Maybe perform replacements.
The problem is that we interleave SCEV cost checking and expansion.
This is A Problem, because `isHighCostExpansion()` takes special care
to not bill for the expansions that were already expanded, and we can reuse.
While it makes sense in general - if we know that we will expand some SCEV,
all the other SCEV's costs should account for that, which might cause
some of them to become non-high-cost too, and cause chain reaction.
But that isn't what we are doing here. We expand *all* SCEV's, unconditionally.
So every next SCEV's cost will be affected by the already-performed expansions
for previous SCEV's. Even if we are not planning on keeping
some of the expansions we performed.
Worse yet, this current "bonus" depends on the exact PHI node
incoming value processing order. This is completely wrong.
As an example of an issue, see @dmajor's `pr45835.ll` - if we happen to have
a PHI node with two(!) identical high-cost incoming values for the same basic blocks,
we would decide first time around that it is high-cost, expand it,
and immediately decide that it is not high-cost because we have an expansion
that we could reuse (because we expanded it right before, temporarily),
and replace the second incoming value but not the first one;
thus resulting in a broken PHI.
What we instead should do for now, is not perform any expansions
until after we've queried all the costs.
Later, in particular after `isValidRewrite()` is an assertion (D51582)
we could improve upon that, but in a more coherent fashion.
See [[ https://bugs.llvm.org/show_bug.cgi?id=45835 | PR45835 ]]
Reviewers: dmajor, reames, mkazantsev, fhahn, efriedma
Reviewed By: dmajor, mkazantsev
Subscribers: smeenai, nikic, hiraditya, javed.absar, llvm-commits, dmajor
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79787
Sjoerd Meijer [Thu, 21 May 2020 09:40:26 +0000 (10:40 +0100)]
[HardwareLoops] llvm.loop.decrement.reg definition
This is split off from D80316, slightly tightening the definition of overloaded
hardwareloop intrinsic llvm.loop.decrement.reg specifying that both operands
its result have the same type.
Nicolas Vasilache [Thu, 21 May 2020 09:12:31 +0000 (05:12 -0400)]
[mlir] NFC - Add a builder to vector.transpose
Summary: Also expose some more vector ops to EDSCs.
Differential Revision: https://reviews.llvm.org/D80333
Paula Toth [Thu, 21 May 2020 08:21:07 +0000 (01:21 -0700)]
[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
Denis Antrushin [Wed, 20 May 2020 19:40:07 +0000 (22:40 +0300)]
[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
Benjamin Kramer [Thu, 21 May 2020 07:50:57 +0000 (09:50 +0200)]
Fix a layering violation by not depending from Transforms/Utils on Transforms/Scalar.
NFC.
Haojian Wu [Wed, 20 May 2020 21:15:08 +0000 (23:15 +0200)]
[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.
David Sherwood [Fri, 15 May 2020 13:31:13 +0000 (14:31 +0100)]
[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
Chen Zheng [Thu, 21 May 2020 06:04:10 +0000 (02:04 -0400)]
[PowerPC] add more high latency opcodes for machine combiner pass
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D80097
Sam Parker [Mon, 18 May 2020 08:02:05 +0000 (09:02 +0100)]
[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
Jonas Devlieghere [Thu, 21 May 2020 06:23:50 +0000 (23:23 -0700)]
[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.
Jonas Devlieghere [Thu, 21 May 2020 06:16:43 +0000 (23:16 -0700)]
Revert "[lit] GoogleTest framework should report failures if test binary crashes"
This reverts commit
ef2103182244c96f5206b02164b62b9c9e0cbce8 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
Sam Parker [Tue, 12 May 2020 12:17:33 +0000 (13:17 +0100)]
[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
Igor Kudrin [Thu, 21 May 2020 06:05:38 +0000 (13:05 +0700)]
[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
Yevgeny Rouban [Thu, 21 May 2020 04:49:11 +0000 (11:49 +0700)]
[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
Craig Topper [Thu, 21 May 2020 05:27:53 +0000 (22:27 -0700)]
[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.
Mehdi Amini [Thu, 21 May 2020 03:44:35 +0000 (03:44 +0000)]
Revert "[mlir][gpu] Refactor ConvertGpuLaunchFuncToCudaCalls pass."
This reverts commit
cdb6f05e2d5f0132956020e6b4990af0206c066f.
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
Mehdi Amini [Thu, 21 May 2020 03:07:52 +0000 (03:07 +0000)]
Fix typo in CMake error message "LLVM_LIBC_ENABLE_PROJECTS"->"LLVM_ENABLE_PROJECTS" (NFC)
Julian Lettner [Thu, 14 May 2020 19:27:41 +0000 (12:27 -0700)]
[Darwin] Remove obsolete OS version checks
The oldest supported deployment target currently is 10.7 [1]. We can
remove a few outdated checks.
[1] https://github.com/llvm/llvm-project/blob/
3db893b3712a5cc98ac0dbc88e08df70069be216/compiler-rt/cmake/config-ix.cmake#L397
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D79958
Juneyoung Lee [Thu, 21 May 2020 01:03:27 +0000 (10:03 +0900)]
add a test for D77524
LLVM GN Syncbot [Thu, 21 May 2020 00:30:02 +0000 (00:30 +0000)]
[gn build] Port
d9a4a244138
Juneyoung Lee [Thu, 7 May 2020 20:28:42 +0000 (05:28 +0900)]
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
Jake Merdich [Wed, 20 May 2020 16:17:55 +0000 (12:17 -0400)]
[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
Kirstóf Umann [Wed, 20 May 2020 23:54:11 +0000 (01:54 +0200)]
[analyzer] Make buildbots happy
Eli Friedman [Tue, 19 May 2020 20:24:53 +0000 (13:24 -0700)]
[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
Eli Friedman [Sun, 17 May 2020 00:55:18 +0000 (17:55 -0700)]
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
Francis Visoiu Mistrih [Wed, 20 May 2020 23:26:37 +0000 (16:26 -0700)]
[AArch64] Fix GlobalISel tests on non-darwin platforms
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/6998
Reid Kleckner [Wed, 20 May 2020 14:50:19 +0000 (07:50 -0700)]
[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
Kirstóf Umann [Wed, 20 May 2020 23:03:31 +0000 (01:03 +0200)]
[analyzer] Fix a null FunctionDecl dereference bug after D75432
Francis Visoiu Mistrih [Fri, 31 Jan 2020 21:20:57 +0000 (13:20 -0800)]
[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
Stanislav Mekhanoshin [Fri, 15 May 2020 17:43:18 +0000 (10:43 -0700)]
[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
Craig Topper [Wed, 20 May 2020 22:06:36 +0000 (15:06 -0700)]
[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
Nicolas Vasilache [Wed, 20 May 2020 21:58:10 +0000 (17:58 -0400)]
[mlir] NFC - Appease GCC 5 again..
Wen-Heng (Jack) Chung [Wed, 6 May 2020 17:45:58 +0000 (12:45 -0500)]
[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
Wen-Heng (Jack) Chung [Mon, 18 May 2020 18:01:54 +0000 (13:01 -0500)]
[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
Jonas Devlieghere [Wed, 20 May 2020 21:08:55 +0000 (14:08 -0700)]
[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.
Nicolas Vasilache [Wed, 20 May 2020 20:41:41 +0000 (16:41 -0400)]
[mlir] NFC - Appease GCC 5 again..
Stephen Neuendorffer [Mon, 18 May 2020 00:41:39 +0000 (17:41 -0700)]
[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
mydeveloperday [Wed, 20 May 2020 20:25:18 +0000 (21:25 +0100)]
[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
Nico Weber [Mon, 18 May 2020 23:57:30 +0000 (19:57 -0400)]
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
mydeveloperday [Wed, 20 May 2020 20:11:10 +0000 (21:11 +0100)]
[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:
Jonas Devlieghere [Wed, 20 May 2020 19:59:51 +0000 (12:59 -0700)]
[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.
Matt Morehouse [Wed, 20 May 2020 19:39:40 +0000 (12:39 -0700)]
[sanitizer_symbolizer] Add __isinf to symbols list.
Jonas Devlieghere [Wed, 20 May 2020 19:32:41 +0000 (12:32 -0700)]
[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.
Haibo Huang [Tue, 19 May 2020 22:23:35 +0000 (15:23 -0700)]
[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
Haibo Huang [Tue, 19 May 2020 23:00:54 +0000 (16:00 -0700)]
[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
Alexey Bataev [Thu, 14 May 2020 20:37:30 +0000 (16:37 -0400)]
[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
MaheshRavishankar [Wed, 20 May 2020 18:48:22 +0000 (11:48 -0700)]
[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
Roman Lebedev [Wed, 20 May 2020 18:37:02 +0000 (21:37 +0300)]
[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!
Roman Lebedev [Wed, 20 May 2020 18:16:57 +0000 (21:16 +0300)]
[NFC][InstCombine] Negator: tests for insertelement negation
Roman Lebedev [Wed, 20 May 2020 18:01:28 +0000 (21:01 +0300)]
[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!
Roman Lebedev [Wed, 20 May 2020 17:54:06 +0000 (20:54 +0300)]
[NFC][InstCombine] Negator: tests for extractelement negation
Louis Dionne [Thu, 14 May 2020 13:37:46 +0000 (09:37 -0400)]
[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
aartbik [Wed, 20 May 2020 02:49:01 +0000 (19:49 -0700)]
[llvm] [CodeGen] [X86] Fix issues with v4i1 instruction selection
Summary:
Fixes issue
https://bugs.llvm.org/show_bug.cgi?id=45995
Reviewers: mehdi_amini, nicolasvasilache, reidtatge, craig.topper, ftynse, bkramer
Reviewed By: craig.topper
Subscribers: RKSimon, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80231
Jan Wilken Dörrie [Wed, 20 May 2020 16:28:27 +0000 (12:28 -0400)]
[libcxx] Remove swap for std::span
This change removes both the member function swap and the free function
overload of swap for std::span. While swap is a member and overloaded
for every other container in the standard library [1], it is neither a
member function nor a free function overload for std::span [2].
Thus the corresponding implementation should be removed.
[1] https://eel.is/c++draft/libraryindex#:swap
[2] https://eel.is/c++draft/span.overview
Differential Revision: https://reviews.llvm.org/D69827
Arthur Eubanks [Mon, 16 Mar 2020 19:32:36 +0000 (12:32 -0700)]
Reland [X86] Codegen for preallocated
See https://reviews.llvm.org/D74651 for the preallocated IR constructs
and LangRef changes.
In X86TargetLowering::LowerCall(), if a call is preallocated, record
each argument's offset from the stack pointer and the total stack
adjustment. Associate the call Value with an integer index. Store the
info in X86MachineFunctionInfo with the integer index as the key.
This adds two new target independent ISDOpcodes and two new target
dependent Opcodes corresponding to @llvm.call.preallocated.{setup,arg}.
The setup ISelDAG node takes in a chain and outputs a chain and a
SrcValue of the preallocated call Value. It is lowered to a target
dependent node with the SrcValue replaced with the integer index key by
looking in X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to an
%esp adjustment, the exact amount determined by looking in
X86MachineFunctionInfo with the integer index key.
The arg ISelDAG node takes in a chain, a SrcValue of the preallocated
call Value, and the arg index int constant. It produces a chain and the
pointer fo the arg. It is lowered to a target dependent node with the
SrcValue replaced with the integer index key by looking in
X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to a
lea of the stack pointer plus an offset determined by looking in
X86MachineFunctionInfo with the integer index key.
Force any function containing a preallocated call to use the frame
pointer.
Does not yet handle a setup without a call, or a conditional call.
Does not yet handle musttail. That requires a LangRef change first.
Tried to look at all references to inalloca and see if they apply to
preallocated. I've made preallocated versions of tests testing inalloca
whenever possible and when they make sense (e.g. not alloca related,
inalloca edge cases).
Aside from the tests added here, I checked that this codegen produces
correct code for something like
```
struct A {
A();
A(A&&);
~A();
};
void bar() {
foo(foo(foo(foo(foo(A(), 4), 5), 6), 7), 8);
}
```
by replacing the inalloca version of the .ll file with the appropriate
preallocated code. Running the executable produces the same results as
using the current inalloca implementation.
Reverted due to unexpectedly passing tests, added REQUIRES: asserts for reland.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77689
Jonas Devlieghere [Wed, 20 May 2020 17:32:51 +0000 (10:32 -0700)]
[lldb/Reproducers] Make SBStream::Print an API instead of a SWIG extension
This makes it possible to instrument the call for the reproducers. This
fixes TestStructuredDataAPI.py with reproducer replay.
Differential revision: https://reviews.llvm.org/D80312
Arthur Eubanks [Wed, 20 May 2020 17:04:55 +0000 (10:04 -0700)]
Revert "[X86] Codegen for preallocated"
This reverts commit
810567dc691a57c8c13fef06368d7549f7d9c064.
Some tests are unexpectedly passing
Amy Huang [Wed, 20 May 2020 17:01:17 +0000 (10:01 -0700)]
Add some dependencies to the compiler-rt symbolizer build
Jonas Devlieghere [Wed, 20 May 2020 16:49:28 +0000 (09:49 -0700)]
[lldb/Reproducers] Skip another test that uses lldb::FileSP under the hood
Zola Bridges [Mon, 11 May 2020 20:23:54 +0000 (13:23 -0700)]
[clang][asm goto][slh] Warn if asm goto + SLH
Summary:
Asm goto is not supported by SLH. Warn if an instance of asm goto is detected
while SLH is enabled.
Test included.
Reviewed By: jyu2
Differential Revision: https://reviews.llvm.org/D79743
Sanjay Patel [Wed, 20 May 2020 16:44:35 +0000 (12:44 -0400)]
[InstCombine] add tests for reassociative fsub/fadd expressions; NFC
Hiroshi Yamauchi [Tue, 19 May 2020 19:12:26 +0000 (12:12 -0700)]
[ProfileSummary] Refactor getFromMD to prepare for another optional field. NFC.
Summary:
Rename 'i' to 'I'.
Factor out the optional field handling to getOptionalVal().
Split out of D79951.
Reviewers: davidxl
Subscribers: eraman, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80230
Jonas Devlieghere [Wed, 20 May 2020 16:21:45 +0000 (09:21 -0700)]
[lldb/Driver] Error out when encountering unknown arguments
There appears to be consensus in D80165 that this is the desired
behavior and I personally agree.
Differential revision: https://reviews.llvm.org/D80226
Simon Pilgrim [Wed, 20 May 2020 16:29:39 +0000 (17:29 +0100)]
FormatAdapters.h - remove unused SmallString.h include. NFC.
Simon Pilgrim [Wed, 20 May 2020 15:59:37 +0000 (16:59 +0100)]
GenericError.h - remove unused StringRef.h include. NFC.
Arthur Eubanks [Mon, 16 Mar 2020 19:32:36 +0000 (12:32 -0700)]
[X86] Codegen for preallocated
See https://reviews.llvm.org/D74651 for the preallocated IR constructs
and LangRef changes.
In X86TargetLowering::LowerCall(), if a call is preallocated, record
each argument's offset from the stack pointer and the total stack
adjustment. Associate the call Value with an integer index. Store the
info in X86MachineFunctionInfo with the integer index as the key.
This adds two new target independent ISDOpcodes and two new target
dependent Opcodes corresponding to @llvm.call.preallocated.{setup,arg}.
The setup ISelDAG node takes in a chain and outputs a chain and a
SrcValue of the preallocated call Value. It is lowered to a target
dependent node with the SrcValue replaced with the integer index key by
looking in X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to an
%esp adjustment, the exact amount determined by looking in
X86MachineFunctionInfo with the integer index key.
The arg ISelDAG node takes in a chain, a SrcValue of the preallocated
call Value, and the arg index int constant. It produces a chain and the
pointer fo the arg. It is lowered to a target dependent node with the
SrcValue replaced with the integer index key by looking in
X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to a
lea of the stack pointer plus an offset determined by looking in
X86MachineFunctionInfo with the integer index key.
Force any function containing a preallocated call to use the frame
pointer.
Does not yet handle a setup without a call, or a conditional call.
Does not yet handle musttail. That requires a LangRef change first.
Tried to look at all references to inalloca and see if they apply to
preallocated. I've made preallocated versions of tests testing inalloca
whenever possible and when they make sense (e.g. not alloca related,
inalloca edge cases).
Aside from the tests added here, I checked that this codegen produces
correct code for something like
```
struct A {
A();
A(A&&);
~A();
};
void bar() {
foo(foo(foo(foo(foo(A(), 4), 5), 6), 7), 8);
}
```
by replacing the inalloca version of the .ll file with the appropriate
preallocated code. Running the executable produces the same results as
using the current inalloca implementation.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77689
Jonas Devlieghere [Wed, 20 May 2020 16:10:20 +0000 (09:10 -0700)]
[lldb/Reproducers] Support reproducers for PlatformRemoteGDBServer
Add reproducer support to PlatformRemoteGDBServer. The logic is
essentially the same as for ProcessGDBRemote. During capture we record
the GDB packets and during replay we connect to a replay server.
This fixes TestPlatformClient.py when run form a reproducer.
Differential Revision: https://reviews.llvm.org/D80224
MaheshRavishankar [Wed, 20 May 2020 15:57:32 +0000 (08:57 -0700)]
[mlir][Linalg] Add producer-consumer fusion when producer is a ConstantOp
and Consumer is a GenericOp.
Differential Revision: https://reviews.llvm.org/D79838
Jonas Devlieghere [Tue, 19 May 2020 21:01:23 +0000 (14:01 -0700)]
[lldb/Reproducers] Update macosx remote tests for passive replay
Skip tests or part thereof that are not supposed to work with replay.
Matt Arsenault [Mon, 18 May 2020 17:47:49 +0000 (13:47 -0400)]
AMDGPU/GlobalISel: Fix splitting 64-bit extensions
This was replicating the low bits into the high bits for G_ZEXT,
rather than using 0.
Nicolas Vasilache [Wed, 20 May 2020 13:52:55 +0000 (09:52 -0400)]
[mlir][Vector] Add option to fully unroll for VectorTransfer to SCF lowering
Summary:
Previously, the only support partial lowering from vector transfers to SCF was
going through loops. This requires a dedicated allocation and extra memory
roundtrips because LLVM aggregates cannot be indexed dynamically (for more
details see the [deep-dive](https://mlir.llvm.org/docs/Dialects/Vector/#deeperdive)).
This revision allows specifying full unrolling which removes this additional roundtrip.
This should be used carefully though because full unrolling will spill, negating the
benefits of removing the interim alloc in the first place.
Proper heuristics are left for a later time.
Differential Revision: https://reviews.llvm.org/D80100
Alexey Bataev [Wed, 20 May 2020 14:54:53 +0000 (10:54 -0400)]
[OPENMP][DOCS]Update status of implemented features, NFC.
Alex Zinenko [Wed, 20 May 2020 14:00:57 +0000 (16:00 +0200)]
[mlir] ensureRegionTerminator: take OpBuilder
The SingleBlockImplicitTerminator op trait provides a function
`ensureRegionTerminator` that injects an appropriate terminator into the block
if necessary, which is used during operation constructing and parsing.
Currently, this function directly modifies the IR using low-level APIs on
Operation and Block. If this function is called from a conversion pattern,
these manipulations are not reflected in the ConversionPatternRewriter and thus
cannot be undone or, worse, lead to tricky memory errors and malformed IR.
Change `ensureRegionTerminator` to take an instance of `OpBuilder` instead of
`Builder`, and use it to construct the block and the terminator when required.
Maintain overloads taking an instance of `Builder` and creating a simple
`OpBuilder` to use in parsers, which don't have an `OpBuilder` and cannot
interact with the dialect conversion mechanism. This change was one of the
reasons to make `<OpTy>::build` accept an `OpBuilder`.
Differential Revision: https://reviews.llvm.org/D80138
Alex Zinenko [Wed, 20 May 2020 14:00:47 +0000 (16:00 +0200)]
[mlir] SCFToStandard: support any ops in and around the control flow ops
Originally, the SCFToStandard conversion only declared Ops from the Standard
dialect as legal after conversion. This is undesirable as it would fail the
conversion if the SCF ops contained ops from any other dialect. Furthermore,
this would be problematic for progressive lowering of `scf.parallel` to
`scf.for` after `ensureRegionTerminator` is made aware of the pattern rewriting
infrastructure because it creates temporary `scf.yield` operations declared
illegal. Change the legalization target to declare any op other than `scf.for`,
`scf.if` and `scf.parallel` legal.
Differential Revision: https://reviews.llvm.org/D80137
Alex Zinenko [Wed, 20 May 2020 14:00:37 +0000 (16:00 +0200)]
[mlir] Erase or clear blocks through ConversionPatternRewriter when applicable
Multiple places in the code base were erasing Blocks or operations in them
using in-place modifications (`Block::erase` or `Block::clear`) unknown to
ConversionPatternRewriter. These operations could not be undone if the pattern
failed and could lead to inconsistent in-memory state of the IR with dangling
pointers. Use `ConversionPatternRewriter::eraseOp` and `::eraseBlock` instead.
Differential Revision: https://reviews.llvm.org/D80136
Alex Zinenko [Wed, 20 May 2020 14:00:27 +0000 (16:00 +0200)]
[mlir] DialectConversion: support erasing blocks
PatternRewriter has support for erasing a Block from its parent region, but
this feature has not been implemented for ConversionPatternRewriter that needs
to keep track of and be able to undo block actions. Introduce support for
undoing block erasure in the ConversionPatternRewriter by marking all the ops
it contains for erasure and by detaching the block from its parent region. The
detached block is stored in the action description and is not actually deleted
until the rewrites are applied.
Differential Revision: https://reviews.llvm.org/D80135
Alex Zinenko [Wed, 20 May 2020 13:59:54 +0000 (15:59 +0200)]
[mlir] DialectConversion: avoid double-free when rolling back op creation
Dialect conversion infrastructure may roll back op creation by erasing the
operations in the reverse order of their creation. While this guarantees uses
of values will be deleted before their definitions, this does not guarantee
that a parent operation will not be deleted before its child. (This may happen
in case of block inlining or if child operations, such as terminators, are
created in the parent's `build` function before the parent itself.) Handle the
parent/child relationship between ops by removing all child ops from the blocks
before erasing the parent. The child ops remain live, detached from a block,
and will be safely destroyed in their turn, which may come later than that of
the parent.
Differential Revision: https://reviews.llvm.org/D80134
Alex Zinenko [Wed, 20 May 2020 13:59:44 +0000 (15:59 +0200)]
[mlir] Toy tutorial: insert terminators at the end of the loop during rewrite
When creating temporary `scf.for` loops in `toy.print` lowering, the block
insertion point was erronously set up to the beginning of the block rather than
to its end, contradicting the comment just above the insertion point change.
The code was nevertheless operational because `scf.for` was setting up its
`scf.yield` terminator in an opaque to the pattern rewriting infrastructure
way. Now that it is about to change, the problem would have been exposed and
lead to conversion failures.
Differential Revision: https://reviews.llvm.org/D80133
Nicolas Vasilache [Wed, 20 May 2020 13:43:58 +0000 (09:43 -0400)]
[mlir][Linalg] NFC - Simplify GenericNestLoop builder
Summary: This revision trims unnecessary complexity.
Differential Revision: https://reviews.llvm.org/D80290
Nicolas Vasilache [Wed, 20 May 2020 13:10:21 +0000 (09:10 -0400)]
[mlir][Linalg] Refactor linalg tiling
Summary:
This revision refactors the Linalg tiling pass to be written as pattern applications and retires the use of the folder in Linalg tiling.
In the early days, tiling was written as a pass that would create (partially) folded and canonicalized operations on the fly for better composability.
As this evolves towards composition of patterns, the pass-specific folder is counter-productive and is retired.
The tiling options struct evolves to take a tile size creation function which allows materializing tile sizes on the fly (in particular constant tile sizes). This plays better with folding and DCE.
With the folder going away in Tiling, the check on whether subviews are the same in linalg fusion needs to be more robust. This revision also implements such a check.
In the current form, there are still some canonicalizations missing due to AffineMin/Max ops fed by scf::ForOp. These will be improved at a later time.
Differential Revision: https://reviews.llvm.org/D80267
Simon Pilgrim [Wed, 20 May 2020 13:38:25 +0000 (14:38 +0100)]
MachineMemOperand.h - replace Type.h with full GlobalValue.h include to fix -Wundefined-inline warnings.
Simon Pilgrim [Wed, 20 May 2020 13:31:01 +0000 (14:31 +0100)]
DIPrinter.h - reduce unnecessary includes to forward declarations. NFC.
Jay Foad [Wed, 20 May 2020 13:29:55 +0000 (14:29 +0100)]
[AMDGPU] Add the test from D49097.
Raphael Isemann [Wed, 20 May 2020 13:02:16 +0000 (15:02 +0200)]
[lldb][NFC] Minor NamespaceMap refactor