Tobias Grosser [Thu, 10 Aug 2017 08:00:56 +0000 (08:00 +0000)]
[GPGPU] Make the ast_build available to block generator
This is necessary for partial writes (as used by delicm) to work.
llvm-svn: 310553
Elad Cohen [Thu, 10 Aug 2017 07:44:23 +0000 (07:44 +0000)]
[SelectionDAG] When scalarizing vselect, don't assert on
a legal cond operand.
When scalarizing the result of a vselect, the legalizer currently expects
to already have scalarized the operands. While this is true for the true/false
operands (which have the same type as the result), it is not case for the
condition operand. On X86 AVX512, v1i1 is legal - this leads to operations such
as '< N x type> vselect < N x i1> < N x type> < N x type>' where < N x type > is
illegal to hit an assertion during the scalarization.
The handling is similar to r205625.
This also exposes the fact that (v1i1 extract_subvector) should be legal
and selectable on AVX512 - We do this by custom lowering to vector_extract_elt.
This still leaves us in some cases with redundant dag nodes which will be
combined in a separate soon to come patch.
This fixes pr33349.
Differential revision: https://reviews.llvm.org/D36511
llvm-svn: 310552
Philip Pfaffe [Thu, 10 Aug 2017 07:43:46 +0000 (07:43 +0000)]
[Polly][PM] Improve invalidation in the Scop-Pipeline
Summary:
During code generation for a Scop we modify the IR of a function.
While this shouldn't affect a Scop in the formal sense, the implementation
caches various information about the IR such as SCEV expressions for bounds or
parameters. This cached information needs to be updated or invalidated. To this
end, SPMUpdater allows passes to report when they've invalidated a Scop to the
PassManager, which will then flush and recompute all Scops. This in turn
invalidates all iterators, so references to Scops shouldn't be held.
Reviewers: grosser, Meinersbur, bollu
Reviewed By: grosser
Subscribers: llvm-commits, pollydev
Differential Revision: https://reviews.llvm.org/D36524
llvm-svn: 310551
Dehao Chen [Thu, 10 Aug 2017 05:10:32 +0000 (05:10 +0000)]
Revert part of r310296 to make it really NFC for instrumentation PGO.
Summary: Part of r310296 will disable PGOIndirectCallPromotion in ThinLTO backend if PGOOpt is None. However, as PGOOpt is not passed down to ThinLTO backend for instrumentation based PGO, that change would actually disable ICP entirely in ThinLTO backend, making it behave differently in instrumentation PGO mode. This change reverts that change, and only disable ICP there when it is SamplePGO.
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: sanjoy, mehdi_amini, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D36566
llvm-svn: 310550
Gheorghe-Teodor Bercea [Thu, 10 Aug 2017 05:01:42 +0000 (05:01 +0000)]
[OpenMP] Provide a default GPU arch that is supported by
the underlying hardware.
This fixes a bug triggered by diff: D29660
llvm-svn: 310549
Petr Hosek [Thu, 10 Aug 2017 04:16:38 +0000 (04:16 +0000)]
[Driver] Search compiler-rt paths in -print-file-name=
This makes it possible to print the name of compiler-rt libraries
by using simply clang -print-file-name=libclang_rt.${runtime}-${arch}.so
same as other libraries, without having to know the details of the
resource directory organization.
Differential Revision: https://reviews.llvm.org/D35820
llvm-svn: 310548
Chandler Carruth [Thu, 10 Aug 2017 03:05:21 +0000 (03:05 +0000)]
[LCG] Fix an assert in a on-scope-exit lambda that checked the contents
of the returned value.
Checking the returned value from inside of a scoped exit isn't actually
valid. It happens to work when NRVO fires and the stars align, which
they reliably do with Clang but don't, for example, on MSVC builds.
llvm-svn: 310547
Erik Pilkington [Thu, 10 Aug 2017 02:48:13 +0000 (02:48 +0000)]
[demangler] Fix some more -Wshadow warnings I missed in r310535
llvm-svn: 310546
Hiroshi Yamauchi [Thu, 10 Aug 2017 02:23:14 +0000 (02:23 +0000)]
[LVI] Fix LVI compile time regression around constantFoldUser()
Summary:
Avoid checking each operand and calling getValueFromCondition() before calling
constantFoldUser() when the instruction type isn't supported by
constantFoldUser().
This fixes a large compile time regression in an internal build.
Reviewers: sanjoy
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36552
llvm-svn: 310545
Jacob Bandes-Storch [Thu, 10 Aug 2017 01:30:22 +0000 (01:30 +0000)]
[clang-format] let PointerAlignment dictate spacing of function ref qualifiers
Summary: The original changes for ref qualifiers in rL272537 and rL272548 allowed function const+ref qualifier spacing to diverge from the spacing used for variables. It seems more consistent for `T const& x;` to match `void foo() const&;`.
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D34324
llvm-svn: 310544
Peter Collingbourne [Thu, 10 Aug 2017 01:07:44 +0000 (01:07 +0000)]
Linker: Create a function declaration when moving a non-prevailing alias of function type.
We were previously creating a global variable of function type,
which is invalid IR. This issue was exposed by r304690, in which we
started asserting that global variables were of a valid type.
Fixes PR33462.
Differential Revision: https://reviews.llvm.org/D36438
llvm-svn: 310543
Craig Topper [Thu, 10 Aug 2017 01:02:02 +0000 (01:02 +0000)]
[InstSimplify] Add test cases that show that simplifySelectWithICmpCond doesn't work with non-canonical comparisons.
llvm-svn: 310542
Eugene Zelenko [Thu, 10 Aug 2017 00:46:15 +0000 (00:46 +0000)]
[AMDGPU] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 310541
Matt Arsenault [Thu, 10 Aug 2017 00:19:43 +0000 (00:19 +0000)]
Remove unused function
llvm-svn: 310540
Jacob Bandes-Storch [Thu, 10 Aug 2017 00:15:31 +0000 (00:15 +0000)]
clang-format: Fix bug with ENAS_DontAlign and empty lines
This fixes a bug in `ENAS_DontAlign` (introduced in D32733) where blank lines had an EscapedNewlineColumn of 0, causing a subtraction to overflow when converted back to unsigned and leading to runaway memory allocation.
Differential Revision: https://reviews.llvm.org/D36019
llvm-svn: 310539
Gheorghe-Teodor Bercea [Wed, 9 Aug 2017 23:47:41 +0000 (23:47 +0000)]
[OpenMP] Remove offending test.
Diff: D29660
llvm-svn: 310537
Evgeniy Stepanov [Wed, 9 Aug 2017 23:24:07 +0000 (23:24 +0000)]
Fix thinlto cache key computation for cfi-icall.
Summary:
Fixed PR33966.
CFI code generation for users (not just callers) of a function depends
on whether this function has a jumptable entry or not. This
information needs to be encoded in of thinlto cache key.
We filter the jumptable list against functions that are actually
referenced in the current module.
Subscribers: mehdi_amini, inglorion, eraman, hiraditya
Differential Revision: https://reviews.llvm.org/D36346
llvm-svn: 310536
Erik Pilkington [Wed, 9 Aug 2017 22:45:35 +0000 (22:45 +0000)]
[demangler] Fix a bunch of -Wshadow warnings
These were causing failures in -Werror builds.
llvm-svn: 310535
Matthias Braun [Wed, 9 Aug 2017 22:22:05 +0000 (22:22 +0000)]
ARM: Fix CMP_SWAP expansion
Clean up after my misguided attempt in r304267 to "fix" CMP_SWAP
returning an uninitialized status value.
- I was always using tMOVi8 to zero the status register which cannot
encode higher register numbers and llvm would silently miscompile)
- Nobody was ever looking at that status value outside the expansion.
ARMDAGToDAGISel::SelectCMP_SWAP() the only place creating CMP_SWAP
instructions was not mapping anything to it. (The cmpxchg status value
from llvm IR is lowered to a manual comparison after the CMP_SWAP)
So this:
- Renames the register from "status" to "temp" it make it obvious that
it isn't used outside the expansion.
- Remove the zeroing status/temp register.
- Keep the live-in list improvements from r304267
Fixes http://llvm.org/PR34056
llvm-svn: 310534
Matthias Braun [Wed, 9 Aug 2017 22:22:04 +0000 (22:22 +0000)]
LangRef: Fix/improve cmpxchg wording
llvm-svn: 310533
Benjamin Kramer [Wed, 9 Aug 2017 22:09:29 +0000 (22:09 +0000)]
[clang-tidy] Don't compute the edit distance if it's over the threshold.
No functional change intended.
llvm-svn: 310532
Benjamin Kramer [Wed, 9 Aug 2017 22:06:32 +0000 (22:06 +0000)]
[Path] Sink predicate computations to their uses. NFCI.
llvm-svn: 310531
Erik Pilkington [Wed, 9 Aug 2017 21:51:56 +0000 (21:51 +0000)]
Mark test as unsupported c++98/03 to fix buildbots
llvm-svn: 310530
Coby Tayree [Wed, 9 Aug 2017 21:50:22 +0000 (21:50 +0000)]
[X86][Asm] Allow negative immediate to appear before bracketed expression
Currently, only non-negative immediate is allowed prior to a brac expression (memory reference).
MASM / GAS does not have any problem cope with the left side of the real line, so we should be able to as well.
llvm: D36229
Differential Revision: https://reviews.llvm.org/D36230
llvm-svn: 310529
Coby Tayree [Wed, 9 Aug 2017 21:49:17 +0000 (21:49 +0000)]
[X86][Asm] Allow negative immediate to appear before bracketed expression
Currently, only non-negative immediate is allowed prior to a brac expression (memory reference).
MASM / GAS does not have any problem cope with the left side of the real line, so we should be able to as well.
Differntial Revision: https://reviews.llvm.org/D36229
llvm-svn: 310528
Matt Arsenault [Wed, 9 Aug 2017 21:44:58 +0000 (21:44 +0000)]
AMDGPU: Use direct struct returns and arguments
This is an improvement over always using byval for
structs.
This will use registers until ~16 are used, and then
switch back to byval. This needs more work, since I'm
not sure it ever really makes sense to use byval. If
the register limit is exceeded, the arguments still
end up passed on the stack, but with a different ABI.
It also may make sense to base this on number of
registers used for non-struct arguments, rather than
just arguments that appear first in the argument list.
llvm-svn: 310527
Rui Ueyama [Wed, 9 Aug 2017 21:32:38 +0000 (21:32 +0000)]
Add --icf=none option.
--icf=none negates --icf=all.
llvm-svn: 310526
Erik Pilkington [Wed, 9 Aug 2017 21:30:57 +0000 (21:30 +0000)]
[demangler] Improve representation of substitutions/templates
Differential revision: https://reviews.llvm.org/D36427
llvm-svn: 310525
Krzysztof Parzyszek [Wed, 9 Aug 2017 21:22:05 +0000 (21:22 +0000)]
[Hexagon] Ignore DBG_VALUEs when counting instructions in hexagon-early-if
llvm-svn: 310524
George Burgess IV [Wed, 9 Aug 2017 21:20:41 +0000 (21:20 +0000)]
Use unsigned instead of an enum for map keys
ubsan's enum sanitizer doesn't like the latter, and we had to have
out-of-bounds values for DenseMapInfo's tombstone/empty keys.
llvm-svn: 310523
Benoit Belley [Wed, 9 Aug 2017 20:58:39 +0000 (20:58 +0000)]
[Linker] PR33527 - Linker::LinkOnlyNeeded should import AppendingLinkage globals
Linker::LinkOnlyNeeded should always import globals with
AppendingLinkage.
This resolves PR33527.
Differential Revision: https://reviews.llvm.org/D34448
llvm-svn: 310522
Gabor Horvath [Wed, 9 Aug 2017 20:56:43 +0000 (20:56 +0000)]
[Sema] Assign new flag -Wenum-compare-switch to switch-related parts of -Wenum-compare
Patch by: Reka Nikolett Kovacs
Differential Revision: https://reviews.llvm.org/D36526
llvm-svn: 310521
Craig Topper [Wed, 9 Aug 2017 20:55:33 +0000 (20:55 +0000)]
[Docs] Remove a stray period from a code example in the Programmer's Manual.
llvm-svn: 310520
Gheorghe-Teodor Bercea [Wed, 9 Aug 2017 20:52:58 +0000 (20:52 +0000)]
[OpenMP] Fix failing test for D29660.
Non-functional change.
llvm-svn: 310519
Eli Friedman [Wed, 9 Aug 2017 20:43:31 +0000 (20:43 +0000)]
[llvm-cov] Rearrange entries in report index.
Files which don't contain any functions are likely useless; don't
include them in the main table. Put the links at the bottom of the
page, in case someone wants to figure out coverage for code inside
a macro.
Not sure if this is the best solution, but it seems like an
improvement.
Differential Revision: https://reviews.llvm.org/D36298
llvm-svn: 310518
Lang Hames [Wed, 9 Aug 2017 20:19:27 +0000 (20:19 +0000)]
[RuntimeDyld][ORC] Add support for Thumb mode to RuntimeDyldMachOARM.
This patch adds support for thumb relocations to RuntimeDyldMachOARM, and adds
a target-specific flags field to JITSymbolFlags (so that on ARM we can record
whether each symbol is Thumb-mode code).
RuntimeDyldImpl::emitSection is modified to ensure that stubs memory is
correctly aligned based on the size returned by getStubAlignment().
llvm-svn: 310517
Hans Wennborg [Wed, 9 Aug 2017 20:12:53 +0000 (20:12 +0000)]
Make -std=c++17 an alias of -std=c++1z
As suggested on PR33912.
Trying to keep this small to make it easy to merge to the 5.0 branch. We
can do a follow-up with more thorough renaming (diagnostic text,
options, ids, etc.) later.
(For C++14 this was done in r215982, and I think a smaller patch for the
3.5 branch:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20140818/113013.html)
Differential Revision: https://reviews.llvm.org/D36532
llvm-svn: 310516
Matt Arsenault [Wed, 9 Aug 2017 20:09:35 +0000 (20:09 +0000)]
AMDGPU: Fix assert on n inline asm constraint
llvm-svn: 310515
Krzysztof Parzyszek [Wed, 9 Aug 2017 19:58:00 +0000 (19:58 +0000)]
[Hexagon] Tie implicit uses to defs in predicated instructions
llvm-svn: 310514
Gheorghe-Teodor Bercea [Wed, 9 Aug 2017 19:52:28 +0000 (19:52 +0000)]
[OpenMP] Enable executable lookup into driver directory.
Summary: Invoking the compiler inside a script causes the clang-offload-bundler executable to not be found. This patch enables the lookup for executables in the driver directory where the clang-offload-bundler resides.
Reviewers: hfinkel, carlo.bertolli, arpith-jacob, ABataev, caomhin
Reviewed By: hfinkel
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D36537
llvm-svn: 310513
Tim Hammerquist [Wed, 9 Aug 2017 19:44:18 +0000 (19:44 +0000)]
Add remainder of unittests to Xcode project
Resolves a few build settings required to run DWARF tests as well.
rdar://problem/
33664378
llvm-svn: 310512
Alexey Bataev [Wed, 9 Aug 2017 19:38:53 +0000 (19:38 +0000)]
[OPENMP] Emit non-debug version of outlined functions with original
name.
If the host code is compiled with the debug info, while the target
without, there is a problem that the compiler is unable to find the
debug wrapper. Patch fixes this problem by emitting special name for the
debug version of the code.
llvm-svn: 310511
Sanjay Patel [Wed, 9 Aug 2017 18:56:26 +0000 (18:56 +0000)]
[SimplifyCFG] remove checks for crasher test from r310481
Not sure why the earlier version would fail, but trying to get the bots
(and my local machine) to pass again.
llvm-svn: 310510
Sanjay Patel [Wed, 9 Aug 2017 18:37:41 +0000 (18:37 +0000)]
[InstCombine] narrow rotate left/right patterns to eliminate zext/trunc (PR34046)
I couldn't find any smaller folds to help the cases in:
https://bugs.llvm.org/show_bug.cgi?id=34046
after:
rL310141
The truncated rotate-by-variable patterns elude all of the existing transforms because
of multiple uses and knowledge about demanded bits and knownbits that doesn't exist
without the whole pattern. So we need an unfortunately large pattern match. But by
simplifying this pattern in IR, the backend is already able to generate
rolb/rolw/rorb/rorw for x86 using its existing rotate matching logic (although
there is a likely extraneous 'and' of the rotate amount).
Note that rotate-by-constant doesn't have this problem - smaller folds should already
produce the narrow IR ops.
Differential Revision: https://reviews.llvm.org/D36395
llvm-svn: 310509
David Blaikie [Wed, 9 Aug 2017 18:34:22 +0000 (18:34 +0000)]
PointerLikeTypeTraits: class->struct to match LLVM change
llvm-svn: 310508
David Blaikie [Wed, 9 Aug 2017 18:34:21 +0000 (18:34 +0000)]
PointerLikeTypeTraits: class->struct & remove the base definition
This simplifies implementations and removing the base definition paves
the way for detecting whether a type is 'pointer like'.
llvm-svn: 310507
David Blaikie [Wed, 9 Aug 2017 18:34:18 +0000 (18:34 +0000)]
Reduce variable scope by moving declaration into if clause
llvm-svn: 310506
Gheorghe-Teodor Bercea [Wed, 9 Aug 2017 18:25:52 +0000 (18:25 +0000)]
[OpenMP] Make the PTX version tests general enough to work on all toolchains.
Add explicit test for Darwin and PowerPC. Clean-up tests.
Non-functional change.
Original diff: D29660
llvm-svn: 310505
Siddharth Bhat [Wed, 9 Aug 2017 18:19:46 +0000 (18:19 +0000)]
[ManagedMemoryRewrite] [Polly] Erase original malloc and free. [NFC]
We do not need to keep `malloc` and `free` around since they are
replaced by `polly_{malloc,free}Managed.`
llvm-svn: 310504
Matt Morehouse [Wed, 9 Aug 2017 17:59:43 +0000 (17:59 +0000)]
[asan] Fix instruction emission ordering with dynamic shadow.
Summary:
Instrumentation to copy byval arguments is now correctly inserted
after the dynamic shadow base is loaded.
Reviewers: vitalybuka, eugenis
Reviewed By: vitalybuka
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D36533
llvm-svn: 310503
Mandeep Singh Grang [Wed, 9 Aug 2017 17:58:39 +0000 (17:58 +0000)]
[COFF, ARM64] Add MS builtins __dmb, __dsb, __isb
Reviewers: mstorsjo, rnk, ruiu, compnerd, efriedma
Reviewed By: efriedma
Subscribers: efriedma, aemerson, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D36110
llvm-svn: 310502
Tim Hammerquist [Wed, 9 Aug 2017 17:27:02 +0000 (17:27 +0000)]
Fix VASprintfTest.cpp for Darwin, add checks
Summary:
The EncodingError test ensures that trying to encode a multibyte wchar
with a given codepage fails. If setlocale() fails, the encoding is
performed using the current locale, which may or may not fail.
This patch asserts that both setlocale() operations are successful, as
well as falling back to a widely available unibyte encoding for
non-Windows systems.
<rdar://problem/
33782806>
Reviewers: zturner, labath, lhames
Reviewed By: zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D36496
llvm-svn: 310499
Guy Blank [Wed, 9 Aug 2017 17:21:01 +0000 (17:21 +0000)]
[X86][AVX512] Choose correct registers in vpbroadcastb/w
Fixes the vpbroadcastb/w instructions which use GPRs as source operands, to use the correct registers.
The full GPR should be used, and not the subregister, as it happens before the patch.
Fixes pr33795
Differential Revision:
https://reviews.llvm.org/D36479
llvm-svn: 310498
Dmitry Preobrazhensky [Wed, 9 Aug 2017 17:10:47 +0000 (17:10 +0000)]
[AMDGPU][MC][GFX9] Added 16-bit renamed and "_legacy" VALU opcodes
See Bug 33629: https://bugs.llvm.org//show_bug.cgi?id=33629
Reviewers: vpykhtin, SamWot, arsenm
Differential Revision: https://reviews.llvm.org/D36322
llvm-svn: 310497
Haojian Wu [Wed, 9 Aug 2017 17:03:42 +0000 (17:03 +0000)]
[clang-tidy] Fix another crash in make-unique check.
Summary:
The crash happens when calling `reset` method without any preceding
operation like "->" or ".", this could happen in a subclass of the
"std::unique_ptr".
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D36452
llvm-svn: 310496
Nuno Lopes [Wed, 9 Aug 2017 17:02:18 +0000 (17:02 +0000)]
CFLAA: return MustAlias when pointers p, q are equal, i.e.,
must-alias(p, sz_p, p, sz_q) irrespective of access sizes sz_p, sz_q
As discussed a couple of weeks ago on the ML.
This makes the behavior consistent with that of BasicAA.
AA clients already check the obj size themselves and may not require the
obj size to match exactly the access size (e.g., in case of store forwarding)
llvm-svn: 310495
Michael Kruse [Wed, 9 Aug 2017 16:45:37 +0000 (16:45 +0000)]
Remove dependency of Scop::getStmtFor(Inst) on getStmtFor(BB). NFC.
We are working towards removing uses of Scop::getStmtFor(BB). In this
patch, we remove dependency of Scop::getStmtFor(Inst) on getStmtFor(BB).
To do so, we introduce a map of instructions to their corresponding scop
statements and use it to get the instructions' statement.
Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in>
Differential Revision: https://reviews.llvm.org/D35663
llvm-svn: 310494
Davide Italiano [Wed, 9 Aug 2017 16:06:54 +0000 (16:06 +0000)]
[ValueTracking] Turn a test into an assertion.
As discussed with Chad, this should never happen, but this
assertion is basically free, so, keep it around just in case.
llvm-svn: 310493
Davide Italiano [Wed, 9 Aug 2017 16:06:04 +0000 (16:06 +0000)]
[ValueTracking] Update tests to unbreak the bots.
llvm-svn: 310492
Alexander Kornienko [Wed, 9 Aug 2017 16:00:31 +0000 (16:00 +0000)]
[clang-tidy] Ignore newlines in checks list
This is a follow up to https://reviews.llvm.org/D30567 where I overlooked that
LLVM YAML parser doesn't support multiline literal folding.
llvm-svn: 310491
Sanjay Patel [Wed, 9 Aug 2017 15:57:02 +0000 (15:57 +0000)]
[x86] add more tests for select-of-constants; NFC
This is to help recommit a fixed version of r310208. As shown in PR34097,
we could miscompile if subtraction of the constants overflowed.
llvm-svn: 310490
Gheorghe-Teodor Bercea [Wed, 9 Aug 2017 15:56:54 +0000 (15:56 +0000)]
[OpenMP] Add flag for overwriting default PTX version for OpenMP targets
Summary:
This flag "--fopenmp-ptx=" enables the overwriting of the default PTX version used for GPU offloaded OpenMP target regions: "+ptx42".
Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar
Reviewed By: ABataev
Subscribers: rengolin, cfe-commits
Differential Revision: https://reviews.llvm.org/D29660
llvm-svn: 310489
Vadim Macagon [Wed, 9 Aug 2017 15:49:15 +0000 (15:49 +0000)]
Fix PlatformPythonTestCase.test_platform_list for the build bots
llvm-svn: 310488
Marshall Clow [Wed, 9 Aug 2017 15:42:50 +0000 (15:42 +0000)]
Change the way the literal operators are defined - now w/o a seperating space. This should be a NFC, but it will change how the compiler parses it.
llvm-svn: 310487
Florian Hahn [Wed, 9 Aug 2017 15:39:10 +0000 (15:39 +0000)]
[ARM] Emit error when ARM exec mode is not available.
Summary:
A similar error message has been removed from the ARMTargetMachineBase
constructor in r306939. With this patch, we generate an error message
for the example below, compiled with -mcpu=cortex-m0, which does not
have ARM execution mode.
__attribute__((target("arm"))) int foo(int a, int b)
{
return a + b % a;
}
__attribute__((target("thumb"))) int bar(int a, int b)
{
return a + b % a;
}
By adding this error message to ARMBaseTargetMachine::getSubtargetImpl,
we can deal with functions that set -thumb-mode in target-features.
At the moment it seems like Clang does not have access to target-feature
specific information, so adding the error message to the frontend will
be harder.
Reviewers: echristo, richard.barton.arm, t.p.northover, rengolin, efriedma
Reviewed By: echristo, efriedma
Subscribers: efriedma, aemerson, javed.absar, kristof.beyls
Differential Revision: https://reviews.llvm.org/D35627
llvm-svn: 310486
Coby Tayree [Wed, 9 Aug 2017 15:34:55 +0000 (15:34 +0000)]
[X86][Asm]Allow far jmp/call to be picked when using explicit FWORD size specifier
Currently, far jmp/call which utilizes a 48bit memory operand would have been invoked via the 'lcall/ljmp' mnemonic (intel style).
This patch align those variants to formal intel spec
Differential Revision: https://reviews.llvm.org/D35846
llvm-svn: 310485
Gheorghe-Teodor Bercea [Wed, 9 Aug 2017 15:27:39 +0000 (15:27 +0000)]
[OpenMP] Add flag for disabling the default generation of relocatable OpenMP target code for NVIDIA GPUs.
Summary: Previously we have added the "-c" flag which gets passed to PTXAS by default to generate relocatable OpenMP target code by default. This set of flags exposes control over this behaviour.
Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar
Reviewed By: ABataev
Subscribers: Hahnfeld, rengolin, cfe-commits
Differential Revision: https://reviews.llvm.org/D29659
llvm-svn: 310484
Erich Keane [Wed, 9 Aug 2017 15:27:36 +0000 (15:27 +0000)]
Fix broken getAttributeSpellingListIndex for pragma attributes
We noticed when implementing a new pragma that the TableGen-generated function
getAttributeSpellingListIndex() did not work for pragma attributes. It relies
on the values in the enum AttributeList::Syntax and a new value
AS_ContextSensitiveKeyword was added changing the value for AS_Pragma.
Apparently no tests failed since no pragmas currently make use of the
generated function.
To fix this we can move AS_Pragma back to the value that TableGen code expects.
Also to prevent changes in the enum from breaking that routine again I added
calls to getAttributeSpellingListIndex() in the unroll pragma code. That will
cause some lit test failures if the order is changed. I added a comment to
remind of this issue in the future.
This assumes we don’t need/want full TableGen support for
AS_ContextSensitiveKeyword. It currently only appears in getAttrKind and no
other TableGen-generated routines.
Patch by: mikerice
Differential Revision: https://reviews.llvm.org/D36473
llvm-svn: 310483
Martin Probst [Wed, 9 Aug 2017 15:19:16 +0000 (15:19 +0000)]
clang-format: [JS] detect ASI after closing parens.
Summary: A closing parenthesis followed by a declaration or statement should always terminate the current statement.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D36491
llvm-svn: 310482
Davide Italiano [Wed, 9 Aug 2017 15:13:50 +0000 (15:13 +0000)]
[ValueTracking] Honour recursion limit.
The recently improved support for `icmp` in ValueTracking
(r307304) exposes the fact that `isImplied` condition doesn't
really bail out if we hit the recursion limit (and calls
`computeKnownBits` which increases the depth and asserts).
Differential Revision: https://reviews.llvm.org/D36512
llvm-svn: 310481
Sjoerd Meijer [Wed, 9 Aug 2017 14:59:54 +0000 (14:59 +0000)]
[AArch64] Assembler support for the ARMv8.2a dot product instructions
Dot product is an optional ARMv8.2a extension, see also the public architecture
specification here:
https://developer.arm.com/products/architecture/a-profile/exploration-tools.
This patch adds AArch64 assembler support for these dot product instructions.
Differential Revision: https://reviews.llvm.org/D36515
llvm-svn: 310480
Gheorghe-Teodor Bercea [Wed, 9 Aug 2017 14:59:35 +0000 (14:59 +0000)]
[OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by default
Original Diff: D29642
This patch was previously reverted due to an error with patch D29654
that this depends on.
llvm-svn: 310479
Tim Northover [Wed, 9 Aug 2017 14:56:48 +0000 (14:56 +0000)]
Reapply Sema: allow imaginary constants via GNU extension if UDL overloads not present.
C++14 added user-defined literal support for complex numbers so that you
can write something like "complex<double> val = 2i". However, there is
an existing GNU extension supporting this syntax and interpreting the
result as a _Complex type.
This changes parsing so that such literals are interpreted in terms of
C++14's operators if an overload is present but otherwise falls back to
the original GNU extension.
(We now have more robust diagnostics for implicit conversions so the
libc++ test that caused the original revert still passes).
llvm-svn: 310478
Joey Gouly [Wed, 9 Aug 2017 14:52:47 +0000 (14:52 +0000)]
[OpenCL] Minor refactoring to reduce copy/pasted code
Set the type of TheCall inside SemaBuiltinReserveRWPipe to reduce
duplicated code.
llvm-svn: 310477
Florian Hahn [Wed, 9 Aug 2017 13:53:28 +0000 (13:53 +0000)]
[ARM] Remove FeatureNoARM implies ModeThumb.
Summary:
By removing FeatureNoARM implies ModeThumb, we can detect cases where a
function's target-features contain -thumb-mode (enables ARM codegen for the
function), but the architecture does not support ARM mode. Previously, the
implication caused the FeatureNoARM bit to be cleared for functions with
-thumb-mode, making the assertion in ARMSubtarget::ARMSubtarget [1]
pointless for such functions.
This assertion is the only guard against generating ARM code for
architectures without ARM codegen support. Is there a place where we
could easily generate error messages for the user? At the moment, we
would generate ARM code for Thumb-only architectures. X86 has the same
behavior as ARM, as in it only has an assertion and no error message,
but I think for ARM an error message would be helpful. What do you
think?
For the example below, `llc -mtriple=armv7m-eabi test.ll -o -` will
generate ARM assembler (or fail with an assertion error with this patch).
Note that if we run the resulting assembler through llvm-mc, we get
an appropriate error message, but not when codegen is handled
through clang.
```
define void @bar() #0 {
entry:
ret void
}
attributes #0 = { "target-features"="-thumb-mode" }
```
[1] https://github.com/llvm-mirror/llvm/blob/
c1f7b54cef62e9c8aa745d40bea146a167bf844e/lib/Target/ARM/ARMSubtarget.cpp#L147
Reviewers: t.p.northover, rengolin, peter.smith, aadg, silviu.baranga, richard.barton.arm, echristo
Reviewed By: rengolin, echristo
Subscribers: efriedma, aemerson, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D35569
llvm-svn: 310476
Benoit Belley [Wed, 9 Aug 2017 13:47:01 +0000 (13:47 +0000)]
[Support] PR33388 - Fix formatv_object move constructor
formatv_object currently uses the implicitly defined move constructor,
but it is buggy. In typical use-cases, the problem doesn't show-up
because all calls to the move constructor are elided. Thus, the buggy
constructors are never invoked.
The issue especially shows-up when code is compiled using the
-fno-elide-constructors compiler flag. For instance, this is useful when
attempting to collect accurate code coverage statistics.
The exact issue is the following:
The Parameters data member is correctly moved, thus making the
parameters occupy a new memory location in the target
object. Unfortunately, the default copying of the Adapters blindly
copies the vector of pointers, leaving each of these pointers
referencing the parameters in the original object instead of the copied
one. These pointers quickly become dangling when the original object is
deleted. This quickly leads to crashes.
The solution is to update the Adapters pointers when performing a move.
The copy constructor isn't useful for format objects and can thus be
deleted.
This resolves PR33388.
Differential Revision: https://reviews.llvm.org/D34463
llvm-svn: 310475
Nirav Dave [Wed, 9 Aug 2017 13:37:07 +0000 (13:37 +0000)]
[DAG] Explicitly cleanup merged load values during store merge. NFCI.
llvm-svn: 310474
Siddharth Bhat [Wed, 9 Aug 2017 13:34:54 +0000 (13:34 +0000)]
[ManagedMemoryRewrite] Remove test case that was submitted by mistake. [NFC]
llvm-svn: 310473
Coby Tayree [Wed, 9 Aug 2017 13:31:41 +0000 (13:31 +0000)]
[X86][Ms-InlineAsm] Extend MS Dot operator to accept "this" + struct/class pointers aliases
MS InlineAsm Dot operator accepts "Bases" such as "this" (cpp) and class/struct pointer typedef.
This patch enhance its implementation with this behavior.
Differential Revision: https://reviews.llvm.org/D36450
llvm-svn: 310472
Siddharth Bhat [Wed, 9 Aug 2017 12:59:23 +0000 (12:59 +0000)]
[ManagedMemoryRewrite] Introduce a new pass to rewrite modules to use managed memory.
This pass is useful to automatically convert a codebase that uses malloc/free
to use their managed memory counterparts.
Currently, rewrite malloc and free to the `polly_{malloc,free}Managed` variants.
A future patch will teach ManagedMemoryRewrite to rewrite global arrays
as pointers to globally allocated managed memory.
Differential Revision: https://reviews.llvm.org/D36513
llvm-svn: 310471
Ilya Biryukov [Wed, 9 Aug 2017 12:55:13 +0000 (12:55 +0000)]
[clangd] Fixed a bug in make_tagged.
It accidentally std::move'd from Value parameter if it deduced to an
l-value ref.
llvm-svn: 310470
Haojian Wu [Wed, 9 Aug 2017 12:49:20 +0000 (12:49 +0000)]
Fix -Wpessimizing-move warning.
llvm-svn: 310469
Gabor Horvath [Wed, 9 Aug 2017 12:34:58 +0000 (12:34 +0000)]
[Sema] -Wenum-compare no longer warn on anonymous enums in switch statements
Patch by: Reka Nikolett Kovacs
llvm-svn: 310468
Coby Tayree [Wed, 9 Aug 2017 12:32:05 +0000 (12:32 +0000)]
[AsmParser][AVX512]Enhance OpMask/Zero/Merge syntax check rubostness
Adopt a more strict approach regarding what marks should/can appear after a destination register, when operating upon an AVX512 platform.
Differential Revision: https://reviews.llvm.org/D35785
llvm-svn: 310467
Michael Kruse [Wed, 9 Aug 2017 12:27:51 +0000 (12:27 +0000)]
[CodeGen] Use isLatestArrayKind().
Codegen with -polly-parallel queried the unmapped MemoryAccess, but only
the MemoryKind after mapping is relevant for codegen.
This should fix various fails of the
perf-x86_64-penryn-O3-polly-parallel-fast buildbot.
llvm-svn: 310466
Michael Kruse [Wed, 9 Aug 2017 12:27:35 +0000 (12:27 +0000)]
[ForwardOpTree] Set DEBUG_TYPE to "polly-optree".
The previous value of "polly-delicm" was forgotten to to be changed when
ForwardOpTree was split from DeLICM.
Thanks to Tobias for noticing!
llvm-svn: 310465
Diana Picus [Wed, 9 Aug 2017 12:22:25 +0000 (12:22 +0000)]
Revert "PR19668, PR23034: Fix handling of move constructors and deleted copy constructors when deciding whether classes should be passed indirectly."
This reverts commit r310401 because it seems to have broken some ARM
bot(s).
llvm-svn: 310464
Jonas Paulsson [Wed, 9 Aug 2017 11:28:01 +0000 (11:28 +0000)]
[LSR / TTI / SystemZ] Eliminate TargetTransformInfo::isFoldableMemAccess()
isLegalAddressingMode() has recently gained the extra optional Instruction*
parameter, and therefore it can now do the job that previously only
isFoldableMemAccess() could do.
The SystemZ implementation of isLegalAddressingMode() has gained the
functionality of checking for offsets, which used to be done with
isFoldableMemAccess().
The isFoldableMemAccess() hook has been removed everywhere.
Review: Quentin Colombet, Ulrich Weigand
https://reviews.llvm.org/D35933
llvm-svn: 310463
Jonas Paulsson [Wed, 9 Aug 2017 11:27:46 +0000 (11:27 +0000)]
[LoopStrengthReduce] Don't neglect the Fixup.Offset in isAMCompletelyFolded().
In the recursive call to isAMCompletelyFolded(), the passed offset should be
the sum of F.BaseOffset and Fixup.Offset.
Review: Quentin Colombet.
llvm-svn: 310462
Michael Kruse [Wed, 9 Aug 2017 11:21:40 +0000 (11:21 +0000)]
[ISLTools/ZoneAlgo] Make distributeDomain and filterKnownValInst isl_error_quota proof.
distributeDomain() and filterKnownValInst() are used in a scop
of ForwardOpTree that limits the number of isl operations.
Therefore some isl functions may return null after any operation.
Remove assertion that assume non-null results and handle
isl_*_foreach returning isl::stat::error.
I hope this fixes the crash of the asop buildbot at ihevc_recon.c.
llvm-svn: 310461
Simon Dardis [Wed, 9 Aug 2017 10:47:52 +0000 (10:47 +0000)]
[mips] PR34083 - Wimplicit-fallthrough warning in MipsAsmParser.cpp
Assert that a binary expression is actually a binary expression,
rather than potientially incorrectly attempting to handle it as a
unary expression.
This resolves PR34083.
Thanks to Simonn Pilgrim for reporting the issue!
llvm-svn: 310460
Gabor Horvath [Wed, 9 Aug 2017 10:38:53 +0000 (10:38 +0000)]
Suppress a warning. NFC.
llvm-svn: 310459
Krasimir Georgiev [Wed, 9 Aug 2017 09:42:32 +0000 (09:42 +0000)]
[clang-format] Put '/**' and '*/' on own lines in jsdocs ending in comment pragmas
Summary:
This handles a case where the trailing '*/' of a multiline jsdoc eding in a
comment pragma wouldn't be put on a new line.
Reviewers: mprobst
Reviewed By: mprobst
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D36359
llvm-svn: 310458
Oliver Stannard [Wed, 9 Aug 2017 09:40:51 +0000 (09:40 +0000)]
[AsmParser] Hash is not a comment on some targets
The '#' token is not a comment for all targets (on ARM and AArch64 it marks an
immediate operand), so we shouldn't treat it as such.
Comments are already converted to AsmToken::EndOfStatement by
AsmLexer::LexLineComment, so this check was unnecessary.
Differential Revision: https://reviews.llvm.org/D36405
llvm-svn: 310457
Chandler Carruth [Wed, 9 Aug 2017 09:37:39 +0000 (09:37 +0000)]
[LCG] Completely remove the map-based association of post-order numbers
to Nodes when removing ref edges from a RefSCC.
This map based association turns out to be pretty expensive for large
RefSCCs and pointless as we already have embedded data members inside
nodes that we use to track the DFS state. We can reuse one of those and
the map becomes unnecessary.
This also fuses the update of those numbers into the scan across the
pending stack of nodes so that we don't walk the nodes twice during the
DFS.
With this I expect the new PM to be faster than the old PM for the test
case I have been optimizing. That said, it also seems simpler and more
direct in many ways. The side storage was always pretty awkward.
The last remaining hot-spot in the profile of the LCG once this is done
will be the edge iterator walk in the DFS. I'll take a look at improving
that next.
llvm-svn: 310456
Michael Kruse [Wed, 9 Aug 2017 09:29:15 +0000 (09:29 +0000)]
[ZoneAlgo] Add motivation for exception. NFC.
Suggested-by: Hongbin Zheng <etherzhhb@gmail.com>
llvm-svn: 310455
Michael Kruse [Wed, 9 Aug 2017 09:29:09 +0000 (09:29 +0000)]
[ZoneAlgo] Consolditate condition. NFC.
No need to create an OptimizationRemarkMissed object if we are not going
to use it anyway.
llvm-svn: 310454
Davide Italiano [Wed, 9 Aug 2017 09:23:29 +0000 (09:23 +0000)]
[GlobalOpt] Switch an explicit loop to llvm::all_of(). NFCI.
llvm-svn: 310453
Vadim Macagon [Wed, 9 Aug 2017 09:20:40 +0000 (09:20 +0000)]
Expose active and available platform lists via SBDebugger API
Summary:
The available platform list was previously only accessible via the
`platform list` command, this patch makes it possible to access that
list via the SBDebugger API. The active platform list has likewise
been exposed via the SBDebugger API.
Differential Revision: https://reviews.llvm.org/D35760
llvm-svn: 310452
Chandler Carruth [Wed, 9 Aug 2017 09:14:34 +0000 (09:14 +0000)]
[LCG] Special case when removing a ref edge from a RefSCC leaves
that RefSCC still connected.
This is common and can be handled much more efficiently. As soon as we
know we've covered every node in the RefSCC with the DFS, we can simply
reset our state and return. This avoids numerous data structure updates
and other complexity.
On top of other changes, this appears to get new PM back to parity with
the old PM for a large protocol buffer message source code. The dense
map updates are very hot in this function.
llvm-svn: 310451