platform/upstream/llvm.git
4 years agoDWARFDebugLoclists: add location list "interpretation" logic
Pavel Labath [Thu, 7 Nov 2019 09:33:18 +0000 (10:33 +0100)]
DWARFDebugLoclists: add location list "interpretation" logic

Summary:
This patch extracts the logic for computing the "absolute" locations,
which was partially present in the debug_loclists dumper, completes it,
and moves it into a separate function. This makes it possible to later
reuse the same logic for uses other than dumping.

The dumper is changed to reuse the location list interpreter, and its
format is changed somewhat. In "verbose" mode it prints the "raw" value
of a location list, the interpreted location (if available) and the
expression itself. In non-verbose mode it prints only one of the
location forms: it prefers the interpreted form, but falls back to the
"raw" format if interpretation is not possible (for instance, because we
were not given a base address, or the resolution of indirect addresses
failed).

This patch also undos some of the changes made in D69672, namely the
part about making all functions static. The main reason for this is that
I learned that the original approach (dumping only fully resolved
locations) meant that it was impossible to rewrite one of the existing
tests. To make that possible (and make the "inline location" dump work
in more cases), I now reuse the same dumping mechanism as is used for
section-based dumping. As this required having more objects know about
the various location lists classes, it seemed like a good idea to create
an interface abstracting the difference between them.

Therefore, I now create a DWARFLocationTable class, which will serve as
a base class for the location list classes. DWARFDebugLoclists is made
to inherit from that. DWARFDebugLoc will follow.

Another positive effect of this change is that section-based dumping
code will not need to use templates (as originally) envisioned, and that
the argument lists of the dumping functions become shorter.

Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Add more add/sub carry tests
David Zarzycki [Mon, 11 Nov 2019 13:07:51 +0000 (15:07 +0200)]
[X86] Add more add/sub carry tests

Preparation for: https://reviews.llvm.org/D70079

https://reviews.llvm.org/D70077

4 years ago[clang-format] [PR36294] AlwaysBreakAfterReturnType works incorrectly for some operat...
mydeveloperday [Tue, 12 Nov 2019 09:14:51 +0000 (09:14 +0000)]
[clang-format] [PR36294] AlwaysBreakAfterReturnType works incorrectly for some operator functions

Summary:
https://bugs.llvm.org/show_bug.cgi?id=36294

Addressing bug related to returning after return type not being honoured for some operator types.

```
$ bin/clang-format --style="{BasedOnStyle: llvm, AlwaysBreakAfterReturnType: TopLevelDefinitions}" /tmp/foo.cpp
class Foo {
public:
  bool operator!() const;
  bool operator<(Foo const &) const;
  bool operator*() const;
  bool operator->() const;
  bool operator+() const;
  bool operator-() const;
  bool f() const;
};

bool Foo::operator!() const { return true; }
bool
Foo::operator<(Foo const &) const {
  return true;
}
bool Foo::operator*() const { return true; }
bool Foo::operator->() const { return true; }
bool
Foo::operator+() const {
  return true;
}
bool
Foo::operator-() const {
  return true;
}
bool
Foo::f() const {
  return true;
}
```

Reviewers: mitchell-stellar, klimek, owenpan, sammccall, rianquinn

Reviewed By: sammccall

Subscribers: merge_guards_bot, cfe-commits

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

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

4 years ago[lldb] Add missing include to ObjCLanguage.cpp to fix build
Raphael Isemann [Tue, 12 Nov 2019 09:21:49 +0000 (10:21 +0100)]
[lldb] Add missing include to ObjCLanguage.cpp to fix build

4 years ago[lldb][NFC] Move LLVM RTTI implementation from enum to static ID variable
Raphael Isemann [Tue, 12 Nov 2019 09:04:32 +0000 (10:04 +0100)]
[lldb][NFC] Move LLVM RTTI implementation from enum to static ID variable

Summary:
swift-lldb currently has to patch the ExpressionKind enum to add support for Swift expressions. If we implement LLVM's RTTI
with a static ID variable instead of a centralised enum we can drop that patch.

Reviewers: labath, davide

Reviewed By: labath

Subscribers: JDevlieghere, lldb-commits

Tags: #upstreaming_lldb_s_downstream_patches, #lldb

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

4 years ago[lldb][NFC] Remove unused CompilerType::IsPossibleCPlusPlusDynamicType
Raphael Isemann [Tue, 12 Nov 2019 09:02:59 +0000 (10:02 +0100)]
[lldb][NFC] Remove unused CompilerType::IsPossibleCPlusPlusDynamicType

Reviewers: davide, xiaobai

Reviewed By: davide, xiaobai

Subscribers: davide, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[lldb] Check if we actually have a Clang type in ObjCLanguage::GetPossibleFormattersM...
Raphael Isemann [Mon, 11 Nov 2019 13:25:54 +0000 (14:25 +0100)]
[lldb] Check if we actually have a Clang type in ObjCLanguage::GetPossibleFormattersMatches

We call IsPossibleDynamicType but we also need to check if this is a Clang type,
otherwise other languages with dynamic types (like Swift) might end up being interpreted
as potential Obj-C dynamic types.

4 years ago[NFC][InstCombine] Add tests that show a number of canonicalization opportunities
Daniil Suchkov [Mon, 30 Sep 2019 05:16:37 +0000 (12:16 +0700)]
[NFC][InstCombine] Add tests that show a number of canonicalization opportunities

Reviewers: spatel, RKSimon, lebedev.ri, apilipenko

Reviewed-By: apilipenko
Tags: #llvm

Subscribers: llvm-commits

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

4 years agoMCP: Fixed bug with dest overlapping copy source
Tim Renouf [Mon, 11 Nov 2019 11:06:09 +0000 (11:06 +0000)]
MCP: Fixed bug with dest overlapping copy source

In MachineCopyPropagation, when propagating the source of a copy into
the operand of a later instruction, bail if a destination overlaps
(partly defines) the copy source. If the instruction where the
substitution is happening is also a copy, allowing the propagation
confuses the tracking mechanism.

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

Change-Id: Ic570754f878f2d91a4a50a9bdcf96fbaa240726d

4 years ago[X86] Add fptosi test to fp-intrinsics.ll
Craig Topper [Tue, 12 Nov 2019 07:30:55 +0000 (23:30 -0800)]
[X86] Add fptosi test to fp-intrinsics.ll

4 years ago[X86] Update stale comment. NFC
Craig Topper [Tue, 12 Nov 2019 04:35:58 +0000 (20:35 -0800)]
[X86] Update stale comment. NFC

4 years ago[VFABI] Remove unused variables in testcase, fix buildbot
Mikael Holmen [Tue, 12 Nov 2019 07:28:12 +0000 (08:28 +0100)]
[VFABI] Remove unused variables in testcase, fix buildbot

E.g. the buildbot at

 http://lab.llvm.org:8011/builders/ppc64le-lld-multistage-test/builds/7259/steps/build-stage2-unified-tree/logs/stdio

failed with

/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/Transforms/Utils/VFABIUtils.cpp:50:22: error: unused variable 'FnAttrs' [-Werror,-Wunused-variable]
  const AttributeSet FnAttrs = Attrs.getFnAttributes();
                     ^
1 error generated.

4 years ago[llvm-readelf/llvm-readobj][test] - Convert elf-linker-options.ll to use YAML.
Georgii Rymar [Fri, 8 Nov 2019 12:21:24 +0000 (15:21 +0300)]
[llvm-readelf/llvm-readobj][test] - Convert elf-linker-options.ll to use YAML.

This converts elf-linker-options.ll to use yaml2obj instead of llc,
improves and cleanups it a bit.

This opens a road to add an additional tests for checking the broken cases.

Differential revision: https://reviews.llvm.org/D70004

4 years ago[yaml2obj/obj2yaml] - Add support for SHT_LLVM_LINKER_OPTIONS sections.
Georgii Rymar [Wed, 6 Nov 2019 15:14:12 +0000 (18:14 +0300)]
[yaml2obj/obj2yaml] - Add support for SHT_LLVM_LINKER_OPTIONS sections.

SHT_LLVM_LINKER_OPTIONS section contains pairs of null-terminated strings.
This patch adds support for them.

Differential revision: https://reviews.llvm.org/D69895

4 years ago[Attributor] Use must-be-executed-context in align deduction
Hideto Ueno [Tue, 12 Nov 2019 06:36:49 +0000 (06:36 +0000)]
[Attributor] Use must-be-executed-context in align deduction

Summary:
This patch introduces align attribute deduction for callsite argument, function argument, function returned and floating value based on must-be-executed-context.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

4 years ago[Support] Optimize SHA1 implementation
Nick Terrell [Tue, 12 Nov 2019 06:07:12 +0000 (22:07 -0800)]
[Support] Optimize SHA1 implementation

* Add inline to the helper functions because gcc-9 won't inline all of
  them without the hint. I've avoided `__attribute__((always_inline))`
  because gcc and clang will inline without it, and improves
  compatibility.
* Replace the byte-by-byte copy in update() with endian::readbe32()
  since perf reports that 1/2 of the time is spent copying into the
  buffer before this patch.

When lld uses --build-id=sha1 it spends 30-45% of CPU in SHA1 depending on the binary (not wall-time since it is parallel). This patch speeds up SHA1 by a factor of 2 on clang-8 and 3 on gcc-6. This leads to a >10% improvement in overall linking time.

lld-speed-test benchmarks run on an Intel i9-9900k with Turbo disabled on CPU 0 compiled with clang-9. Stats recorded with `perf stat -r 5`. All inputs are using `--build-id=sha1`.

| Input | Before (seconds) | After (seconds) |
| --- | --- | --- |
| chrome | 2.14 | 1.82 (-15%) |
| chrome-icf | 2.56 | 2.29 (-10%) |
| clang | 0.65 | 0.53 (-18%) |
| clang-fsds | 0.69 | 0.58 (-16%) |
| clang-gdb-index | 21.71 | 19.3 (-11%) |
| gold | 0.42 | 0.34 (-19%) |
| gold-fsds | 0.431 | 0.355 (-17%) |
| linux-kernel | 0.625 | 0.575 (-8%) |
| llvm-as | 0.045 | 0.039 (-14%) |
| llvm-as-fsds | 0.035 | 0.039 (-11%) |
| mozilla | 11.3 | 9.8  (-13%) |
| mozilla-gc | 11.84 | 10.36 (-12%) |
| mozilla-O0 | 8.2 | 5.84 (-28%) |
| scylla | 5.59 | 4.52 (-19%) |

Reviewed By: ruiu, MaskRay

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

4 years agoAMDGPU/SI: make ~SIScheduleBlockCreator trivial
Fangrui Song [Tue, 12 Nov 2019 05:51:59 +0000 (21:51 -0800)]
AMDGPU/SI: make ~SIScheduleBlockCreator trivial

4 years ago[PDB] Make pdb::DbiModuleDescriptor destructor trivial
Fangrui Song [Tue, 12 Nov 2019 05:26:26 +0000 (21:26 -0800)]
[PDB] Make pdb::DbiModuleDescriptor destructor trivial

4 years ago[SLP] Look-ahead operand reordering heuristic.
Vasileios Porpodas [Mon, 11 Nov 2019 18:50:20 +0000 (18:50 +0000)]
[SLP] Look-ahead operand reordering heuristic.

Summary: This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for examples).

Reviewers: RKSimon, ABataev, dtemirbulatov, Ayal, hfinkel, rnk

Reviewed By: RKSimon, dtemirbulatov

Subscribers: xbolva00, Carrot, hiraditya, phosek, rnk, rcorcs, llvm-commits

Tags: #llvm

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

4 years agoFix null dereference in yaml::Document::skip
Thomas Finch [Tue, 12 Nov 2019 04:48:28 +0000 (20:48 -0800)]
Fix null dereference in yaml::Document::skip

Summary: The attached test case replicates a null dereference crash in
`yaml::Document::skip()`. This was fixed by adding a check and early
return in the method.

Reviewers: Bigcheese, hintonda, beanz

Reviewed By: hintonda

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years agogn build: Merge e9a06e06064
LLVM GN Syncbot [Tue, 12 Nov 2019 03:49:52 +0000 (03:49 +0000)]
gn build: Merge e9a06e06064

4 years ago[VFABI] Read/Write functions for the VFABI attribute.
Francesco Petrogalli [Wed, 30 Oct 2019 19:08:21 +0000 (19:08 +0000)]
[VFABI] Read/Write functions for the VFABI attribute.

The attribute is stored at the `FunctionIndex` attribute set, with the
name "vector-function-abi-variant".

The get/set methods of the attribute have assertion to verify that:

1. Each name in the attribute is a valid VFABI mangled name.

2. Each name in the attribute correspond to a function declared in the
   module.

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

4 years agoAdd rpath to liblldb so vendors can ship their own python framework (or others)
António Afonso [Mon, 11 Nov 2019 21:39:30 +0000 (13:39 -0800)]
Add rpath to liblldb so vendors can ship their own python framework (or others)

Summary:
I want to be able to specify which python framework to use for lldb in macos. With python2.7 we could just rely on the MacOS one but python3.7 is not shipped with the OS.
An alternative is to use the one shipped with Xcode but that could be path dependent or maybe the user doesn't have Xcode installed at all.
A definite solution is to just ship a python framework with lldb. To make this possible I added "@loader_path/../../../" to the rpath so it points to the same directory as the LLDB.framework, this way we can just drop any frameworks there.

Reviewers: hhb, sgraenitz, xiaobai, smeenai, beanz, labath

Reviewed By: labath

Subscribers: beanz, labath, mgorny, lldb-commits

Tags: #lldb

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

4 years agoAdd InstCombine/InstructionSimplify support for Freeze Instruction
aqjune [Wed, 6 Nov 2019 16:12:17 +0000 (01:12 +0900)]
Add InstCombine/InstructionSimplify support for Freeze Instruction

Summary:
- Add llvm::SimplifyFreezeInst
- Add InstCombiner::visitFreeze
- Add llvm tests

Reviewers: majnemer, sanjoy, reames, lebedev.ri, spatel

Reviewed By: reames, lebedev.ri

Subscribers: reames, lebedev.ri, filcab, regehr, trentxintong, llvm-commits

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

4 years ago[NFC] Fix test case after edab7dd426249bd40059b49b255ba9cc5b784753
Nemanja Ivanovic [Tue, 12 Nov 2019 02:37:09 +0000 (20:37 -0600)]
[NFC] Fix test case after edab7dd426249bd40059b49b255ba9cc5b784753

The author of the patch forgot to add -verify-machineinstrs to the RUN
lines which would have made the issue appear on all bots. Added that
as well as a fix for the undefined register issue (after the hoisting).

4 years ago[X86] Remove setOperationAction lines that say to promote MVT::i1
Craig Topper [Tue, 12 Nov 2019 02:16:14 +0000 (18:16 -0800)]
[X86] Remove setOperationAction lines that say to promote MVT::i1

MVT::i1 should be removed by type legalization before we reach
any code that would act on the promote action.

Mainly to avoid replicating this for strict FP versions of these
operations.

4 years ago[IR] Resolve an error at freeze's unit tests
Juneyoung Lee [Tue, 12 Nov 2019 02:23:19 +0000 (11:23 +0900)]
[IR] Resolve an error at freeze's unit tests

4 years ago[MC] Make MCFragment trivially destructible
Fangrui Song [Tue, 12 Nov 2019 02:11:15 +0000 (18:11 -0800)]
[MC] Make MCFragment trivially destructible

4 years ago[IR] Redefine Freeze instruction
aqjune [Wed, 6 Nov 2019 16:17:49 +0000 (01:17 +0900)]
[IR] Redefine Freeze instruction

Summary:
This patch redefines freeze instruction from being UnaryOperator to a subclass of UnaryInstruction.

ConstantExpr freeze is removed, as discussed in the previous review.
FreezeOperator is not added because there's no ConstantExpr freeze.
`freeze i8* null` test is added to `test/Bindings/llvm-c/freeze.ll` as well, because the null pointer-related bug in `tools/llvm-c/echo.cpp` is now fixed.
InstVisitor has visitFreeze now because freeze is not unaryop anymore.

Reviewers: whitequark, deadalnix, craig.topper, jdoerfert, lebedev.ri

Reviewed By: craig.topper, lebedev.ri

Subscribers: regehr, nlopes, mehdi_amini, hiraditya, steven_wu, dexonsmith, jfb, llvm-commits

Tags: #llvm

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

4 years agoclang/Modules: Clean up modules on error in ReadAST
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 18:42:29 +0000 (10:42 -0800)]
clang/Modules: Clean up modules on error in ReadAST

ReadASTBlock and ReadASTExtensions can both return failures.  Be
consistent and remove all the just-loaded modules, just like when
ReadASTCore returns failures.

https://reviews.llvm.org/D70055

4 years ago[X86] Remove some else branches after checking for !useSoftFloat() that set operation...
Craig Topper [Tue, 12 Nov 2019 00:30:42 +0000 (16:30 -0800)]
[X86] Remove some else branches after checking for !useSoftFloat() that set operations to Expand.

If we're using soft floats, then these operations shoudl be
softened during type legalization. They'll never get to
LegalizeVectorOps or LegalizeDAG so they don't need to be
Expanded there.

4 years agoclang/Modules: Add missing diagnostics for malformed AST files
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 19:07:20 +0000 (11:07 -0800)]
clang/Modules: Add missing diagnostics for malformed AST files

These were found via an audit.  In the case of `ParseLineTable` this is
actually dead code, since parsing the line table always succeeds, but
it's prudent to be defensive since it's possible an assertion there
could be converted to a `true` return in the future.

4 years ago[lldb] Re-enable VSCode tests
Jonas Devlieghere [Mon, 11 Nov 2019 23:58:27 +0000 (15:58 -0800)]
[lldb] Re-enable VSCode tests

The VSCode tests were all disabled on macOS because the implementation
had some issues that resulted in flakiness on Darwin. It seems most of
these issues have been addressed. I've re-enabled all the tests that
consistently passed locally.

4 years ago[X86] Add avx512 command lines to vector-constrained-fp-intrinsics.ll. NFC
Craig Topper [Mon, 11 Nov 2019 23:51:00 +0000 (15:51 -0800)]
[X86] Add avx512 command lines to vector-constrained-fp-intrinsics.ll. NFC

4 years ago[X86] Autogenerate checks in fp-intrinsics.ll. Split fma tests off to fp-intrinsics...
Craig Topper [Mon, 11 Nov 2019 23:42:25 +0000 (15:42 -0800)]
[X86] Autogenerate checks in fp-intrinsics.ll. Split fma tests off to fp-intrinsics-fma.ll. NFC

4 years agoclang/Modules: Split loop in ReadAST between failable and not
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 18:50:12 +0000 (10:50 -0800)]
clang/Modules: Split loop in ReadAST between failable and not

Split a loop in ReadAST that visits the just-loaded module chain,
between an initial loop that reads further from the ASTs (and can fail)
and a second loop that does some preloading (and cannot fail).  This
makes it less likely for a reading failure to affect the AST.

This is not fixing a known bug and the behaviour change may not be
observable, it's just part of an audit to look at all of the error
handling in the ASTReader.

https://reviews.llvm.org/D70056

4 years agoclang/Modules: Use range-based for in ASTReader::ReadAST, NFC
Duncan P. N. Exon Smith [Mon, 11 Nov 2019 23:42:25 +0000 (15:42 -0800)]
clang/Modules: Use range-based for in ASTReader::ReadAST, NFC

4 years ago[PowerPC][XCOFF] Add support for zero initialized global values.
Sean Fertile [Mon, 28 Oct 2019 20:07:10 +0000 (16:07 -0400)]
[PowerPC][XCOFF] Add support for zero initialized global values.

For XCOFF, globals mapped into the .bss section are linked as COMMON
definitions. This behaviour is incorrect for zero initialized data, so
emit those to the .data section instead.

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

4 years agoFixing PowerPC llc test cases for Disable hoisting MI to hotter basic blocks by addin...
Victor Huang [Mon, 11 Nov 2019 23:47:47 +0000 (23:47 +0000)]
Fixing PowerPC llc test cases for Disable hoisting MI to hotter basic blocks by adding powerpc triple

4 years agoclang/Modules: Delay err_module_file_conflict if a diagnostic is in flight
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 19:17:42 +0000 (11:17 -0800)]
clang/Modules: Delay err_module_file_conflict if a diagnostic is in flight

As part of an audit of whether all errors are being reported from the
ASTReader, delay err_module_file_conflict if a diagnostic is already in
flight when it is hit.  This required plumbing an extra argument through
the delayed diagnostic mechanics in DiagnosticsEngine.

4 years ago[Reproducer] Quit the debugger after generating a reproducer
Jonas Devlieghere [Mon, 11 Nov 2019 22:16:52 +0000 (14:16 -0800)]
[Reproducer] Quit the debugger after generating a reproducer

Currently nothing prevents you from continuing your debug session after
generating the reproducer. This can cause the reproducer to end up in an
inconsistent state. Most of the time this doesn't matter, but I want to
prevent this from causing bugs in the future.

4 years agoDisable hoisting MI to hotter basic blocks
Victor Huang [Mon, 11 Nov 2019 21:32:56 +0000 (21:32 +0000)]
Disable hoisting MI to hotter basic blocks

In current Hoist() function of machine licm pass, it will not check the source and destination basic block frequencies that a instruction is hoisted from/to.
There is a chance that instruction is hoisted from a cold to a hot basic block.

In this patch, we add options to disable machine instruction hoisting if destination block is hotter.

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

4 years ago[AArch64] Update for Exynos
Evandro Menezes [Mon, 11 Nov 2019 20:27:14 +0000 (14:27 -0600)]
[AArch64] Update for Exynos

Fix the costs of FP register moves.

4 years ago[AArch64] Add new scheduling predicates
Evandro Menezes [Mon, 11 Nov 2019 20:24:24 +0000 (14:24 -0600)]
[AArch64] Add new scheduling predicates

Add new scheduling predicates to identify more ASIMD forms.

4 years agoclang-format: fix a typo introduced by the previous change
Sylvestre Ledru [Mon, 11 Nov 2019 20:52:08 +0000 (21:52 +0100)]
clang-format: fix a typo introduced by the previous change

4 years agoReplace tabs with spaces. (NFC)
Adrian Prantl [Mon, 11 Nov 2019 20:22:55 +0000 (12:22 -0800)]
Replace tabs with spaces. (NFC)

4 years agoFix a regression in macOS-style path remapping.
Adrian Prantl [Sat, 9 Nov 2019 01:35:52 +0000 (17:35 -0800)]
Fix a regression in macOS-style path remapping.

When we switched to the LLVM .debug_line parser, the .dSYM-style path
remapping logic stopped working for relative paths because of how
RemapSourceFile silently fails for relative paths. This patch both
makes the code more readable and fixes this particular bug.

One interesting thing I learned is that Module::RemapSourceFile() is a
macOS-only code path that operates on on the lldb::Module level and is
completely separate from target.source-map, which operates on a
per-Target level.

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

rdar://problem/56924558

4 years agoAdd a testcase for .dSYM path remapping dictionaries.
Adrian Prantl [Fri, 8 Nov 2019 22:05:45 +0000 (14:05 -0800)]
Add a testcase for .dSYM path remapping dictionaries.

rdar://problem/56924558

4 years ago[ModuloSchedule] Fix modulo expansion for data loop carried dependencies.
Thomas Raoux [Mon, 11 Nov 2019 19:25:19 +0000 (11:25 -0800)]
[ModuloSchedule] Fix modulo expansion for data loop carried dependencies.

The new experimental expansion has a problem when a value has a data
dependency with an instruction from a previous stage. This is due to
the way we peel out the kernel. To fix that I'm changing the way we
peel out the kernel. We now peel the kernel NumberStage - 1 times.
The code would be correct at this point if we didn't have to handle
cases where the loop iteration is smaller than the number of stages.
To handle this case we move instructions between different epilogues
based on their stage and remap the PHI instructions correctly.

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

4 years ago[OPENMP50]Generalize handling of context matching/scoring.
Alexey Bataev [Thu, 7 Nov 2019 16:03:10 +0000 (11:03 -0500)]
[OPENMP50]Generalize handling of context matching/scoring.

Summary:
Untie context matching/scoring from the attribute for declare variant
directive to simplify future uses in other context-dependent directives.

Reviewers: jdoerfert

Subscribers: guansong, kkwli0, caomhin, cfe-commits

Tags: #clang

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

4 years ago[OPENMP50]Add support for nested atomic and simd constructs in
Alexey Bataev [Mon, 11 Nov 2019 18:44:42 +0000 (13:44 -0500)]
[OPENMP50]Add support for nested atomic and simd constructs in
simd-based directives.

According to OpenMP 5.0 standard, ordered simd, atomic and simd
directives are allowed as nested directives in the simd-based
directives.

4 years agoAdd missing override modifiers for FileCheckExpressionAST::eval() overrides.
Simon Pilgrim [Mon, 11 Nov 2019 18:51:14 +0000 (18:51 +0000)]
Add missing override modifiers for FileCheckExpressionAST::eval() overrides.

4 years agoMake FileCheckNumericVariable::getDefLineNumber const. NFC
Simon Pilgrim [Mon, 11 Nov 2019 18:44:13 +0000 (18:44 +0000)]
Make FileCheckNumericVariable::getDefLineNumber const. NFC

Fixes cppcheck warning.

4 years ago[debuginfo] Update test to account for missing __debug_macinfo
Jonas Devlieghere [Mon, 11 Nov 2019 18:40:06 +0000 (10:40 -0800)]
[debuginfo] Update test to account for missing __debug_macinfo

We no longer emit this section if it's empty.

4 years ago[clangd] Fix crash in DefineInline::prepare()
Sam McCall [Mon, 11 Nov 2019 18:00:44 +0000 (19:00 +0100)]
[clangd] Fix crash in DefineInline::prepare()

4 years ago[libc++][P0980] Marked member functions move/copy/assign of char_traits constexpr.
Michael Park [Fri, 8 Nov 2019 13:42:26 +0000 (13:42 +0000)]
[libc++][P0980] Marked member functions move/copy/assign of char_traits constexpr.

Reviewers: ldionne, EricWF, mclow.lists

Reviewed By: ldionne

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

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

4 years ago[libTooling] Further simplify `Stencil` type and introduce `MatchComputation`.
Yitzhak Mandelbaum [Mon, 4 Nov 2019 13:30:18 +0000 (08:30 -0500)]
[libTooling] Further simplify `Stencil` type and introduce `MatchComputation`.

Summary:
This revision introduces a new interface `MatchComputation` which generalizes
the `Stencil` interface and replaces the `std::function` interface of
`MatchConsumer`. With this revision, `Stencil` (as an abstraction) becomes just
one collection of implementations of
`MatchComputation<std::string>`. Correspondingly, we remove the `Stencil` class
entirely in favor of a simple type alias, deprecate `MatchConsumer` and change
all functions that accepted `MatchConsumer<std::string>` to use
`MatchComputation<std::string>` instead.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[scudo][standalone] Match function name change to bionic name change.
Christopher Ferris [Mon, 11 Nov 2019 17:30:17 +0000 (09:30 -0800)]
[scudo][standalone] Match function name change to bionic name change.

Summary: Bionic was modified to have all function names consistent. Modify the code and get rid of the special case for bionic since it's no longer needed.

Reviewers: cryptoad

Reviewed By: cryptoad

Subscribers: srhines, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

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

4 years ago [ModuloSchedule] Do target loop analysis before peeling.
Thomas Raoux [Wed, 6 Nov 2019 19:57:05 +0000 (11:57 -0800)]
[ModuloSchedule] Do target loop analysis before peeling.

    Simple change to call target hook analyzeLoopForPipelining before
    changing the loop. After peeling analyzing the loop may be more
    complicated for target that don't have a loop instruction. This doesn't
    affect Hexagone and PPC as they have hardware loop instructions.

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

4 years agoFix errors where we thought we were checking for labels but weren't due to use of...
Kevin P. Neal [Wed, 30 Oct 2019 17:55:43 +0000 (13:55 -0400)]
Fix errors where we thought we were checking for labels but weren't due to use of the wrong prefix.
Spotted by Craig Topper in reviewing D69275.

4 years ago[CGP] Make ICMP_EQ use CR result of ICMP_S(L|G)T dominators
Yi-Hong Lyu [Mon, 11 Nov 2019 16:15:52 +0000 (16:15 +0000)]
[CGP] Make ICMP_EQ use CR result of ICMP_S(L|G)T dominators

For example:

long long test(long long a, long long b) {
  if (a << b > 0)
    return b;
  if (a << b < 0)
    return a;
  return a*b;
}

Produces:

        sld. 5, 3, 4
        ble 0, .LBB0_2
        mr 3, 4
        blr
.LBB0_2:                                # %if.end
        cmpldi  5, 0
        li 5, 1
        isel 4, 4, 5, 2
        mulld 3, 4, 3
        blr

But the compare (cmpldi 5, 0) is redundant and can be removed (CR0 already
contains the result of that comparison).

The root cause of this is that LLVM converts signed comparisons into equality
comparison based on dominance. Equality comparisons are unsigned by default, so
we get either a record-form or cmp (without the l for logical) feeding a cmpl.
That is the situation we want to avoid here.

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

4 years ago[Support] Add erase() to json::Object
Sam McCall [Mon, 11 Nov 2019 17:25:01 +0000 (18:25 +0100)]
[Support] Add erase() to json::Object

4 years agoFix filename typo in rG8d288a0668a5
Simon Pilgrim [Mon, 11 Nov 2019 17:23:21 +0000 (17:23 +0000)]
Fix filename typo in rG8d288a0668a5

4 years agoTimer - fix shadow variable warnings for Name/Description members. NFC.
Simon Pilgrim [Mon, 11 Nov 2019 17:19:01 +0000 (17:19 +0000)]
Timer - fix shadow variable warnings for Name/Description members. NFC.

4 years agochange LLVM_VERSION_SUFFIX default from svn to git
Nick Desaulniers [Mon, 11 Nov 2019 17:10:14 +0000 (09:10 -0800)]
change LLVM_VERSION_SUFFIX default from svn to git

Summary:
Sayonara SVN!

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewers: tstellar, jyknight, lebedev.ri, smeenai, mgorny, hans, mclow.lists

Reviewed By: mgorny, hans

Subscribers: christof, libcxx-commits, llvm-commits, srhines

Tags: #libc, #llvm

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

4 years ago[Format] Fix clang-format.el unit tests after commit f349cc37cc485fd5f
Sam McCall [Mon, 11 Nov 2019 16:52:31 +0000 (17:52 +0100)]
[Format] Fix clang-format.el unit tests after commit f349cc37cc485fd5f

Also add a comment that test is not automatically run, and how to run it.

Patch by Philipp Stephani!

4 years agolldb: Fix some -Wdeprecated-copy warnings
Pavel Labath [Mon, 11 Nov 2019 16:52:38 +0000 (17:52 +0100)]
lldb: Fix some -Wdeprecated-copy warnings

gcc-9 started warning when a class defined a copy constructor without a
copy assignment operator (or vice-versa).

This fixes those warnings by deleting the other special member too
(after verifying it doesn't do anything non-trivial).

4 years agogn build: Merge 8d288a0668a
LLVM GN Syncbot [Mon, 11 Nov 2019 16:47:59 +0000 (16:47 +0000)]
gn build: Merge 8d288a0668a

4 years ago[clang-tidy] Add bugprone-bad-signal-to-kill-thread check and its alias cert-pos44-c
Abel Kocsis [Mon, 11 Nov 2019 16:47:14 +0000 (17:47 +0100)]
[clang-tidy] Add bugprone-bad-signal-to-kill-thread check and its alias cert-pos44-c

4 years agoRevert "[clang-tidy] Add bugprone-bad-signal-to-kill-thread checker and alias cert...
Abel Kocsis [Mon, 11 Nov 2019 16:34:04 +0000 (17:34 +0100)]
Revert "[clang-tidy] Add bugprone-bad-signal-to-kill-thread checker and alias cert-pos44-c"

This reverts commit 4edf0cb0e03e31d468979d0d7dec08bd9f4f8204.

4 years ago[ObjC] Override TailCallKind when lowering objc intrinsics
Francis Visoiu Mistrih [Thu, 7 Nov 2019 01:09:55 +0000 (17:09 -0800)]
[ObjC] Override TailCallKind when lowering objc intrinsics

The tail-call-kind-ness is known by the ObjCARC analysis and can be
enforced while lowering the intrinsics to calls.

This allows us to get the requested tail calls at -O0 without trying to
preserve the attributes throughout passes that change code even at -O0
,like the Always Inliner, where the ObjCOpt pass doesn't run.

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

4 years agoFix TestNoGPacketSupported on linux
Pavel Labath [Mon, 11 Nov 2019 16:10:46 +0000 (17:10 +0100)]
Fix TestNoGPacketSupported on linux

The mock server pretends the process stopped with signal 17, which is
SIGCHLD on linux. This causes lldb to resume to process, utterly
confusing the test. Lldb probably shouldn't resume in this case, but for
now this issue can be fixed by changing the signal number to 2, which is
SIGINT just about anywhere.

4 years ago[clang-tidy] Add bugprone-bad-signal-to-kill-thread checker and alias cert-pos44-c
Abel Kocsis [Mon, 11 Nov 2019 16:26:44 +0000 (17:26 +0100)]
[clang-tidy] Add bugprone-bad-signal-to-kill-thread checker and alias cert-pos44-c

4 years ago[PowerPC] Implementing overflow version for XO-Form instructions
Stefan Pintile [Fri, 8 Nov 2019 22:14:28 +0000 (16:14 -0600)]
[PowerPC] Implementing overflow version for XO-Form instructions

The Overflow version of XO-Form instruction uses the SO, OV and
OV32 special registers.

This changes modifies existing multiclasses and instruction
definitions to allow for the use of the XER register to record
the various types if overflow from possible add, subtract and
multiply instructions. It then modifies the existing instructions
as to use these multiclasses as needed.

Patch By: Kamau Bridgeman

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

4 years ago[clangd] fixes semantic highlighting test
Haojian Wu [Mon, 11 Nov 2019 15:42:40 +0000 (16:42 +0100)]
[clangd] fixes semantic highlighting test

Summary: fixes https://github.com/clangd/clangd/issues/176

Patch by liu hui!

Reviewers: ilya-biryukov, hokein, sammccall

Reviewed By: hokein

Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang-tools-extra, #clang

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

4 years agoclang-format: [JS] test declared fields.
Martin Probst [Thu, 7 Nov 2019 22:37:06 +0000 (23:37 +0100)]
clang-format: [JS] test declared fields.

Summary:
TypeScript now supports declaring fields:

    class Foo {
      declare field: string;
    }

clang-format happens to already format this fine, so this change just
adds a regression test.

Reviewers: krasimir

Subscribers: cfe-commits

Tags: #clang

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

4 years agoclang-format: [JS] support null operators.
Martin Probst [Thu, 7 Nov 2019 22:39:03 +0000 (23:39 +0100)]
clang-format: [JS] support null operators.

Summary:
JavaScript / TypeScript is adding two new operators: the null
propagating operator `?.` and the nullish coalescing operator `??`.

    const x = foo ?? 'default';
    const z = foo?.bar?.baz;

This change adds support to lex and format both.

Reviewers: krasimir

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[libc++] Mark __call_once_proxy as hidden and internal
Louis Dionne [Mon, 11 Nov 2019 15:21:57 +0000 (10:21 -0500)]
[libc++] Mark __call_once_proxy as hidden and internal

We effectively never want to export that function, which is an
implementation detail of libc++. This was previously tried in
603715c66b6b and then reverted in 8335dd314f36 because it caused
linker warnings. These linker warnings should go away now that we
use internal_linkage instead of always_inline to implement per-TU
insulation.

4 years ago[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (4) (Baseli...
joanlluch [Mon, 11 Nov 2019 15:15:33 +0000 (16:15 +0100)]
[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (4) (Baseline tests)

Summary: Baseline tests before applying D70042

Reviewers: spatel, asl

Subscribers: llvm-commits

Tags: #llvm

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

4 years agoRevert "[InstCombine] avoid crash from deleting an instruction that still has uses...
Sanjay Patel [Mon, 11 Nov 2019 14:56:03 +0000 (09:56 -0500)]
Revert "[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723) (3rd try)"

This reverts commit 3db8a3ef86e7b3331ab466a78c10a62be9e69829.
This caused a different memory-sanitizer failure than earlier attempts,
but it's still not right.

4 years ago[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723...
Sanjay Patel [Mon, 11 Nov 2019 14:27:17 +0000 (09:27 -0500)]
[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723) (3rd try)

Re-try because earlier attempts were reverted due to use-after-free.
Hopefully, diagnosed correctly this time - we replace/remove the
invariant.start first rather than the invariant.end to avoid angering
worklist-based iteration.

We gather a set of white-listed instructions in isAllocSiteRemovable() and then
replace/erase them. But we don't know in general if the instructions in the set
have uses amongst themselves, so order of deletion makes a difference.

There's already a special-case for the llvm.objectsize intrinsic, so add another
for llvm.invariant.start.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=43723

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

4 years agoRevert "[DBG][OPT] Attempt to salvage or undef debug info when removing trivially...
Tom Weaver [Mon, 11 Nov 2019 14:13:33 +0000 (14:13 +0000)]
Revert "[DBG][OPT] Attempt to salvage or undef debug info when removing trivially deletable instructions in the Reassociate Expression pass."

This reverts commit 1984a27db58e9053371ab6d6dc288c81c8a071ac.

4 years ago[DBG][OPT] Attempt to salvage or undef debug info when removing trivially deletable...
Tom Weaver [Mon, 11 Nov 2019 13:47:13 +0000 (13:47 +0000)]
[DBG][OPT] Attempt to salvage or undef debug info when removing trivially deletable instructions in the Reassociate Expression pass.

Reviewed By: aprantl, vsk

Differential revision: https://reviews.llvm.org/D69943

4 years ago[NFC][TEST_COMMIT] Add fullstop to comment.
Tom Weaver [Mon, 11 Nov 2019 13:38:34 +0000 (13:38 +0000)]
[NFC][TEST_COMMIT] Add fullstop to comment.

4 years ago[clangd] Use name of Macro to compute its SymbolID, NFC.
Utkarsh Saxena [Mon, 11 Nov 2019 11:38:17 +0000 (12:38 +0100)]
[clangd] Use name of Macro to compute its SymbolID, NFC.

Summary:
We use the name from the IdentifierInfo of the Macro to compute its
SymbolID. It is better to just take the Name as a parameter to avoid
storing the IdentifierInfo whenever we need the SymbolID for the Macro.

Patch by UTKARSH SAXENA!

Reviewers: hokein

Reviewed By: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

4 years agoAArch64FunctionInfo - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Mon, 11 Nov 2019 11:24:09 +0000 (11:24 +0000)]
AArch64FunctionInfo - fix uninitialized variable warnings. NFCI.

4 years agoFix -Wcovered-switch-default warning. NFCI.
Simon Pilgrim [Mon, 11 Nov 2019 11:18:44 +0000 (11:18 +0000)]
Fix -Wcovered-switch-default warning. NFCI.

4 years agoFix -Wparentheses warning. NFCI.
Simon Pilgrim [Mon, 11 Nov 2019 11:13:32 +0000 (11:13 +0000)]
Fix -Wparentheses warning. NFCI.

4 years agoRemove superfluous ';' to fix Wpedantic. NFC.
Simon Pilgrim [Mon, 11 Nov 2019 10:53:47 +0000 (10:53 +0000)]
Remove superfluous ';' to fix Wpedantic. NFC.

4 years agodocs: fix warning in LangRef parsing
Nuno Lopes [Mon, 11 Nov 2019 10:45:42 +0000 (10:45 +0000)]
docs: fix warning in LangRef parsing

4 years ago[InstCombine] Simplify binary op when only one operand is a select
Jay Foad [Fri, 12 Jul 2019 16:33:54 +0000 (17:33 +0100)]
[InstCombine] Simplify binary op when only one operand is a select

Summary:
SimplifySelectsFeedingBinaryOp simplified binary ops when both operands
were selects with the same condition. This patch extends it to handle
these cases where only one operand is a select:

X op (C ? P : Q) -> C ? (X op P) : (X op Q)
  // if X op P and X op Q both simplify
(C ? P : Q) op Y -> C ? (P op Y) : (Q op Y)
  // if P op Y and Q op Y both simplify

For example: X *fast (C ? 1.0 : 0.0) -> C ? X : 0.0

Reviewers: mcberg2017, majnemer, craig.topper, qcolombet, mcrosier

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lldb] [test] Fix typo in TestSendSignal
Michał Górny [Mon, 11 Nov 2019 10:01:21 +0000 (11:01 +0100)]
[lldb] [test] Fix typo in TestSendSignal

4 years agoRevert cdcf58e5af0 "[RISCV] enable LTO support, pass some options to linker."
Hans Wennborg [Mon, 11 Nov 2019 09:51:11 +0000 (10:51 +0100)]
Revert cdcf58e5af0 "[RISCV] enable LTO support, pass some options to linker."

This started passing target-features on the linker line, not just for RISCV but
for all targets, leading to error messages in Chromium Android build:

  '+soft-float-abi' is not a recognized feature for this target (ignoring feature)
  '+soft-float-abi' is not a recognized feature for this target (ignoring feature)

See Phabricator review for details.

Reverting until this can be fixed properly.

> Summary:
> 1. enable LTO need to pass target feature and abi to LTO code generation
>    RISCV backend need the target feature to decide which extension used in
>    code generation.
> 2. move getTargetFeatures to CommonArgs.h and add ForLTOPlugin flag
> 3. add general tools::getTargetABI in CommonArgs.h because different target uses different
>    way to get the target ABI.
>
> Patch by Kuan Hsu Chen (khchen)
>
> Reviewers: lenary, lewis-revill, asb, MaskRay
>
> Reviewed By: lenary
>
> Subscribers: hiraditya, dschuff, aheejin, fedor.sergeev, mehdi_amini, inglorion, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng, cfe-commits
>
> Tags: #clang
>
> Differential Revision: https://reviews.llvm.org/D67409

4 years ago[lldb] [test] Mark TestSendSignal XFAIL on NetBSD
Michał Górny [Mon, 11 Nov 2019 09:53:39 +0000 (10:53 +0100)]
[lldb] [test] Mark TestSendSignal XFAIL on NetBSD

4 years ago[RISCV][NFC] Add nounwind to LKK test functions
Luís Marques [Mon, 11 Nov 2019 09:46:54 +0000 (09:46 +0000)]
[RISCV][NFC] Add nounwind to LKK test functions

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

4 years ago[clangd] Fix a regression of not showing documentation from forward declarations.
Haojian Wu [Mon, 11 Nov 2019 09:34:29 +0000 (10:34 +0100)]
[clangd] Fix a regression of not showing documentation from forward declarations.

Summary:
There is a regression from https://reviews.llvm.org/D68467. Unlike class
forward declarations, function ducomentation is written in the declaration in
headers, the function definition doesn't contain any documentation, cases like:

```
foo.h
// this is foo.
void foo();
foo.cc

void foo() {}
```
we should still show documentation from the foo declaration.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[NFC] Add one test to verify the sign_extend of vector type.
QingShan Zhang [Mon, 11 Nov 2019 09:44:13 +0000 (09:44 +0000)]
[NFC] Add one test to verify the sign_extend of vector type.

4 years ago[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (3)
joanlluch [Mon, 11 Nov 2019 09:17:57 +0000 (10:17 +0100)]
[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (3)

Summary:
Additional filtering of undesired shifts for targets that do not support them efficiently.

Related with  D69116 and  D69120

Applies the TLI.getShiftAmountThreshold hook to prevent undesired generation of shifts for the following IR code:

```
define i16 @testShiftBits(i16 %a) {
entry:
  %and = and i16 %a, -64
  %cmp = icmp eq i16 %and, 64
  %conv = zext i1 %cmp to i16
  ret i16 %conv
}

define i16 @testShiftBits_11(i16 %a) {
entry:
  %cmp = icmp ugt i16 %a, 63
  %conv = zext i1 %cmp to i16
  ret i16 %conv
}

define i16 @testShiftBits_12(i16 %a) {
entry:
  %cmp = icmp ult i16 %a, 64
  %conv = zext i1 %cmp to i16
  ret i16 %conv
}
```
The attached diff file shows the piece code in TargetLowering that is responsible for the generation of shifts in relation to the IR above.

Before applying this patch, shifts will be generated to replace non-legal icmp immediates. However, shifts may be undesired if they are even more expensive for the target.

For all my previous patches in this series (cited above) I added test cases for the MSP430 target. However, in this case, the target is not suitable for showing improvements related with this patch, because the MSP430 does not implement "isLegalICmpImmediate". The default implementation returns always true, therefore the patched code in TargetLowering is never reached for that target. Targets implementing both "isLegalICmpImmediate" and "getShiftAmountThreshold" will benefit from this.

The differential effect of this patch can only be shown for the MSP430 by temporarily implementing "isLegalICmpImmediate" to return false for large immediates. This is simulated with the implementation of a command line flag that was incorporated in D69975

This patch belongs to a initiative to "relax" the generation of shifts by LLVM for targets requiring it

Reviewers: spatel, lebedev.ri, asl

Reviewed By: spatel

Subscribers: lenary, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[FixBB] - Fix one more std::min -> std::min<uint64_t> to make BB happy.
Georgii Rymar [Mon, 11 Nov 2019 09:11:54 +0000 (12:11 +0300)]
[FixBB] - Fix one more std::min -> std::min<uint64_t> to make BB happy.

BB: http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/22133/steps/build%20stage%201/logs/stdio

4 years agoUse MCRegister in copyPhysReg
Matt Arsenault [Mon, 11 Nov 2019 08:24:21 +0000 (13:54 +0530)]
Use MCRegister in copyPhysReg