platform/upstream/llvm.git
6 years ago[X86] Introduce wbinvd intrinsic
Gabor Buella [Thu, 12 Apr 2018 18:42:02 +0000 (18:42 +0000)]
[X86] Introduce wbinvd intrinsic

A previously missing intrinsic for an old instruction.

Reviewers: craig.topper, echristo

Reviewed By: craig.topper

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

llvm-svn: 329937

6 years ago[X86] Introduce LLVM wbinvd intrinsic
Gabor Buella [Thu, 12 Apr 2018 18:38:18 +0000 (18:38 +0000)]
[X86] Introduce LLVM wbinvd intrinsic

A previously missing intrinsic for an old instruction.

Reviewers: craig.topper, echristo

Reviewed By: craig.topper

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

llvm-svn: 329936

6 years agoFix a typo in a comment; NFC
George Burgess IV [Thu, 12 Apr 2018 18:36:01 +0000 (18:36 +0000)]
Fix a typo in a comment; NFC

llvm-svn: 329935

6 years ago[ORC] Plumb error notifications through the VSO interface.
Lang Hames [Thu, 12 Apr 2018 18:35:08 +0000 (18:35 +0000)]
[ORC] Plumb error notifications through the VSO interface.

This allows materializers to notify the VSO that they were unable to
resolve or finalize symbols.

llvm-svn: 329934

6 years ago[X86] Remove gpr shift/extension schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 18:25:38 +0000 (18:25 +0000)]
[X86] Remove gpr shift/extension schedule itineraries (PR37093)

llvm-svn: 329933

6 years agoNFC - Indentation fixes in predefined-arch-macros.c
Gabor Buella [Thu, 12 Apr 2018 18:15:39 +0000 (18:15 +0000)]
NFC - Indentation fixes in predefined-arch-macros.c

Consistently separating tests with empty lines.
Helps while navigating this file.

Reviewers: craig.topper

Reviewed By: craig.topper

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

llvm-svn: 329932

6 years ago[Power9]Legalize and emit code for converting (Un)Signed DWord to Quad-Precision
Lei Huang [Thu, 12 Apr 2018 18:00:14 +0000 (18:00 +0000)]
[Power9]Legalize and emit code for converting (Un)Signed DWord to Quad-Precision

Legalize and emit code for:

  * xscvsdqp
  * xscvudqp

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

llvm-svn: 329931

6 years agoFix the try_acquire_capability attribute to behave like the other try-lock functions...
Aaron Ballman [Thu, 12 Apr 2018 17:53:21 +0000 (17:53 +0000)]
Fix the try_acquire_capability attribute to behave like the other try-lock functions. Fixes PR32954.

llvm-svn: 329930

6 years ago[MCJIT] Remove the anchor from mcjit.
Benjamin Kramer [Thu, 12 Apr 2018 17:28:30 +0000 (17:28 +0000)]
[MCJIT] Remove the anchor from mcjit.

This is a layering violation. LTO shouldn't depend on MCJIT. The right
fix for this is moving the class somewhere else.

llvm-svn: 329929

6 years agoSet the license header for all OMPT files
Joachim Protze [Thu, 12 Apr 2018 17:23:26 +0000 (17:23 +0000)]
Set the license header for all OMPT files

llvm-svn: 329928

6 years ago[Documentation] Order of changes in existing checks in Release Notes.
Eugene Zelenko [Thu, 12 Apr 2018 17:19:09 +0000 (17:19 +0000)]
[Documentation] Order of changes in existing checks in Release Notes.

llvm-svn: 329927

6 years ago[MIPS GlobalISel] remove superfluous #includes (NFC)
Petar Jovanovic [Thu, 12 Apr 2018 17:01:46 +0000 (17:01 +0000)]
[MIPS GlobalISel] remove superfluous #includes (NFC)

Remove superfluous #includes.
Minor code style change in MipsCallLowering::lowerFormalArguments().

llvm-svn: 329926

6 years ago[scudo] Remove duplicate cmake flags
Kostya Kortchinsky [Thu, 12 Apr 2018 16:41:57 +0000 (16:41 +0000)]
[scudo] Remove duplicate cmake flags

Summary:
Now that common options are propagated again for runtimes build with D45507,
the -f{data,function}-sections flags are now duplicates, remove them.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: mgorny, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 329925

6 years agoCorrectly diagnose when a conversion function is declared with a type qualifier in...
Aaron Ballman [Thu, 12 Apr 2018 16:41:55 +0000 (16:41 +0000)]
Correctly diagnose when a conversion function is declared with a type qualifier in the declaration specifiers rather than in the conversion type id. Fixes PR30595.

llvm-svn: 329924

6 years ago[Hexagon] Enable auto-vectorization only when -fvectorize was given
Krzysztof Parzyszek [Thu, 12 Apr 2018 16:25:35 +0000 (16:25 +0000)]
[Hexagon] Enable auto-vectorization only when -fvectorize was given

llvm-svn: 329923

6 years ago[AArch64] Move AFI->setRedZone(false) to top of emitPrologue
Jessica Paquette [Thu, 12 Apr 2018 16:16:18 +0000 (16:16 +0000)]
[AArch64] Move AFI->setRedZone(false) to top of emitPrologue

AFI->setRedZone(false) was put in the wrong place before, and so it only fired
on functions that didn't have stack frames. This moves that to the top of
emitPrologue to make sure that every function without a redzone has it set
correctly.

This also adds a function representing one of the early exit cases (GHC calling
convention) to the MachineOutliner noredzone test to ensure that we can outline
from functions like these, where we never use a redzone.

llvm-svn: 329922

6 years ago[Test Fix] Fix broken test Index/comment-objc-parameterized-classes.m
Ben Hamilton [Thu, 12 Apr 2018 16:00:05 +0000 (16:00 +0000)]
[Test Fix] Fix broken test Index/comment-objc-parameterized-classes.m

I broke this test in D45498 when I changed the formatter to remove
spaces before Objective-C lightweight generics.

This fixes the test.

Test Plan:
  % make -j16 check-llvm-tools-llvm-lit && ./bin/llvm-lit -sv ../llvm/tools/clang/test/Index/comment-objc-parameterized-classes.m

llvm-svn: 329921

6 years agorevert r328921 - [DAGCombine] (float)((int) f) --> ftrunc (PR36617)
Sanjay Patel [Thu, 12 Apr 2018 15:27:01 +0000 (15:27 +0000)]
revert r328921 - [DAGCombine] (float)((int) f) --> ftrunc (PR36617)

This change is exposing UB in source code - as was warned/predicted. :)
See D44909 for discussion. Reverting while we figure out how to fix things.

llvm-svn: 329920

6 years ago[clang-format] Do not break after ObjC category open paren
Ben Hamilton [Thu, 12 Apr 2018 15:11:55 +0000 (15:11 +0000)]
[clang-format] Do not break after ObjC category open paren

Summary:
Previously, `clang-format` would break Objective-C
category extensions after the opening parenthesis to avoid
breaking the protocol list:

```
% echo "@interface ccccccccccccc (ccccccccccc) <ccccccccccccc> { }" | \
  clang-format -assume-filename=foo.h -style="{BasedOnStyle: llvm, \
  ColumnLimit: 40}"
@interface ccccccccccccc (
    ccccccccccc) <ccccccccccccc> {
}
```

This looks fairly odd, as we could have kept the category extension
on the previous line.

Category extensions are a single item, so they are generally very
short compared to protocol lists. We should prefer breaking after the
opening `<` of the protocol list over breaking after the opening `(`
of the category extension.

With this diff, we now avoid breaking after the category extension's
open paren, which causes us to break after the protocol list's
open angle bracket:

```
% echo "@interface ccccccccccccc (ccccccccccc) <ccccccccccccc> { }" | \
  ./bin/clang-format -assume-filename=foo.h -style="{BasedOnStyle: llvm, \
  ColumnLimit: 40}"
@interface ccccccccccccc (ccccccccccc) <
    ccccccccccccc> {
}
```

Test Plan: New test added. Confirmed test failed before diff and
  passed after diff by running:
  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 329919

6 years ago[clang-format] Improve ObjC guessing heuristic by supporting all @keywords
Ben Hamilton [Thu, 12 Apr 2018 15:11:53 +0000 (15:11 +0000)]
[clang-format] Improve ObjC guessing heuristic by supporting all @keywords

Summary:
This diff improves the Objective-C guessing heuristic by
replacing the hard-coded list of a subset of Objective-C @keywords
with a general check which supports all @keywords.

I also added a few more Foundation keywords which were missing from
the heuristic.

Test Plan: Unit tests updated. Ran tests with:
  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 329918

6 years ago[clang-format] Don't insert space between ObjC class and lightweight generic
Ben Hamilton [Thu, 12 Apr 2018 15:11:51 +0000 (15:11 +0000)]
[clang-format] Don't insert space between ObjC class and lightweight generic

Summary:
In D45185, I added clang-format parser support for Objective-C
generics. However, I didn't touch the whitespace logic, so they
got the same space logic as Objective-C protocol lists.

In every example in the Apple SDK and in the documentation,
there is no space between the class name and the opening `<`
for the lightweight generic specification, so this diff
removes the space and updates the tests.

Test Plan: Tests updated. Ran tests with:
  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 329917

6 years ago[clang-format] Always indent wrapped Objective-C selector names
Ben Hamilton [Thu, 12 Apr 2018 15:11:48 +0000 (15:11 +0000)]
[clang-format] Always indent wrapped Objective-C selector names

Summary:
Currently, indentation of Objective-C method names which are wrapped
onto the next line due to a long return type is controlled by the
style option `IndentWrappedFunctionNames`.

This diff changes the behavior so we always indent wrapped Objective-C
selector names.

NOTE: I partially reverted https://github.com/llvm-mirror/clang/commit/6159c0fbd1876c7f5f984b4830c664cc78f16e2e / rL242484, as it was causing wrapped selectors to be double-indented. Its tests in FormatTestObjC.cpp still pass.

Test Plan: Tests updated. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak, stephanemoore, thakis

Reviewed By: djasper

Subscribers: stephanemoore, klimek, cfe-commits

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

llvm-svn: 329916

6 years ago[Pipeliner] Use std::stable_sort when ordering NodeSets
Krzysztof Parzyszek [Thu, 12 Apr 2018 15:11:11 +0000 (15:11 +0000)]
[Pipeliner] Use std::stable_sort when ordering NodeSets

There are cases when individual NodeSets can be equal with respect to
the ordering criteria. Since they are stored in an ordered container,
use stable_sort to preserve the relative order of equal NodeSets.

This should remove non-determinism discovered by shuffling done in
llvm::sort with expensive checks enabled.

llvm-svn: 329915

6 years agoDiagnose cases of "return x" that should be "return std::move(x)" for efficiency
Malcolm Parsons [Thu, 12 Apr 2018 14:48:48 +0000 (14:48 +0000)]
Diagnose cases of "return x" that should be "return std::move(x)" for efficiency

Summary:
This patch adds two new diagnostics, which are off by default:

**-Wreturn-std-move**

This diagnostic is enabled by `-Wreturn-std-move`, `-Wmove`, or `-Wall`.
Diagnose cases of `return x` or `throw x`, where `x` is the name of a local variable or parameter, in which a copy operation is performed when a move operation would have been available. The user probably expected a move, but they're not getting a move, perhaps because the type of "x" is different from the return type of the function.
A place where this comes up in the wild is `stdext::inplace_function<Sig, N>` which implements conversion via a conversion operator rather than a converting constructor; see https://github.com/WG21-SG14/SG14/issues/125#issue-297201412
Another place where this has come up in the wild, but where the fix ended up being different, was

    try { ... } catch (ExceptionType ex) {
        throw ex;
    }

where the appropriate fix in that case was to replace `throw ex;` with `throw;`, and incidentally to catch by reference instead of by value. (But one could contrive a scenario where the slicing was intentional, in which case throw-by-move would have been the appropriate fix after all.)
Another example (intentional slicing to a base class) is dissected in https://github.com/accuBayArea/Slides/blob/master/slides/2018-03-07.pdf

**-Wreturn-std-move-in-c++11**

This diagnostic is enabled only by the exact spelling `-Wreturn-std-move-in-c++11`.
Diagnose cases of "return x;" or "throw x;" which in this version of Clang *do* produce moves, but which prior to Clang 3.9 / GCC 5.1 produced copies instead. This is useful in codebases which care about portability to those older compilers.
The name "-in-c++11" is not technically correct; what caused the version-to-version change in behavior here was actually CWG 1579, not C++14. I think it's likely that codebases that need portability to GCC 4.9-and-earlier may understand "C++11" as a colloquialism for "older compilers." The wording of this diagnostic is based on feedback from @rsmith.

**Discussion**

Notice that this patch is kind of a negative-space version of Richard Trieu's `-Wpessimizing-move`. That diagnostic warns about cases of `return std::move(x)` that should be `return x` for speed. These diagnostics warn about cases of `return x` that should be `return std::move(x)` for speed. (The two diagnostics' bailiwicks do not overlap: we don't have to worry about a `return` statement flipping between the two states indefinitely.)

I propose to write a paper for San Diego that would relax the implicit-move rules so that in C++2a the user //would// see the moves they expect, and the diagnostic could be re-worded in a later version of Clang to suggest explicit `std::move` only "in C++17 and earlier." But in the meantime (and/or forever if that proposal is not well received), this diagnostic will be useful to detect accidental copy operations.

Reviewers: rtrieu, rsmith

Reviewed By: rsmith

Subscribers: lebedev.ri, Rakete1111, rsmith, cfe-commits

Tags: #clang

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

Patch by Arthur O'Dwyer.

llvm-svn: 329914

6 years ago[mips] Correct the predicates of the load/store (double)word for coprocessor 3.
Simon Dardis [Thu, 12 Apr 2018 14:41:38 +0000 (14:41 +0000)]
[mips] Correct the predicates of the load/store (double)word for coprocessor 3.

llvm-svn: 329913

6 years ago[X86] Remove AES/CLMUL/CRC32/LDDQU/MOVNT/POPCNT/SHA schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 14:31:42 +0000 (14:31 +0000)]
[X86] Remove AES/CLMUL/CRC32/LDDQU/MOVNT/POPCNT/SHA schedule itineraries (PR37093)

llvm-svn: 329912

6 years ago[OpenCL] Added -std/-cl-std=c++
Anastasia Stulova [Thu, 12 Apr 2018 14:17:04 +0000 (14:17 +0000)]
[OpenCL] Added -std/-cl-std=c++

This is std option for OpenCL C++ v1.0.

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

llvm-svn: 329911

6 years agoRevert "Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time."
Benjamin Kramer [Thu, 12 Apr 2018 13:52:02 +0000 (13:52 +0000)]
Revert "Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time."

This reverts commit r329865. Causes stage2/stage3 miscompare.

llvm-svn: 329910

6 years ago[AArch64][AsmParser] Unify 'addVectorListOperands' functions.
Sander de Smalen [Thu, 12 Apr 2018 13:19:32 +0000 (13:19 +0000)]
[AArch64][AsmParser] Unify 'addVectorListOperands' functions.

Summary:
Merged 'addVectorList64Operands' and 'addVectorList128Operands' into a
generic 'addVectorListOperands', which can be easily extended to work
for SVE vectors.

This is patch [4/6] in a series to add assembler/disassembler support for
SVE's contiguous ST1 (scalar+imm) instructions.

Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro

Reviewed By: rengolin

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 329909

6 years ago[CodeGen] Allow printing MachineMemOperands with less context in SDAGDumper
Francis Visoiu Mistrih [Thu, 12 Apr 2018 12:59:50 +0000 (12:59 +0000)]
[CodeGen] Allow printing MachineMemOperands with less context in SDAGDumper

Don't assume SelectionDAG is non-null as the targets can use it with a
null pointer.

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

llvm-svn: 329908

6 years ago[IRCE] isKnownNonNegative helper function
Sam Parker [Thu, 12 Apr 2018 12:49:40 +0000 (12:49 +0000)]
[IRCE] isKnownNonNegative helper function

Created a helper function to query for non negative SCEVs. Uses the
SGE predicate to catch constants that could be interpreted as
negative.

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

llvm-svn: 329907

6 years ago[X86] Remove remaining system/special schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 12:43:49 +0000 (12:43 +0000)]
[X86] Remove remaining system/special schedule itineraries (PR37093)

llvm-svn: 329906

6 years ago[mips] Correct the predicates for special nops, tlb ctrl instrs, software breakpoint...
Simon Dardis [Thu, 12 Apr 2018 12:37:02 +0000 (12:37 +0000)]
[mips] Correct the predicates for special nops, tlb ctrl instrs, software breakpoint and prefx.

Reviewers: atanasyan, abeserminji

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

llvm-svn: 329905

6 years agoAllow [[maybe_unused]] on static data members; these are considered variables and...
Aaron Ballman [Thu, 12 Apr 2018 12:21:41 +0000 (12:21 +0000)]
Allow [[maybe_unused]] on static data members; these are considered variables and the attribute should appertain to them.

Patch by S. B. Tam.

llvm-svn: 329904

6 years ago[X86] Remove system/control schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 12:09:24 +0000 (12:09 +0000)]
[X86] Remove system/control schedule itineraries (PR37093)

llvm-svn: 329903

6 years ago[clang-tidy] readability-function-size: add VariableThreshold param.
Roman Lebedev [Thu, 12 Apr 2018 12:06:42 +0000 (12:06 +0000)]
[clang-tidy] readability-function-size: add VariableThreshold param.

Summary:
Pretty straight-forward, just count all the variable declarations in the function's body, and if more than the configured threshold - do complain.

Note that this continues perverse practice of disabling the new option by default.
I'm not certain where is the balance point between not being too noisy, and actually enforcing the good practice.
If we really want to not disable this by default, but also to not cause too many new warnings, we could default to 50 or so.
But that is a lot of variables too...

I was able to find one coding style referencing variable count:
  - https://www.kernel.org/doc/html/v4.15/process/coding-style.html#functions

    > Another measure of the function is the number of local variables. They shouldn’t exceed 5-10, or you’re doing something wrong.

Reviewers: hokein, xazax.hun, JonasToth, aaron.ballman, alexfh

Reviewed By: aaron.ballman

Subscribers: kimgr, Eugene.Zelenko, rnkovacs, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 329902

6 years ago[InstCombine][NFC]: Add tests: foldSelectICmpAndAnd(): and is commutative
Roman Lebedev [Thu, 12 Apr 2018 12:04:57 +0000 (12:04 +0000)]
[InstCombine][NFC]: Add tests: foldSelectICmpAndAnd(): and is commutative

Summary:
The fold added in D45108 did not account for the fact that
the and instruction is commutative, and if the mask is a variable,
the mask variable and the fold variable may be swapped.

I have noticed this by accident when looking into [[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]]

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 329901

6 years ago[AArch64][AsmParser] Make parse function for VectorLists generic to other vector...
Sander de Smalen [Thu, 12 Apr 2018 11:40:52 +0000 (11:40 +0000)]
[AArch64][AsmParser] Make parse function for VectorLists generic to other vector types.

Summary:
Added 'RegisterKind' to the VectorListOp structure, so that this operand
type can be reused for SVE vector lists in a later patch. It also
refactors the 'tryParseVectorList' function so it can be used directly
in the ParserMethod of an operand. The parsing can now parse multiple
kinds of vectors and recover if there is no match.

This is patch [3/6] in a series to add assembler/disassembler support for
SVE's contiguous ST1 (scalar+imm) instructions.

Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro

Reviewed By: rengolin

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 329900

6 years ago[RISCV] Change function alignment to 4 bytes, and 2 bytes for RVC
Shiva Chen [Thu, 12 Apr 2018 11:30:59 +0000 (11:30 +0000)]
[RISCV] Change function alignment to 4 bytes, and 2 bytes for RVC

Summary:

According RISC-V ELF psABI specification, base RV32 and RV64 ISAs only
allow 32-bit instruction alignment, but instruction allow to be aligned
to 16-bit boundaries for C-extension.

So we just align to 4 bytes and 2 bytes for C-extension is enough.

Reviewers: asb, apazos

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

Patch by Kito Cheng.

llvm-svn: 329899

6 years ago[X86] Remove CMOV/SETCC schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 11:01:40 +0000 (11:01 +0000)]
[X86] Remove CMOV/SETCC schedule itineraries (PR37093)

llvm-svn: 329898

6 years agoRevert "Don't assume backing thread shares protocol ID."
Jonas Devlieghere [Thu, 12 Apr 2018 10:51:52 +0000 (10:51 +0000)]
Revert "Don't assume backing thread shares protocol ID."

This reverts r329891 because the test case is timing out on linux:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/21834

llvm-svn: 329897

6 years ago[X86] Remove MMX/3DNow schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 10:49:57 +0000 (10:49 +0000)]
[X86] Remove MMX/3DNow schedule itineraries (PR37093)

llvm-svn: 329896

6 years ago[llvm-mca] Removed unused argument from cycleEvent. NFC
Andrea Di Biagio [Thu, 12 Apr 2018 10:49:40 +0000 (10:49 +0000)]
[llvm-mca] Removed unused argument from cycleEvent. NFC

llvm-svn: 329895

6 years ago[clang-apply-replacements] Always initialize FormatStyle.
Benjamin Kramer [Thu, 12 Apr 2018 10:35:24 +0000 (10:35 +0000)]
[clang-apply-replacements] Always initialize FormatStyle.

The cleanup logic reads from this for cleanups even if reformatting is
not requested.

Found by msan.

llvm-svn: 329894

6 years ago[X86] Remove X87 schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 10:27:37 +0000 (10:27 +0000)]
[X86] Remove X87 schedule itineraries (PR37093)

First of a number of commits to remove x86 schedule itineraries entirely - approved off-line with @craig.topper

llvm-svn: 329893

6 years ago[clang-apply-replacements] Don't forget to link to clangToolingRefactor
Roman Lebedev [Thu, 12 Apr 2018 10:01:20 +0000 (10:01 +0000)]
[clang-apply-replacements] Don't forget to link to clangToolingRefactor

Fixes build:

[1/3] Linking CXX shared library lib/libclangApplyReplacements.so.7svn
FAILED: lib/libclangApplyReplacements.so.7svn
<...>
/usr/local/bin/ld.lld: error: undefined symbol: clang::tooling::AtomicChange::replace(clang::SourceManager const&, clang::SourceLocation, unsigned int, llvm::StringRef)
>>> referenced by ApplyReplacements.cpp
>>>               tools/clang/tools/extra/clang-apply-replacements/CMakeFiles/clangApplyReplacements.dir/lib/Tooling/ApplyReplacements.cpp.o:(clang::replace::mergeAndDeduplicate(std::vector<clang::tooling::TranslationUnitReplacements, std::allocator<clang::tooling::TranslationUnitReplacements> > const&, std::vector<clang::tooling::TranslationUnitDiagnostics, std::allocator<clang::tooling::TranslationUnitDiagnostics> > const&, llvm::DenseMap<clang::FileEntry const*, std::vector<clang::tooling::AtomicChange, std::allocator<clang::tooling::AtomicChange> >, llvm::DenseMapInfo<clang::FileEntry const*>, llvm::detail::DenseMapPair<clang::FileEntry const*, std::vector<clang::tooling::AtomicChange, std::allocator<clang::tooling::AtomicChange> > > >&, clang::SourceManager&))

/usr/local/bin/ld.lld: error: undefined symbol: clang::tooling::applyAtomicChanges[abi:cxx11](llvm::StringRef, llvm::StringRef, llvm::ArrayRef<clang::tooling::AtomicChange>, clang::tooling::ApplyChangesSpec const&)
>>> referenced by ApplyReplacements.cpp
>>>               tools/clang/tools/extra/clang-apply-replacements/CMakeFiles/clangApplyReplacements.dir/lib/Tooling/ApplyReplacements.cpp.o:(clang::replace::applyChanges[abi:cxx11](llvm::StringRef, std::vector<clang::tooling::AtomicChange, std::allocator<clang::tooling::AtomicChange> > const&, clang::tooling::ApplyChangesSpec const&, clang::DiagnosticsEngine&))
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Refs. D43764, rL329813

llvm-svn: 329892

6 years agoDon't assume backing thread shares protocol ID.
Jonas Devlieghere [Thu, 12 Apr 2018 09:58:20 +0000 (09:58 +0000)]
Don't assume backing thread shares protocol ID.

When we're dealing with virtual (memory) threads created by the OS
plugins, there's no guarantee that the real thread and the backing
thread share a protocol ID. Instead, we should iterate over the memory
threads to find the virtual thread that is backed by the current real
thread.

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

rdar://36485830

llvm-svn: 329891

6 years ago[dotest] Fix syntax error and typo.
Jonas Devlieghere [Thu, 12 Apr 2018 09:35:17 +0000 (09:35 +0000)]
[dotest] Fix syntax error and typo.

Python uses `elif` rather than `else if`. Fixes r329889.

llvm-svn: 329890

6 years ago[dotest] Use in-tree dsymutil on Darwin
Jonas Devlieghere [Thu, 12 Apr 2018 09:25:32 +0000 (09:25 +0000)]
[dotest] Use in-tree dsymutil on Darwin

Summary:
With the upstream implementation of dsymutil containing almost all
functionality from the one shipped with Xcode, we want to use the
in-tree version for running the test suite.

This will also allow us to re-enable TestUnicodeSymbols which was
failing because of the discrepancy in how Unicode symbols were hashed in
lldb and older versions of dsymutil.

Reviewers: aprantl, davide, jingham, labath

Subscribers: mgorny, llvm-commits, lldb-commits

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

llvm-svn: 329889

6 years ago[MIPS GlobalISel] minor update to MIR tests added in r329819
Petar Jovanovic [Thu, 12 Apr 2018 09:12:29 +0000 (09:12 +0000)]
[MIPS GlobalISel] minor update to MIR tests added in r329819

Remove 'registers' section, as suggested (D. Sanders) at code review

https://reviews.llvm.org/D44304

llvm-svn: 329888

6 years ago[SystemZ] Use ResourceCycles=30 for FPd unit (NFC).
Jonas Paulsson [Thu, 12 Apr 2018 08:08:42 +0000 (08:08 +0000)]
[SystemZ]  Use ResourceCycles=30 for FPd unit (NFC).

This is better than listing FPd 30 times :-)

Review: Ulrich Weigand
llvm-svn: 329887

6 years ago[SystemZ] Remove FullInstRWOverlapCheck from SchedMachineModels.
Jonas Paulsson [Thu, 12 Apr 2018 08:06:04 +0000 (08:06 +0000)]
[SystemZ]  Remove FullInstRWOverlapCheck from SchedMachineModels.

This is NFC, even though it caught just a few cases of overlapping regular
expressions.

Review: Ulrich Weigand
llvm-svn: 329886

6 years ago[HexagonMachineScheduler] Remove local (copied) getWeakLeft().
Jonas Paulsson [Thu, 12 Apr 2018 07:39:33 +0000 (07:39 +0000)]
[HexagonMachineScheduler]  Remove local (copied) getWeakLeft().

Since the common code getWeakLeft() is now available, there should not
be a local copy of this function in target.

llvm-svn: 329885

6 years ago[MachineScheduler] NFC refactoring
Jonas Paulsson [Thu, 12 Apr 2018 07:21:39 +0000 (07:21 +0000)]
[MachineScheduler]  NFC refactoring

This patch makes tryCandidate() virtual and some utility functions like
tryLess(), tryGreater(), ... externally available (used to be static).

This makes it possible for a target to derive a new MachineSchedStrategy from
GenericScheduler and reuse most parts.

It was necessary to wrap functions with the same names in
AMDGPU/SIMachineScheduler in a local namespace.

Review: Andy Trick, Florian Hahn
https://reviews.llvm.org/D43329

llvm-svn: 329884

6 years ago[LegalizeTypes] Remove unnecessary type action check on the type of operand 0 when...
Craig Topper [Thu, 12 Apr 2018 06:51:58 +0000 (06:51 +0000)]
[LegalizeTypes] Remove unnecessary type action check on the type of operand 0 when promoting shift result type. NFC

Operand 0 should have the same type of the result. So if the result type needs to be promoted, operand 0 needs to be promoted unconditionally.

llvm-svn: 329883

6 years agoObjCGNU: Fix empty v3 protocols being emitted two fields short
David Chisnall [Thu, 12 Apr 2018 06:46:15 +0000 (06:46 +0000)]
ObjCGNU: Fix empty v3 protocols being emitted two fields short

Summary:
Protocols that were being referenced but could not be fully realized were being emitted without `properties`/`optional_properties`. Since all v3 protocols must be 9 processor words wide, the lack of these fields is catastrophic for the runtime.

As an example, the runtime cannot know [here](https://github.com/gnustep/libobjc2/blob/master/protocol.c#L73) that `properties` and `optional_properties` are invalid.

Reviewers: rjmccall, theraven

Reviewed By: rjmccall, theraven

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 329882

6 years ago[clang-tidy] [modernize-use-auto] Fix test modernize-use-auto-new-remove-stars.cpp...
Zinovy Nis [Thu, 12 Apr 2018 06:45:47 +0000 (06:45 +0000)]
[clang-tidy] [modernize-use-auto] Fix test modernize-use-auto-new-remove-stars.cpp  after improvement

'tooling::fixit::getText' considers a length of "int *" to be 5 instead of 3
in a new algorithm in https://reviews.llvm.org/rCTE329873. It was the root of
the test failure.

llvm-svn: 329881

6 years agoAdd isl operator overloads for isl::pw_aff (Try II)
Tobias Grosser [Thu, 12 Apr 2018 06:15:17 +0000 (06:15 +0000)]
Add isl operator overloads for isl::pw_aff (Try II)

Piecewise affine expressions have directly corresponding mathematical
operators. Introduce these operators as overloads as this makes writing
code with isl::pw_aff expressions more directly readable.

We can now write:

  A = B + C    instead of    A = B.add(C)

Reviewers: Meinersbur, bollu, sebpop

Reviewed By: Meinersbur

Subscribers: philip.pfaffe, pollydev, llvm-commits

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

llvm-svn: 329880

6 years ago[Sema][ObjC] Ensure that the return type of an ObjC method is a complete
Akira Hatanaka [Thu, 12 Apr 2018 06:01:41 +0000 (06:01 +0000)]
[Sema][ObjC] Ensure that the return type of an ObjC method is a complete
type.

Copy the code in ActOnStartOfFunctionDef that checks a function's return
type to ActOnStartOfObjCMethodDef. This fixes an assertion failure in
IRGen caused by an uninstantiated return type.

rdar://problem/38691818

llvm-svn: 329879

6 years ago[NFC] fix trivial typos in documents and comments
Hiroshi Inoue [Thu, 12 Apr 2018 05:53:20 +0000 (05:53 +0000)]
[NFC] fix trivial typos in documents and comments

"is is" -> "is", "if if" -> "if", "or or" -> "or"

llvm-svn: 329878

6 years ago[RISCV] Codegen support for RV32D floating point comparison operations
Alex Bradbury [Thu, 12 Apr 2018 05:50:06 +0000 (05:50 +0000)]
[RISCV] Codegen support for RV32D floating point comparison operations

Also add double-prevoius-failure.ll which captures a test case that at one
point triggered a compiler crash, while developing calling convention support
for f64 on RV32D with soft-float ABI.

llvm-svn: 329877

6 years ago[RISCV] Codegen support for RV32D floating point conversion operations
Alex Bradbury [Thu, 12 Apr 2018 05:47:15 +0000 (05:47 +0000)]
[RISCV] Codegen support for RV32D floating point conversion operations

This also includes support and a test for truncating stores, which are now
possible thanks to the fpround pattern.

llvm-svn: 329876

6 years ago[Documentation] Fix options order for Release Notes in modernize-use-auto.
Zinovy Nis [Thu, 12 Apr 2018 05:45:16 +0000 (05:45 +0000)]
[Documentation] Fix options order for Release Notes in modernize-use-auto.

llvm-svn: 329875

6 years ago[RISCV] Add codegen support for RV32D floating point arithmetic operations
Alex Bradbury [Thu, 12 Apr 2018 05:42:42 +0000 (05:42 +0000)]
[RISCV] Add codegen support for RV32D floating point arithmetic operations

llvm-svn: 329874

6 years ago[clang-tidy] [modernize-use-auto] Get only a length of token, not the token itself
Zinovy Nis [Thu, 12 Apr 2018 05:41:24 +0000 (05:41 +0000)]
[clang-tidy] [modernize-use-auto] Get only a length of token, not the token itself

llvm-svn: 329873

6 years ago[RISCV] Add tests missed in r329871
Alex Bradbury [Thu, 12 Apr 2018 05:36:44 +0000 (05:36 +0000)]
[RISCV] Add tests missed in r329871

llvm-svn: 329872

6 years ago[RISCV] Codegen support for RV32D floating point load/store, fadd.d, calling conv
Alex Bradbury [Thu, 12 Apr 2018 05:34:25 +0000 (05:34 +0000)]
[RISCV] Codegen support for RV32D floating point load/store, fadd.d, calling conv

fadd.d is required in order to force floating point registers to be used in
test code, as parameters are passed in integer registers in the soft float
ABI.

Much of this patch is concerned with support for passing f64 on RV32D with a
soft-float ABI. Similar to Mips, introduce pseudoinstructions to build an f64
out of a pair of i32 and to split an f64 to a pair of i32. BUILD_PAIR and
EXTRACT_ELEMENT can't be used, as a BITCAST to i64 would be necessary, but i64
is not a legal type.

llvm-svn: 329871

6 years agoTest commit access
Yan Luo [Thu, 12 Apr 2018 04:26:49 +0000 (04:26 +0000)]
Test commit access

llvm-svn: 329870

6 years ago[ODRHash] Skip more types hashing TypedefType
Richard Trieu [Thu, 12 Apr 2018 02:26:49 +0000 (02:26 +0000)]
[ODRHash] Skip more types hashing TypedefType

To get the underlying type for TypedefType's, also skip ElaboratedType's.

llvm-svn: 329869

6 years ago[DeadArgElim] Remove allocsize attributes on callsites
George Burgess IV [Thu, 12 Apr 2018 02:06:01 +0000 (02:06 +0000)]
[DeadArgElim] Remove allocsize attributes on callsites

We're already removing allocsize attributes from Functions that we
remove args from, since removing arguments from a function may make the
allocsize attribute incorrect. It appears we forgot to also remove them
from callsites.

Without this, I get verifier errors on `@Test2`.

It probably wouldn't be too hard to make DAE properly update allocsize
attributes instead of dropping them, but I can't think of a scenario
where that'd be useful in practice.

llvm-svn: 329868

6 years agoRevert "[llvm-objcopy] Switch over to using TableGen for parsing arguments"
Jake Ehrlich [Thu, 12 Apr 2018 00:40:50 +0000 (00:40 +0000)]
Revert "[llvm-objcopy] Switch over to using TableGen for parsing arguments"

TableGen seems to work differently on windows. I'll need to revert this

This reverts commit 7a153ddea067b24da59f6a66c733d79205969501.

llvm-svn: 329867

6 years agoLex: make `clang::Preprocessor::macros` work on MSVC
Saleem Abdulrasool [Wed, 11 Apr 2018 23:47:25 +0000 (23:47 +0000)]
Lex: make `clang::Preprocessor::macros` work on MSVC

The order of argument construction is reversed on MS ABI on Windows.
When `macros` was invoked, the `end` call is made prior to `begin`.  In
such a case, the DenseMap (`ModuleMap`) is populated after the `end`
iterator is constructed.  This reversal results in the invalidation of
the end iterator, resulting in a failure at runtime (assertion failure
in `DenseMap<T>::operator!=` that "handles are not in sync!").  Ensure
that the end iterator is constructed after the begin iterator.  This
fixes the use of `macros(bool)`, which symptomized as an assertion
failure in the swift compiler in the clang importer.

llvm-svn: 329866

6 years agoReapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time.
Michael Zolotukhin [Wed, 11 Apr 2018 23:37:53 +0000 (23:37 +0000)]
Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time.

This reapplies commit r329644.

llvm-svn: 329865

6 years ago[SSAUpdaterBulk] Fix linux bootstrap/sanitizer failures: explicitly specify order...
Michael Zolotukhin [Wed, 11 Apr 2018 23:37:37 +0000 (23:37 +0000)]
[SSAUpdaterBulk] Fix linux bootstrap/sanitizer failures: explicitly specify order of evaluation.

The standard says that the order of evaluation of an expression
  s[x] = foo()
is unspecified. In our case, we first create an empty entry in the map,
then call foo(), then store its return value to the created entry. The
problem is that foo uses the map as a cache, so if it finds that there
is an entry in the map, it stops computation. This change explicitly
sets the order, thus fixing this heisenbug.

llvm-svn: 329864

6 years ago[llvm-objcopy] Switch over to using TableGen for parsing arguments
Jake Ehrlich [Wed, 11 Apr 2018 23:37:03 +0000 (23:37 +0000)]
[llvm-objcopy] Switch over to using TableGen for parsing arguments

Swithces from using the command line library to using TableGen. This will allow
llvm-strip to exist and allow refinements of the command line syntax.

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

llvm-svn: 329863

6 years ago[X86] Remove unused itinerary argument from FMA3/FMA4/XOP instructions. NFCI.
Simon Pilgrim [Wed, 11 Apr 2018 23:24:38 +0000 (23:24 +0000)]
[X86] Remove unused itinerary argument from FMA3/FMA4/XOP instructions. NFCI.

llvm-svn: 329862

6 years agoAdd missing vtable anchors
Weiming Zhao [Wed, 11 Apr 2018 23:09:20 +0000 (23:09 +0000)]
Add missing vtable anchors

Summary: This patch adds anchor() for MemoryBuffer, raw_fd_ostream, RTDyldMemoryManager, SectionMemoryManager, etc.

Reviewers: jlebar, eli.friedman, dblaikie

Reviewed By: dblaikie

Subscribers: mehdi_amini, mgorny, dblaikie, weimingz, llvm-commits

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

llvm-svn: 329861

6 years agoX86FoldTableEntry - avoid unnecessary std::string creation. NFCI.
Simon Pilgrim [Wed, 11 Apr 2018 23:08:30 +0000 (23:08 +0000)]
X86FoldTableEntry - avoid unnecessary std::string creation. NFCI.

llvm-svn: 329860

6 years ago[LLVM-C] Add LLVMGetHostCPU{Name,Features}.
whitequark [Wed, 11 Apr 2018 22:40:42 +0000 (22:40 +0000)]
[LLVM-C] Add LLVMGetHostCPU{Name,Features}.

Without these functions it's hard to create a TargetMachine for
Orc JIT that creates efficient native code.

It's not sufficient to just expose LLVMGetHostCPUName(), because
for some CPUs there's fewer features actually available than
the CPU name indicates (e.g. AVX might be missing on some CPUs
identified as Skylake).

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

llvm-svn: 329856

6 years agoDriver: Add gcc search path for RHEL devtoolset-7
Tom Stellard [Wed, 11 Apr 2018 22:29:35 +0000 (22:29 +0000)]
Driver:  Add gcc search path for RHEL devtoolset-7

Reviewers: bruno

Reviewed By: bruno

Subscribers: bruno, cfe-commits

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

llvm-svn: 329854

6 years agoDon't repeatedly evaluate size() in the for loop. NFCI.
Simon Pilgrim [Wed, 11 Apr 2018 22:24:48 +0000 (22:24 +0000)]
Don't repeatedly evaluate size() in the for loop. NFCI.

llvm-svn: 329853

6 years ago[PowerPC] Fix condition for 64-bit rotate when replacing r+r instr with r+i
Nemanja Ivanovic [Wed, 11 Apr 2018 21:25:44 +0000 (21:25 +0000)]
[PowerPC] Fix condition for 64-bit rotate when replacing r+r instr with r+i

This patch fixes https://bugs.llvm.org/show_bug.cgi?id=37039
The condition only covers one of the two 64-bit rotate instructions. This just
adds the second (RLDICLo).

Patch by Josh Stone.

llvm-svn: 329852

6 years ago[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings;...
Eugene Zelenko [Wed, 11 Apr 2018 20:57:28 +0000 (20:57 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 329851

6 years agoAttempting to work around a non-determinism issue.
Puyan Lotfi [Wed, 11 Apr 2018 20:29:32 +0000 (20:29 +0000)]
Attempting to work around a non-determinism issue.

The main thing that matters with this test is that the COPYs
are moved together not where the REG_SEQUENCES are.

llvm-svn: 329850

6 years agobpf: signal error instead of silent drop for certain invalid asm insn
Yonghong Song [Wed, 11 Apr 2018 20:24:52 +0000 (20:24 +0000)]
bpf: signal error instead of silent drop for certain invalid asm insn

Currently, an invalid asm insn, either in an asm file or
in an inline asm format, might be silently dropped. This patch
fixed two places where this may happen by
signaling the error so user knows what goes wrong.

The following is an example to demonstrate error messages:

    -bash-4.2$ cat t.c
    int test(void *ctx) {
    #if defined(NO_ERROR)
      asm volatile("r0 = *(u16 *)skb[%0]" : : "i"(2));
    #elif defined(ERROR_1)
      asm volatile("r20 = *(u16 *)skb[%0]" : : "i"(2));
    #elif defined(ERROR_2)
      asm volatile("r0 = *(u16 *)(r1 + ?)" : :);
    #endif
      return 0;
    }
    -bash-4.2$ cat run.sh
    for macro in NO_ERROR ERROR_1 ERROR_2; do
      echo "===== compile for macro" $macro
      clang -D${macro} -O2 -target bpf -emit-llvm -S t.c
      echo "==llc=="
      llc -march=bpf -filetype=obj t.ll
    done
    -bash-4.2$ ./run.sh
    ===== compile for macro NO_ERROR
    ==llc==
    ===== compile for macro ERROR_1
    ==llc==
    <inline asm>:1:2: error: invalid register/token name
            r20 = *(u16 *)skb[2]
            ^
    note: !srcloc = 135
    ===== compile for macro ERROR_2
    ==llc==
    <inline asm>:1:21: error: unexpected token
            r0 = *(u16 *)(r1 + ?)
                               ^
    note: !srcloc = 210
    -bash-4.2$

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 329849

6 years ago[x86] wbnoinvd intrinsic
Gabor Buella [Wed, 11 Apr 2018 20:09:09 +0000 (20:09 +0000)]
[x86] wbnoinvd intrinsic

The WBNOINVD instruction writes back all modified
cache lines in the processor’s internal cache to main memory
but does not invalidate (flush) the internal caches.

Reviewers: craig.topper, zvi, ashlykov

Reviewed By: craig.topper

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

llvm-svn: 329848

6 years ago[X86] Describe wbnoinvd instruction
Gabor Buella [Wed, 11 Apr 2018 20:01:57 +0000 (20:01 +0000)]
[X86] Describe wbnoinvd instruction

Similar to the wbinvd instruction, except this
one does not invalidate caches. Ring 0 only.
The encoding matches a wbinvd instruction with
an F3 prefix.

Reviewers: craig.topper, zvi, ashlykov

Reviewed By: craig.topper

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

llvm-svn: 329847

6 years agoRemove references to old SymbolBody class
Sam Clegg [Wed, 11 Apr 2018 19:52:53 +0000 (19:52 +0000)]
Remove references to old SymbolBody class

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

llvm-svn: 329846

6 years ago[DSE] Add tests for atomic memory intrinsics (NFC)
Daniel Neilson [Wed, 11 Apr 2018 19:46:02 +0000 (19:46 +0000)]
[DSE] Add tests for atomic memory intrinsics (NFC)

Summary:
These tests show that DSE currently does nothing with the atomic memory
intrinsics. Future work will teach DSE how to simplify these.

llvm-svn: 329845

6 years agoFix a thinko in CommandObjectMemoryRegion.
Jim Ingham [Wed, 11 Apr 2018 19:27:03 +0000 (19:27 +0000)]
Fix a thinko in CommandObjectMemoryRegion.

Don't try to read the first argument till you've checked
that there is one.

llvm-svn: 329844

6 years ago[OPENMP] Code cleanup, NFC.
Alexey Bataev [Wed, 11 Apr 2018 19:21:00 +0000 (19:21 +0000)]
[OPENMP] Code cleanup, NFC.

llvm-svn: 329843

6 years ago[sanitizer] Correct name length computation for some Fuchsia vmos
Kostya Kortchinsky [Wed, 11 Apr 2018 18:55:26 +0000 (18:55 +0000)]
[sanitizer] Correct name length computation for some Fuchsia vmos

Summary:
This was missed during the review of D38595, but the vmo name size computation
should use internal_strlen, not sizeof, otherwise we end up with 7 character
names.

Reviewers: mcgrathr, flowerhack

Reviewed By: mcgrathr

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 329842

6 years agoRename to match an LLVM change
David Blaikie [Wed, 11 Apr 2018 18:49:41 +0000 (18:49 +0000)]
Rename to match an LLVM change

llvm-svn: 329841

6 years agoRename *CommandFlags.def to *CommandFlags.inc
David Blaikie [Wed, 11 Apr 2018 18:49:37 +0000 (18:49 +0000)]
Rename *CommandFlags.def to *CommandFlags.inc

These aren't the .def style files used in LLVM that require a macro
defined before their inclusion - they're just basic non-modular includes
to stamp out command line flag variables.

llvm-svn: 329840

6 years ago[DSE] Regenerate tests with update_test_checks.py (NFC)
Daniel Neilson [Wed, 11 Apr 2018 18:43:10 +0000 (18:43 +0000)]
[DSE] Regenerate tests with update_test_checks.py (NFC)

Summary:
In preparation for a future commit, this regenerates the test checks for
test/Transforms/DeadStoreElimination/OverwriteStoreBegin.ll
test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll

llvm-svn: 329839

6 years agoCodeGen: Don't try to canonicalize Unix-style paths in CodeView debug info.
Peter Collingbourne [Wed, 11 Apr 2018 18:24:03 +0000 (18:24 +0000)]
CodeGen: Don't try to canonicalize Unix-style paths in CodeView debug info.

Most importantly, we should not replace slashes with backslashes
because that would invalidate the path.

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

llvm-svn: 329838

6 years ago[X86][Atom] Convert Atom scheduler model to SchedRW (PR32431)
Simon Pilgrim [Wed, 11 Apr 2018 18:23:01 +0000 (18:23 +0000)]
[X86][Atom] Convert Atom scheduler model to SchedRW (PR32431)

Atom is the only x86 target that still uses schedule itineraries, if we can remove this then we can begin the work on removing x86 itineraries. I've also found that it will help with PR36550.

I've focussed on matching the existing model as closely as possible (relying on the schedule tests), PR36895 indicated a lot of these were incorrect but we can just as easily fix these after this patch as before. Hopefully we can get llvm-exegesis to help here,

There are a few instructions that rely on itinerary scheduling (mainly push/pop/return) of multiple resource stages, but I don't think any of these are show stoppers.

There are also a few codegen changes that seem related to the post-ra scheduler acting a little differently, I haven't tracked these down but they don't seem critical.

NOTE: I don't have access to any Atom hardware, so this hasn't been tested in the wild.

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

llvm-svn: 329837

6 years ago[CodeGen] Handle __func__ inside __finally
Shoaib Meenai [Wed, 11 Apr 2018 18:17:35 +0000 (18:17 +0000)]
[CodeGen] Handle __func__ inside __finally

When we enter a __finally block, the CGF's CurCodeDecl will be null
(because CodeGenFunction::StartFunction is given an empty GlobalDecl for
a __finally block), and so the dyn_cast here will result in an assertion
failure. Change it to dyn_cast_or_null to handle this case.

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

llvm-svn: 329836

6 years ago[llvm-mca] Let the Scheduler notify dispatch stall events caused by the lack of sched...
Andrea Di Biagio [Wed, 11 Apr 2018 18:05:23 +0000 (18:05 +0000)]
[llvm-mca] Let the Scheduler notify dispatch stall events caused by the lack of scheduling resources.

This patch moves part of the logic that notifies dispatch stall events from the
DispatchUnit to the Scheduler.

The main goal of this patch is to remove (yet another) dependency between the
DispatchUnit and the Scheduler. Before this patch, the DispatchUnit had to know
about `Scheduler::Event` and how to classify stalls due to the lack of scheduling
resources. This patch removes that knowledge and simplifies the logic in
DispatchUnit::checkScheduler.

This is another change done in preparation for the work to fix PR36663.

No functional change intended.

llvm-svn: 329835

6 years ago[X86] Generalize X86PadShortFunction to work with TargetSchedModel
Simon Pilgrim [Wed, 11 Apr 2018 18:05:17 +0000 (18:05 +0000)]
[X86] Generalize X86PadShortFunction to work with TargetSchedModel

Pre-commit for D45486, don't rely on itinerary scheduler model to determine latencies for padding, use the generic TargetSchedModel::computeInstrLatency call.

Also, replace hard coded (atom specific) 2*uop creation per padding cycle with a version based on the scheduler model's issue width.

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

llvm-svn: 329834