Anton Bikineev [Sat, 4 Apr 2020 19:55:10 +0000 (21:55 +0200)]
tsan: don't instrument __attribute__((naked)) functions
Naked functions are required to not have compiler generated
prologues/epilogues, hence no instrumentation is needed for them.
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45400
Differential Revision: https://reviews.llvm.org/D77477
Pavel Labath [Thu, 2 Apr 2020 13:09:08 +0000 (15:09 +0200)]
[DWARF] Detect extraction errors in DWARFFormValue::extractValue
Summary:
Although the function had a bool return value, it was always returning
true. Presumably this is because the main type of errors one can
encounter here is running off the end of the stream, and until very
recently, the DataExtractor class made it very difficult to detect that.
The situation has changed now, and we can easily detect errors here,
which this patch does.
Reviewers: dblaikie, aprantl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77308
Pavel Labath [Thu, 2 Apr 2020 11:54:54 +0000 (13:54 +0200)]
Recommit "[lldb/Core] Fix a race in the Communication class"
The synchronization logic in the previous had a subtle bug. Moving of
the "m_read_thread_did_exit = true" into the critical section made it
possible for some threads calling SynchronizeWithReadThread call to get
stuck. This could happen if there were already past the point where they
checked this variable. In that case, they would block on waiting for the
eBroadcastBitNoMorePendingInput event, which would never come as the
read thread was blocked on getting the synchronization mutex.
The new version moves that line out of the critical section and before
the sending of the eBroadcastBitNoMorePendingInput event, and also adds
some comments to explain why the things need to be in this sequence:
- m_read_thread_did_exit = true: prevents new threads for waiting on
events
- eBroadcastBitNoMorePendingInput: unblock any current thread waiting
for the event
- Disconnect(): close the connection. This is the only bit that needs to
be in the critical section, and this is to ensure that we don't close
the connection while the synchronizing thread is mucking with it.
Original commit message follows:
Communication::SynchronizeWithReadThread is called whenever a process
stops to ensure that we process all of its stdout before we report the
stop. If the process exits, we first call this method, and then close
the connection.
However, when the child process exits, the thread reading its stdout
will usually (but not always) read an EOF because the other end of the
pty has been closed. In response to an EOF, the Communication read
thread closes it's end of the connection too.
This can result in a race where the read thread is closing the
connection while the synchronizing thread is attempting to get its
attention via Connection::InterruptRead.
The fix is to hold the synchronization mutex while closing the
connection.
I've found this issue while tracking down a rare flake in some of the
vscode tests. I am not sure this is the cause of those failures (as I
would have expected this issue to manifest itself differently), but it
is an issue nonetheless.
The attached test demonstrates the steps needed to reproduce the race.
It will fail under tsan without this patch.
Reviewers: clayborg, JDevlieghere
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77295
Shengchen Kan [Tue, 7 Apr 2020 04:25:03 +0000 (12:25 +0800)]
[Driver][X86] Add -mpad-max-prefix-size
Summary:
The option `-mpad-max-prefix-size` performs some checking and delegate to MC option `-x86-pad-max-prefix-size`. This option is designed for eliminate NOPs when we need to align something by adding redundant prefixes to instructions, e.g. it can be used along with `-malign-branch`, `-malign-branch-boundary` to prefix padding branch.
It has similar (but slightly different) effect as GAS's option `-malign-branch-prefix-size`, e.g. `-mpad-max-prefix-size` can also elminate NOPs emitted by align directive, so we use a different name here. I remove the option `-malign-branch-prefix-size` since is unimplemented and not needed. If we need to be compatible with GAS, we can make `-malign-branch-prefix-size` an alias for this option later.
Reviewers: jyknight, reames, MaskRay, craig.topper, LuoYuanke
Reviewed By: MaskRay, LuoYuanke
Subscribers: annita.zhang, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77628
LLVM GN Syncbot [Thu, 9 Apr 2020 11:26:04 +0000 (11:26 +0000)]
[gn build] Port
44f0d7f1364
Serguei Katkov [Thu, 9 Apr 2020 11:24:47 +0000 (18:24 +0700)]
Revert "[Codegen/Statepoint] Allow usage of registers for non gc deopt values."
This reverts commit
a0275705bb5aa938119c3e7c8bc957a823450b17.
It causes buildbot failures building LLVM with BUILD_SHARED_LIBS due to a linker error.
Georgii Rymar [Wed, 8 Apr 2020 10:10:01 +0000 (13:10 +0300)]
[obj2yaml] - Do not dump the segment's "Align" field when it is equal to 1.
yaml2obj sets the `Align` to 1 by default, hence we can stop
dumping it to reduce the output.
Differential revision: https://reviews.llvm.org/D77716
Balazs Benics [Thu, 26 Mar 2020 11:30:27 +0000 (12:30 +0100)]
[NFC] Fix Z3 version detection regexp
Summary:
We use the `major.minor.build` version format in this file, except when we try
to parse the result of the test binary.
In that regular expression, we expect the `major.minor.build.rev` format, which
is never fulfilled.
Reviewers: NoQ, george.karpenkov, alexandre.isoard, serge-sans-paille
Reviewed By: NoQ
Subscribers: mgorny, mikhail.ramalho, Charusso, martong, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76837
Pavel Labath [Thu, 9 Apr 2020 10:49:56 +0000 (12:49 +0200)]
Revert "[lldb/Core] Fix a race in the Communication class"
This reverts commit
ebb071345cdae2509c55f9eec76090926fee86a2 -- it seems
to introduce a deadlock in some circumstances.
Florian Hahn [Thu, 9 Apr 2020 10:30:02 +0000 (11:30 +0100)]
[LV] Assert no DbgInfoIntrinsic calls are passed to widening (NFC).
When building a VPlan, BasicBlock::instructionsWithoutDebug() is used to
iterate over the instructions in a block. This means that no recipes
should be created for debug info intrinsics already and we can turn the
early exit into an assertion.
Reviewers: Ayal, gilr, rengolin, aprantl
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D77636
LLVM GN Syncbot [Thu, 9 Apr 2020 10:13:53 +0000 (10:13 +0000)]
[gn build] Port
a0275705bb5
Florian Hahn [Thu, 9 Apr 2020 10:07:36 +0000 (11:07 +0100)]
Temporarily revert "[Attributor] Unify testing (=updates,...)"
This patch reverts the 2 patches below, as on most systems the disabled
tests actually pass and that causes most bots to be red, including
http://green.lab.llvm.org/green/job/clang-stage1-RA/8541/
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/15646/
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/23690
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/16751
* [Attributor] Disable three tests until the SCC update bug was fixed
commit
2ae1a76c27295370d552f57352508b7af4dba791.
* [Attributor] Unify testing (=updates,prefixes,run configurations,...)
2bcf5793e14577ed3c9f15a77a35179ae544fff4.
Pavel Labath [Thu, 2 Apr 2020 11:54:54 +0000 (13:54 +0200)]
[lldb/Core] Fix a race in the Communication class
Summary:
Communication::SynchronizeWithReadThread is called whenever a process
stops to ensure that we process all of its stdout before we report the
stop. If the process exits, we first call this method, and then close
the connection.
However, when the child process exits, the thread reading its stdout
will usually (but not always) read an EOF because the other end of the
pty has been closed. In response to an EOF, the Communication read
thread closes it's end of the connection too.
This can result in a race where the read thread is closing the
connection while the synchronizing thread is attempting to get its
attention via Connection::InterruptRead.
The fix is to hold the synchronization mutex while closing the
connection.
I've found this issue while tracking down a rare flake in some of the
vscode tests. I am not sure this is the cause of those failures (as I
would have expected this issue to manifest itself differently), but it
is an issue nonetheless.
The attached test demonstrates the steps needed to reproduce the race.
It will fail under tsan without this patch.
Reviewers: clayborg, JDevlieghere
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77295
Serguei Katkov [Tue, 7 Apr 2020 04:29:25 +0000 (11:29 +0700)]
[Codegen/Statepoint] Allow usage of registers for non gc deopt values.
The change introduces the usage of physical registers for non-gc deopt values.
This require runtime support to know how to take a value from register.
By default usage is off and can be switched on by option.
The change also introduces additional fix-up patch which forces the spilling
of caller saved registers (clobbered after the call) and re-writes statepoint
to use spill slots instead of caller saved registers.
Reviewers: reames, dantrushin
Reviewed By: reames, dantrushin
Subscribers: mgorny, hiraditya, mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D77371
Jay Foad [Thu, 9 Apr 2020 09:42:16 +0000 (10:42 +0100)]
[CodeGen] Fix a simple FIXME. NFC.
Pratyai Mazumder [Thu, 9 Apr 2020 09:33:36 +0000 (02:33 -0700)]
[SanitizerCoverage] Add -fsanitize-coverage=inline-bool-flag
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Subscribers: cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77637
Jay Foad [Thu, 9 Apr 2020 09:15:07 +0000 (10:15 +0100)]
Fix typo in comment
Jay Foad [Thu, 9 Apr 2020 09:13:53 +0000 (10:13 +0100)]
[AMDGPU] Remove outdated comment
Peter Smith [Thu, 9 Apr 2020 08:53:00 +0000 (09:53 +0100)]
[LLD][ELF][ARM] Fix 32-bit Arm builders, by making test case smaller
Use AT(address) to force the creation of 3 small segments rather than
a single giant one, causing the Arm v8 builder to run out of memory.
Raul Tambre [Thu, 9 Apr 2020 09:18:42 +0000 (02:18 -0700)]
[compiler-rt] Don't print warning about missing testingsupport if not including tests
Reviewers: samsonov, vitalybuka
Reviewed By: vitalybuka
Subscribers: dberris, mgorny, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D77375
Florian Hahn [Thu, 9 Apr 2020 09:23:21 +0000 (10:23 +0100)]
[VPlan] Add & use VPValue operands for VPWidenCallRecipe (NFC).
This patch adds VPValue versions for the arguments of the call to
VPWidenCallRecipe and uses them during code-generation.
Similar to D76373 this reduces ingredient def-use usage by ILV as
a step towards full VPlan-based def-use relations.
Reviewers: Ayal, gilr, rengolin
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D77655
Qiu Chaofan [Thu, 9 Apr 2020 09:13:01 +0000 (17:13 +0800)]
[Docs] Add more FP option description for llc
This patch adds missing description of enable-no-signed-zeros-fp-math
and enable-no-trapping-fp-math options of llc.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D77713
Jay Foad [Wed, 5 Feb 2020 16:15:53 +0000 (16:15 +0000)]
[KnownBits] Move AND, OR and XOR logic into KnownBits
Summary:
There are at least three clients for KnownBits calculations:
ValueTracking, SelectionDAG and GlobalISel. To reduce duplication the
common logic should be moved out of these clients and into KnownBits
itself.
This patch does this for AND, OR and XOR calculations by implementing
and using appropriate operator overloads KnownBits::operator& etc.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74060
Marek Kurdej [Thu, 9 Apr 2020 08:42:04 +0000 (10:42 +0200)]
[clang-tidy] [doc] Fix hicpp-noexcept-move alias links.
Jay Foad [Thu, 9 Apr 2020 07:52:45 +0000 (08:52 +0100)]
[ValueTracking] Simplify KnownBits construction
Use the simpler BitWidth constructor instead of the copy constructor to
make it clear when we don't actually need to copy an existing KnownBits
value. Split out from D74539. NFC.
Nikita Popov [Thu, 9 Apr 2020 07:47:15 +0000 (09:47 +0200)]
[RDA] Avoid negative shift UB
Avoid "left shift of negative value -1" ubsan errors by casting
to uintptr_t before performing the shift, rather than after.
Shu Anzai [Thu, 9 Apr 2020 06:11:55 +0000 (08:11 +0200)]
[lldb] Fixing the bug that the "log timer" has no tab completion
I fixed the bug that the "log timer" has no tab command.
Original code has the only CommandObjectLogTimer class, but it is not
sufficient. Thus I divided the content of CommandObjectLog class into
CommandObjectLogEnable class, CommandObjectLogDisable class,
CommandObjectLogDump class, CommandObjectLogReset class,
CommandObjectLogIncrement class.
Reviewed by: teemperor
Differential Revision: https://reviews.llvm.org/D76906
Serge Pavlov [Thu, 26 Mar 2020 07:51:09 +0000 (14:51 +0700)]
[FPEnv] Use single enum to represent rounding mode
Now compiler defines 5 sets of constants to represent rounding mode.
These are:
1. `llvm::APFloatBase::roundingMode`. It specifies all 5 rounding modes
defined by IEEE-754 and is used in `APFloat` implementation.
2. `clang::LangOptions::FPRoundingModeKind`. It specifies 4 of 5 IEEE-754
rounding modes and a special value for dynamic rounding mode. It is used
in clang frontend.
3. `llvm::fp::RoundingMode`. Defines the same values as
`clang::LangOptions::FPRoundingModeKind` but in different order. It is
used to specify rounding mode in in IR and functions that operate IR.
4. Rounding mode representation used by `FLT_ROUNDS` (C11, 5.2.4.2.2p7).
Besides constants for rounding mode it also uses a special value to
indicate error. It is convenient to use in intrinsic functions, as it
represents platform-independent representation for rounding mode. In this
role it is used in some pending patches.
5. Values like `FE_DOWNWARD` and other, which specify rounding mode in
library calls `fesetround` and `fegetround`. Often they represent bits
of some control register, so they are target-dependent. The same names
(not values) and a special name `FE_DYNAMIC` are used in
`#pragma STDC FENV_ROUND`.
The first 4 sets of constants are target independent and could have the
same numerical representation. It would simplify conversion between the
representations. Also now `clang::LangOptions::FPRoundingModeKind` and
`llvm::fp::RoundingMode` do not contain the value for IEEE-754 rounding
direction `roundTiesToAway`, although it is supported natively on
some targets.
This change defines all the rounding mode type via one `llvm::RoundingMode`,
which also contains rounding mode for IEEE rounding direction `roundTiesToAway`.
Differential Revision: https://reviews.llvm.org/D77379
Pratyai Mazumder [Thu, 9 Apr 2020 05:02:41 +0000 (22:02 -0700)]
[SanitizerCoverage] sancov/inline-bool-flag instrumentation.
Summary:
New SanitizerCoverage feature `inline-bool-flag` which inserts an
atomic store of `1` to a boolean (which is an 8bit integer in
practice) flag on every instrumented edge.
Implementation-wise it's very similar to `inline-8bit-counters`
features. So, much of wiring and test just follows the same pattern.
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, hiraditya, jfb, cfe-commits, #sanitizers
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D77244
Vitaly Buka [Thu, 9 Apr 2020 05:13:19 +0000 (22:13 -0700)]
[NFC][SanitizerCoverage] Simplify alignment calculation
This reverts commit
e42f2a0cd8b8007c816d0e63f5000c444e29105e.
Johannes Doerfert [Thu, 9 Apr 2020 05:31:41 +0000 (00:31 -0500)]
[Attributor] Disable three tests until the SCC update bug was fixed
D76588 exposed an SCC update bug in three tests which manifests
sometimes, e.g., on this bot that runs expensive checks:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23032/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Afp80.ll
We disable the tests temporarily to investigate.
LLVM GN Syncbot [Thu, 9 Apr 2020 05:18:49 +0000 (05:18 +0000)]
[gn build] Port
a3dc9490004
WangTianQing [Thu, 9 Apr 2020 05:15:42 +0000 (13:15 +0800)]
[X86] Add TSXLDTRK instructions.
Summary: For more details about these instructions, please refer to the latest ISE document: https://software.intel.com/en-us/download/intel-architecture-instruction-set-extensions-programming-reference
Reviewers: craig.topper, RKSimon, LuoYuanke
Reviewed By: craig.topper
Subscribers: mgorny, hiraditya, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77205
Johannes Doerfert [Thu, 9 Apr 2020 00:04:57 +0000 (19:04 -0500)]
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
Johannes Doerfert [Mon, 23 Mar 2020 06:09:49 +0000 (01:09 -0500)]
[CallGraphUpdater] Remove dead constants before replacing a function
Dead constants might be left when a function is replaced, we can
gracefully handle this case and avoid complexity for the users who would
see an assertion otherwise.
Lang Hames [Thu, 9 Apr 2020 02:23:02 +0000 (19:23 -0700)]
[ORC] Make mangling convenience methods part of the public API of LLJIT.
This saves clients from having to manually construct a MangleAndInterner.
Uday Bondhugula [Wed, 8 Apr 2020 07:01:48 +0000 (12:31 +0530)]
[MLIR] ShapedType accessor minor fixes + add isDynamicDim accessor
Minor fixes and cleanup for ShapedType accessors, use
ShapedType::kDynamicSize, add ShapedType::isDynamicDim.
Differential Revision: https://reviews.llvm.org/D77710
Jonas Devlieghere [Thu, 9 Apr 2020 00:35:05 +0000 (17:35 -0700)]
[lldb/Docs] Elaborate on reproducer testing
Matt Arsenault [Wed, 8 Apr 2020 21:25:21 +0000 (17:25 -0400)]
MIR: Use Register
River Riddle [Thu, 9 Apr 2020 01:33:24 +0000 (18:33 -0700)]
[mlir][NFC] Wrap the cl::opts in JitRunner within a struct to avoid global initializers.
Summary: This avoids the need for having global static initializers within the JITRunner support library, and only constructs the options when the runner is invoked.
Differential Revision: https://reviews.llvm.org/D77760
Sam Clegg [Tue, 7 Apr 2020 21:02:20 +0000 (14:02 -0700)]
[WebAssembly][MC] Use StringRef over std::string pointer
This is followup based on feedback on
5be42f36f56.
See: https://reviews.llvm.org/D77627.
Differential Revision: https://reviews.llvm.org/D77674
Craig Topper [Thu, 9 Apr 2020 01:04:28 +0000 (18:04 -0700)]
[LoopVectorize] Move testing for SVML vectorization of exp2f_finite/exp2_finite from svml-calls.ll to svml-calls-finite.ll where the finite versions of log, pow, and exp already were.
Craig Topper [Wed, 8 Apr 2020 23:59:36 +0000 (16:59 -0700)]
[InstCombine] Avoid a call to deprecated version of CreateCall.
Passing a Value * to CreateCall has to call getPointerElementType
to find the type of the pointer.
In this case we can rely on the fact that Intrinsic::getDeclaration
returns a Function * and use that version of CreateCall.
Johannes Doerfert [Wed, 8 Apr 2020 22:24:24 +0000 (17:24 -0500)]
[Attributor][NFC] Split AbstractAttributes out of Attributor.cpp
Attributor.cpp became quite big and we need to start provide structure.
The Attributor code is now in Attributor.cpp and the classes derived
from AbstractAttribute are in AttributorAttributes.cpp. Minor changes
were required but no intended functional changes.
We also minimized includes as part of this.
Reviewed By: baziotis
Differential Revision: https://reviews.llvm.org/D76873
River Riddle [Wed, 8 Apr 2020 23:51:26 +0000 (16:51 -0700)]
[mlir] Mark ClassID::getID as LLVM_EXTERNAL_VISIBILITY to ensure only one version exists
Summary: ClassID is used as a type id and must be unique in the face of shared libraries to ensure correctness. This fixes failures related to BUILD_SHARED_LIBs on macos.
Differential Revision: https://reviews.llvm.org/D77764
Christopher Tetreault [Wed, 8 Apr 2020 23:17:08 +0000 (16:17 -0700)]
Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: espindola, efriedma, sdesmalen
Reviewed By: efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77275
Christopher Tetreault [Wed, 8 Apr 2020 22:27:41 +0000 (15:27 -0700)]
Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: hfinkel, efriedma, sdesmalen
Reviewed By: efriedma
Subscribers: wuzish, nemanjai, hiraditya, kbarton, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77266
Jonas Devlieghere [Wed, 8 Apr 2020 22:34:13 +0000 (15:34 -0700)]
[lldb/Python] Add lldbconfig module to make the lldb module configurable
Using the approach suggested by Pavel in D77588, this patch introduces a
new lldbconfig module that lives next to the lldb module. It makes it
possible to make the lldb module configurable before importing it. More
specifically it makes it possible to delay initializing the debugger,
which is needed for testing the reproducer.
Differential revision: https://reviews.llvm.org/D77661
Jonathan Roelofs [Sun, 5 Apr 2020 20:42:16 +0000 (14:42 -0600)]
[mlir] Remove need for static global ctors from mlir-translate
Summary: https://bugs.llvm.org/show_bug.cgi?id=45436
Reviewers: mehdi_amini, mravishankar, antiagainst, rriddle, stephenneuendorffer
Reviewed By: mehdi_amini, rriddle, stephenneuendorffer
Subscribers: frgossen, stephenneuendorffer, jholewinski, mgorny, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77515
Eric Fiselier [Wed, 8 Apr 2020 22:25:01 +0000 (18:25 -0400)]
[libc++] Fix failing concepts tests
Christopher Tetreault [Wed, 8 Apr 2020 17:42:22 +0000 (10:42 -0700)]
Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: sdesmalen, rriddle, efriedma
Reviewed By: sdesmalen
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77263
Eric Christopher [Wed, 8 Apr 2020 22:12:53 +0000 (15:12 -0700)]
Fix -Wdeprecated-copy warning in XcodeSDK.
Eric Fiselier [Wed, 8 Apr 2020 22:00:13 +0000 (18:00 -0400)]
[libcxx] Adds [concept.same]
Patch from Christopher Di Bella (cjdb@google.com)
Reviewed as https://reviews.llvm.org/D74291
Adds `std::same_as` to libc++. Since there aren't clang-format rules for
//requires-expressions//, I'll need to disable the formatter in certain areas.
Amara Emerson [Wed, 8 Apr 2020 21:15:25 +0000 (14:15 -0700)]
GlobalISel: Add a setInstrAndDebugLoc(MachineInstr&) convenience helper to MachineIRBuilder. NFC.
This saves doing two separate calls to set the Instr and DebugLoc from an existing MI.
River Riddle [Wed, 8 Apr 2020 21:18:15 +0000 (14:18 -0700)]
[mlir][NFC] Wrap static DenseMap inside of a function to avoid the need for a global static initializer
This also helps to abstract away the exact implementation details of the loopup method if we wish to change it in the future.
Matt Arsenault [Wed, 8 Apr 2020 20:37:44 +0000 (16:37 -0400)]
CodeGen: Use Register in MachineInstrBuilder
Nicolas Vasilache [Wed, 8 Apr 2020 18:53:37 +0000 (14:53 -0400)]
[mlir][Linalg] Add a test for a fused Linalg pass based on DRR to go from matmul to vectors
This revision builds a simple "fused pass" consisting of 2 levels of tiling, memory promotion and vectorization using linalg transformations written as composable pattern rewrites.
River Riddle [Wed, 8 Apr 2020 20:23:13 +0000 (13:23 -0700)]
[mlir][NFC] Remove cl::opts for LoopUnroll now that the pass uses PassOptions
instead.
These were missed when the opts were replaced, and are unused.
Erich Keane [Wed, 8 Apr 2020 20:14:33 +0000 (13:14 -0700)]
Make target features check work with ctor and dtor-
The problem was reported in PR45468, applying target features to an
always_inline constructor/destructor runs afoul of GlobalDecl
construction assert when checking for target-feature compatibility.
The core problem is fixed by using the version of the check that takes a
FunctionDecl rather than the GlobalDecl. However, while writing the
test, I discovered that source locations weren't properly set for this
check on ctors/dtors. This patch also fixes constructors and CALLED destructors.
Unfortunately, it doesn't seem too possible to get a meaningful source
location for a 'cleanup' destructor, so those are still 'frontend' level
errors unfortunately. A fixme was added to the test to cover that
situation.
Louis Dionne [Wed, 8 Apr 2020 20:05:02 +0000 (16:05 -0400)]
[libc++] CI: Always build for both i386 and x86_64 in the back-deployment script
River Riddle [Wed, 8 Apr 2020 19:57:02 +0000 (12:57 -0700)]
[mlir] Eliminate the remaining usages of cl::opt instead of PassOption.
Summary: Pass options are a better choice for various reasons and avoid the need for static constructors.
Differential Revision: https://reviews.llvm.org/D77707
LLVM GN Syncbot [Wed, 8 Apr 2020 20:00:26 +0000 (20:00 +0000)]
[gn build] Port
8b67853a83c
Kirill Naumov [Tue, 31 Mar 2020 18:43:25 +0000 (18:43 +0000)]
[CFGPrinter] Adding heat coloring to CFGPrinter
This patch introduces the heat coloring of the Control Flow Graph which is based
on the relative "hotness" of each BB. The patch is a part of sequence of three
patches, related to graphs Heat Coloring.
Reviewers: rcorcs, apilipenko, davidxl, sfertile, fedor.sergeev, eraman, bollu
Differential Revision: https://reviews.llvm.org/D77161
Raul Tambre [Wed, 8 Apr 2020 19:05:49 +0000 (12:05 -0700)]
[clang][CodeGen] Handle throw expression in conditional operator constant folding
Summary:
We're smart and do constant folding when emitting conditional operators.
Thus we emit the live value as a lvalue. This doesn't work if the live value is a throw expression.
Handle this by emitting the throw and returning the dead value as the lvalue.
Fixes PR28184.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77502
Vedant Kumar [Wed, 8 Apr 2020 19:16:20 +0000 (12:16 -0700)]
unittest: Disable MachineInstrClone.CopyCallSiteInfo entirely
Somehow, details about the host architecture are creeping into the bogus
target set up in MFCommon.inc, causing call site info to be disabled:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/41476
http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/17987
Disable the test to unblock the bots until I can figure this out.
Vedant Kumar [Wed, 8 Apr 2020 19:09:01 +0000 (12:09 -0700)]
unittest: Disable MachineInstrClone.CopyCallSiteInfo on Windows
A bot error (http://45.33.8.238/win/12463/step_11.txt) reports 'unknown
file: error: SEH exception with code 0x3221225477 thrown in the test
body', but I don't know what causes this.
It looks like this has come up before, but afaict the root causes could
be different:
https://reviews.llvm.org/rL329195, and in
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20180910/587425.html
I tried testing locally with UBSan, but that didn't uncover anything.
Fangrui Song [Wed, 8 Apr 2020 17:22:09 +0000 (10:22 -0700)]
[Driver] Default arm-linux-androideabi to -z max-page-size=4096
Similar to D55029. The requirement arises when discussing increasing
default max-page-size for lld ARM (D77330).
For the record, the default max-page-size on the 3 commonly used linkers:
* GNU ld since 2014 (https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=
7572ca8989ead4c3425a1500bc241eaaeffa2c89) defaults to 65536
* GNU gold remains 4096
* lld<=10 uses 4096. lld from 11 onwards will use 65536 (D77330)
Reviewed By: srhines, thieta
Differential Revision: https://reviews.llvm.org/D77746
Louis Dionne [Tue, 7 Apr 2020 19:02:37 +0000 (15:02 -0400)]
[libc++] Update the documentation for running Lit to reflect reality
Our documentation for running LIT is basically wrong, since it doesn't
mention `llvm-lit`, and nothing works without it. Note that this
documentation improvement reflects the current reality outside of
the recent efforts on improving the test suite. My goal is to document
the current way of running the test suite, so that everybody agrees on
how things currently work. As the configuration system for libc++ gets
simplified, we can come back and keep this documentation up to date to
reflect those changes.
Differential Revision: https://reviews.llvm.org/D77673
Michael Wyman [Wed, 8 Apr 2020 18:31:51 +0000 (11:31 -0700)]
First test commit - empty
Matt Arsenault [Wed, 8 Apr 2020 17:50:35 +0000 (13:50 -0400)]
CodeGen: Use Register in MachineSSAUpdater
Artem Belevich [Tue, 7 Apr 2020 22:51:23 +0000 (15:51 -0700)]
[CUDA] Improve testing of libdevice detection.
Added new testcases for libdevice in CUDA-9+ and removed unused checks.
Differential Revision: https://reviews.llvm.org/D77688
Artem Belevich [Tue, 7 Apr 2020 18:00:19 +0000 (11:00 -0700)]
[CUDA] Add partial support for recent CUDA versions.
Generate PTX using newer versions of PTX and allow using sm_80 with CUDA-11.
None of the new features of CUDA-10.2+ have been implemented yet, so using these
versions will still produce a warning.
Differential Revision: https://reviews.llvm.org/D77670
Artem Belevich [Mon, 6 Apr 2020 22:21:24 +0000 (15:21 -0700)]
[CUDA] Simplify GPU variant handling. NFC.
Instead of hardcoding individual GPU mappings in multiple functions, keep them
all in one table and use it to look up the mappings.
We also don't care about 'virtual' architecture much, so the API is trimmed down
down to a simpler GPU->Virtual arch name lookup.
Differential Revision: https://reviews.llvm.org/D77665
Davide Italiano [Wed, 8 Apr 2020 18:06:00 +0000 (11:06 -0700)]
[DWARF] Not all the constant variables are "static".
Fixes rdar://problem/
61402307
Differential Revision: https://reviews.llvm.org/D77698
Vedant Kumar [Tue, 7 Apr 2020 20:09:29 +0000 (13:09 -0700)]
MachineFunction: Copy call site info when duplicating insts
Summary:
Preserve call site info for duplicated instructions. We copy over the
call site info in CloneMachineInstrBundle to avoid repeated calls to
copyCallSiteInfo in CloneMachineInstr.
(Alternatively, we could copy call site info higher up the stack, e.g.
into TargetInstrInfo::duplicate, or even into individual backend passes.
However, I don't see how that would be safer or more general than the
current approach.)
Reviewers: aprantl, djtodoro, dstenb
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77685
Walter Erquinigo [Sat, 4 Apr 2020 00:16:15 +0000 (17:16 -0700)]
[commands] Support autorepeat in SBCommands
Summary:
This adds support for commands created through the API to support autorepeat.
This covers the case of single word and multiword commands.
Comprehensive tests are included as well.
Reviewers: labath, clayborg
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77444
Walter Erquinigo [Wed, 8 Apr 2020 17:46:30 +0000 (10:46 -0700)]
Fix
e796c77b26acab0b530ac6516f1dda21b8494733
Failure:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/14556/testReport/junit/lldb-api/tools_lldb-vscode_breakpoint-events/TestVSCode_breakpointEvents_py/
Diff:
[lldb-vscode] Correctly return source mapped breakpoints for setBreakpoints request
https://reviews.llvm.org/D76968
It failed a test TestVSCode_breakpointEvents that only runs Darwin that needed to be updated to match the current logic.
The change is simple.
Matt Arsenault [Wed, 8 Apr 2020 16:26:32 +0000 (12:26 -0400)]
DAG: Use Register
Sean Fertile [Wed, 8 Apr 2020 17:25:06 +0000 (13:25 -0400)]
[PowerPC][AIX][NFC] Replace deprecated getByValAlign call.
Replace call to deprecated 'getByValAlign()' with
'getNonZeroByValAlign()'.
Paula Toth [Wed, 8 Apr 2020 17:16:30 +0000 (10:16 -0700)]
[libc][NFC] Make all top of file comments consistent.
Summary:
Made all header files consistent based of this documentation: https://llvm.org/docs/CodingStandards.html#file-headers.
And did the same for all source files top of file comments.
Reviewers: sivachandra, abrachet
Reviewed By: sivachandra, abrachet
Subscribers: MaskRay, tschuett, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D77533
Simon Pilgrim [Wed, 8 Apr 2020 17:12:55 +0000 (18:12 +0100)]
[InstCombine] Regenerate phi-preserve-ir-flags.ll test checks to fix issue reported on D77354
zoecarver [Wed, 8 Apr 2020 17:01:14 +0000 (10:01 -0700)]
Fix __is_pointer builtin type trait to work with Objective-C pointer types.
Summary: 5ade17e broke __is_pointer for Objective-C pointer types. This patch fixes the builtin and re-applies the change to type_traits.
Tags: #clang, #libc
Differential Revision: https://reviews.llvm.org/D77519
Simon Pilgrim [Wed, 8 Apr 2020 16:52:26 +0000 (17:52 +0100)]
[PowerPC] Regenerate optcmp.ll test checks to fix issue reported on D77354
Walter Erquinigo [Sat, 28 Mar 2020 02:31:14 +0000 (19:31 -0700)]
[lldb-vscode] Correctly return source mapped breakpoints for setBreakpoints request
Summary:
When using source maps for a breakpoint, in order to find the actual source that breakpoint has resolved, we
need to use a query similar to what CommandObjectSource::DumpLinesInSymbolContexts does, which is the logic
used by the CLI to display the source line at a given breakpoint. That's necessary because from a breakpoint
location you only have an address, which points to the original source location, not the source mapped one.
in the setBreakpoints request handler, we haven't been doing such query and we were returning the original
source location, which was breaking the UX of VSCode, as many breakpoints were being set but not displayed
in the source file next to each line. Besides, clicking the source path of a breakpoint in the breakpoints
view in the debug tab was not working for this case, as VSCode was trying to open a non-existent file, thus
showing an error to the user.
Ideally, we should do the query mentioned above to find the actual source location to respond to the IDE,
however, that query is expensive and users can have an arbitrary number of breakpoints set. As a simpler fix,
the request sent by VSCode already contains the full source path, which exists because the user set it from
the IDE itself, so we can simply reuse it instead of querying from the SB API.
I wrote a test for this, and found out that I had to move SetSourceMapFromArguments after RunInitCommands in
lldb-vscode.cpp, because an init command used in all tests is `settings clear -all`, which would clear the
source map unless specified after initCommands. And in any case, I think it makes sense to have initCommands
run before anything the debugger would do.
Reviewers: clayborg, kusmour, labath, aadsm
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D76968
Uday Bondhugula [Wed, 8 Apr 2020 16:09:43 +0000 (21:39 +0530)]
[MLIR] Fix test case typos in unroll.mlir
Fix check line typos in test/Dialect/Affine/unroll.mlir.
Differential Revision: https://reviews.llvm.org/D77738
zoecarver [Wed, 8 Apr 2020 16:40:33 +0000 (09:40 -0700)]
[libc++] Remove std::optional from ObjC is_scalar test.
std::optional requires C++17. Instead of only running the test above
C++14, this commit removes uses of std::optional from the test (it's
already tested in block.objc.pass.mm).
Simon Pilgrim [Wed, 8 Apr 2020 16:34:28 +0000 (17:34 +0100)]
[PowerPC] Fix fold-rlwinm.mir typos in checks to fix issue reported on D77354
Fangrui Song [Tue, 7 Apr 2020 04:12:19 +0000 (21:12 -0700)]
[ELF] --warn-backrefs: don't warn if -u/--export-dynamic-symbol
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D77630
Nikita Popov [Wed, 8 Apr 2020 16:29:55 +0000 (18:29 +0200)]
[RDA] Try to fix build, again (NFC)
Simon Pilgrim [Wed, 8 Apr 2020 16:17:44 +0000 (17:17 +0100)]
[PowerPC] Fix fold-frame-offset-using-rr.mir typos in checks to fix issue reported on D77354
Extra spaces, copy+paste duplicates and missing test name check
Nikita Popov [Wed, 8 Apr 2020 16:13:24 +0000 (18:13 +0200)]
[RDA] Try to fix build (NFC)
fuchsia-x86_64-linux builder fails with:
/b/fuchsia-x86_64-linux/llvm.src/llvm/include/llvm/ADT/TinyPtrVector.h:85:15:
error: no matching conversion for C-style cast from 'nullptr_t' to 'llvm::ReachingDef'
RHS.Val = (EltTy)nullptr;
Let's see whether adding an explicit nullptr_t constructor helps.
Matt Arsenault [Wed, 8 Apr 2020 14:57:11 +0000 (10:57 -0400)]
FastISel: Partially use Register
Doesn't try to convert the cases that depend on generated code.
Matt Arsenault [Wed, 8 Apr 2020 14:49:37 +0000 (10:49 -0400)]
CodeGen: Use Register more in CallLowering
Some of these MCPhysReg uses should probably be MCRegister, but right
now this would require more invasive changes.
Matt Arsenault [Wed, 8 Apr 2020 14:40:26 +0000 (10:40 -0400)]
CodeGen: Use Register in MachineBasicBlock
Matt Arsenault [Wed, 8 Apr 2020 14:29:30 +0000 (10:29 -0400)]
CodeGen: Use Register in TargetLowering
Simon Pilgrim [Wed, 8 Apr 2020 16:05:14 +0000 (17:05 +0100)]
[AMDGPU] Refresh fmin_legacy.ll checks to fix issue reported on D77354
Some of the condition codes had inverted since this was generated
Kirill Naumov [Fri, 27 Mar 2020 18:38:32 +0000 (18:38 +0000)]
[TimePasses] Small fix in "-time-passes" flag that makes it more stable
Adds StringMap for TimingData.
Differential Revision: https://reviews.llvm.org/D76946
Reviewed By: fedor.sergeev
Andy Davis [Wed, 8 Apr 2020 15:39:48 +0000 (08:39 -0700)]
[MLIR][Vector] Update ShapeCastOp folder to use producer-consumer value forwarding.
Summary:
Update ShapeCastOp folder to use producer-consumer value forwarding.
Support is added for tracking sub-vectors through trivial shape cast operations,
where the sub-vector shape is preserved across shape cast operations and only
leading ones are added or removed.
Support is preserved for cancelling shape cast operations.
One unit test is added and two are updated.
Reviewers: aartbik, nicolasvasilache
Reviewed By: aartbik, nicolasvasilache
Subscribers: frgossen, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77253
Nikita Popov [Sun, 5 Apr 2020 15:59:57 +0000 (17:59 +0200)]
[RDA] Use TinyPtrVector to store reaching defs (NFCI)
RDA currently uses SmallVector<int, 1> to store reaching definitions.
A SmallVector<int, 1> is 24 bytes large, and X86 currently has
164 register units, which means we need 3936 bytes per block.
If you have a large function with 1000 blocks, that's already 4MB.
A large fraction of these reg units will not have any reaching defs
(say, those corresponding to zmm registers), and many will have just
one. A TinyPtrVector serves this use-case much better, as it only
needs 8 bytes per register if it has 0 or 1 reaching defs.
As the name implies, TinyPtrVector is designed to work with pointers,
so we need to add some boilerplate to treat our reaching def integers
as pointers, using an appropriate encoding. We need to keep the low
bit free for tagging, and make sure at least one bit is set to
distinguish the null pointer.
Differential Revision: https://reviews.llvm.org/D77513
Sean Fertile [Tue, 24 Mar 2020 17:17:22 +0000 (13:17 -0400)]
[PowerPC][AIX] Enable passing byval formal arguments in multiple registers.
Any or all the argument registers can be used to pass a byval formal
argument, with the limitation that the argument must fit in the
available registers (ie: is not split between registers and stack).
Differential Revision: https://reviews.llvm.org/D76902