platform/upstream/llvm.git
5 years ago[MCA] Always check if scheduler resources are unavailable when reporting dispatch...
Andrea Di Biagio [Tue, 26 Feb 2019 14:19:00 +0000 (14:19 +0000)]
[MCA] Always check if scheduler resources are unavailable when reporting dispatch stalls.

Dispatch stall cycles may be associated to multiple dispatch stall events.
Before this patch, each stall cycle was associated with a single stall event.
This patch also improves a couple of code comments, and adds a helper method to
query the Scheduler for dispatch stalls.

llvm-svn: 354877

5 years ago[yaml2obj][obj2yaml] - Add support for the architecture specific dynamic tags.
George Rimar [Tue, 26 Feb 2019 14:14:49 +0000 (14:14 +0000)]
[yaml2obj][obj2yaml] - Add support for the architecture specific dynamic tags.

This allows tools to parse/dump the architecture specific tags
like DT_MIPS_*, DT_PPC64_* and DT_HEXAGON_*

Also fixes a bug in DynamicTags.def which was revealed in this patch.

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

llvm-svn: 354876

5 years agorevert r354873 as this breaks lldb builds.
Pierre Gousseau [Tue, 26 Feb 2019 13:50:29 +0000 (13:50 +0000)]
revert r354873 as this breaks lldb builds.

llvm-svn: 354875

5 years ago[Sanitizer] Add interceptor for pthread_sigmask
Pavel Labath [Tue, 26 Feb 2019 13:38:23 +0000 (13:38 +0000)]
[Sanitizer] Add interceptor for pthread_sigmask

Summary:
pthread_sigmask is just like sigprocmask, except that its behavior in
multithreaded programs is explicitly specified. Sanitizers were lacking
a common interceptor for pthread_sigmask (although some specific
sanitizers defined custom version), which lead to false positives
(at least in msan) when using this function.

The interceptor implementation, and its test are based on the equivalent
code for sigprocmask.

Reviewers: eugenis, vitalybuka

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

Tags: #llvm, #sanitizers

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

llvm-svn: 354874

5 years ago[Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer...
Pierre Gousseau [Tue, 26 Feb 2019 13:30:14 +0000 (13:30 +0000)]
[Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer checks, NFC.

enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks.
This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare".

Fixes: https://llvm.org/PR39425

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

llvm-svn: 354873

5 years ago[AArch64] Add arithmetic zext bswap tests.
Simon Pilgrim [Tue, 26 Feb 2019 13:22:35 +0000 (13:22 +0000)]
[AArch64] Add arithmetic zext bswap tests.

As requested on D58017.

llvm-svn: 354872

5 years ago[llvm-objdump] Add `Version Definitions` dumper
Xing GUO [Tue, 26 Feb 2019 13:06:16 +0000 (13:06 +0000)]
[llvm-objdump] Add `Version Definitions` dumper

Summary: `llvm-objdump` needs a `Version Definitions` dumper.

Reviewers: grimar, jhenderson

Reviewed By: grimar, jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 354871

5 years ago[llvm-objdump] Implement -Mreg-names-raw/-std options.
Igor Kudrin [Tue, 26 Feb 2019 12:15:14 +0000 (12:15 +0000)]
[llvm-objdump] Implement -Mreg-names-raw/-std options.

The --disassembler-options, or -M, are used to customize
the disassembler and affect its output.

The two implemented options allow selecting register names on ARM:
* With -Mreg-names-raw, the disassembler uses rNN for all registers.
* With -Mreg-names-std it prints sp, lr and pc for r13, r14 and r15,
  which is the default behavior of llvm-objdump.

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

llvm-svn: 354870

5 years ago[AArch64] Add 'free' zext bswap tests.
Simon Pilgrim [Tue, 26 Feb 2019 12:04:37 +0000 (12:04 +0000)]
[AArch64] Add 'free' zext bswap tests.

As requested on D58017.

llvm-svn: 354869

5 years ago[ARM] Add Cortex-M35P
Luke Cheeseman [Tue, 26 Feb 2019 12:02:12 +0000 (12:02 +0000)]
[ARM] Add Cortex-M35P

- Add LLVM backend support for Cortex-M35P
- Documentation can be found at
  https://developer.arm.com/products/processors/cortex-m/cortex-m35p

Differentail Revision: https://reviews.llvm.org/D57763

llvm-svn: 354868

5 years ago[LegalizeDAG] Use APInt::getSplat helper to create bitreverse masks. NFCI.
Simon Pilgrim [Tue, 26 Feb 2019 11:44:23 +0000 (11:44 +0000)]
[LegalizeDAG] Use APInt::getSplat helper to create bitreverse masks. NFCI.

llvm-svn: 354867

5 years ago[LegalizeDAG] Expand SADDO/SSUBO using SADDSAT/SSUBSAT (PR37763)
Simon Pilgrim [Tue, 26 Feb 2019 11:27:53 +0000 (11:27 +0000)]
[LegalizeDAG] Expand SADDO/SSUBO using SADDSAT/SSUBSAT (PR37763)

If SADDSAT/SSUBSAT are legal, then we can expand SADDO/SSUBO by performing a ADD/SUB and a SADDO/SSUBO and then compare the results.

I looked at doing this for UADDO/USUBO as well but as we don't have to do as many range comparisons I didn't see any/much benefit.

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

llvm-svn: 354866

5 years ago[clangd] Update docs to mention YCM integration and new LSP features
Kadir Cetinkaya [Tue, 26 Feb 2019 11:08:04 +0000 (11:08 +0000)]
[clangd] Update docs to mention YCM integration and new LSP features

Reviewers: gribozavr

Reviewed By: gribozavr

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

Tags: #clang

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

llvm-svn: 354865

5 years ago[CodeComplete] Propagate preferred type for function arguments in more cases
Ilya Biryukov [Tue, 26 Feb 2019 11:01:50 +0000 (11:01 +0000)]
[CodeComplete] Propagate preferred type for function arguments in more cases

Summary:
See the added test for some new cases.
This change also removes special code completion calls inside the
ParseExpressionList function now that we properly propagate expected
type to the function responsible for parsing elements of the expression list
(ParseAssignmentExpression).

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: xbolva00, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354864

5 years ago[AMDGPU] Regenerate bswap/bitreverse tests.
Simon Pilgrim [Tue, 26 Feb 2019 11:01:08 +0000 (11:01 +0000)]
[AMDGPU] Regenerate bswap/bitreverse tests.

Make codegen changes more obvious in D58017

llvm-svn: 354863

5 years ago[llvm-exegesis] Teach llvm-exegesis to handle instructions with multiple tied variables.
Clement Courbet [Tue, 26 Feb 2019 10:54:45 +0000 (10:54 +0000)]
[llvm-exegesis] Teach llvm-exegesis to handle instructions with multiple tied variables.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 354862

5 years agoCodeGen: Explicitly initialize structure padding in the -ftrivial-auto-var-init mode
Alexander Potapenko [Tue, 26 Feb 2019 10:46:21 +0000 (10:46 +0000)]
CodeGen: Explicitly initialize structure padding in the -ftrivial-auto-var-init mode

When generating initializers for local structures in the
-ftrivial-auto-var-init mode, explicitly wipe the padding bytes with
either 0x00 or 0xAA.

This will allow us to automatically handle the padding when splitting
the initialization stores (see https://reviews.llvm.org/D57898).

Reviewed at https://reviews.llvm.org/D58188

llvm-svn: 354861

5 years ago[llvm-objcopy] Add --set-start, --change-start and --adjust-start
Eugene Leviant [Tue, 26 Feb 2019 09:24:22 +0000 (09:24 +0000)]
[llvm-objcopy] Add --set-start, --change-start and --adjust-start

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

llvm-svn: 354854

5 years ago[compiler-rt] disable asan bcmp tests on android.
Clement Courbet [Tue, 26 Feb 2019 09:16:51 +0000 (09:16 +0000)]
[compiler-rt] disable asan bcmp tests on android.

Android does not have bcmp.

sanitizer-x86_64-linux-android: run instrumented asan tests [arm/aosp_marlin-userdebug/PI] -  stdio

llvm-svn: 354853

5 years ago[compiler-rt] Fix test broken by r354851.
Clement Courbet [Tue, 26 Feb 2019 08:17:49 +0000 (08:17 +0000)]
[compiler-rt] Fix test broken by r354851.

error: CHECK: expected string not found in input
// CHECK: Uninitialized bytes in __interceptor_memcmp at offset 3

llvm-svn: 354852

5 years ago[compiler-rt] Intercept the bcmp() function.
Clement Courbet [Tue, 26 Feb 2019 07:43:01 +0000 (07:43 +0000)]
[compiler-rt] Intercept the bcmp() function.

Summary:
I have not introduced a separate hook for `bcmp()` as I don't think there
should be any reason for a sanitizer to treat it differently from `memcmp()`.

This is only enabled when building on POSIX with GNU extensions.

Context: this is to avoid losing coverage when emitting `bcmp() == 0` instead
of `memcmp() == 0` in llvm, see https://reviews.llvm.org/D56593.

Reviewers: mgorny, krytarowski, vitalybuka, dvyukov

Subscribers: kubamracek, dberris, delcypher, jdoerfert, #sanitizers, llvm-commits, jyknight

Tags: #llvm, #sanitizers

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

llvm-svn: 354851

5 years ago[ThinLTO] Use defined node and edge order when dumping DOT file
Eugene Leviant [Tue, 26 Feb 2019 07:38:21 +0000 (07:38 +0000)]
[ThinLTO] Use defined node and edge order when dumping DOT file

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

llvm-svn: 354850

5 years agoRevert "Improve "llvm-nm -f sysv" output for Elf files"
Vlad Tsyrklevich [Tue, 26 Feb 2019 07:04:56 +0000 (07:04 +0000)]
Revert "Improve "llvm-nm -f sysv" output for Elf files"

This reverts commit r354833, it was causing ASan test failures on
sanitizer-x86_64-linux-fast.

llvm-svn: 354849

5 years ago[libc++] Rename _NOALIAS macro to _LIBCPP_NOALIAS
Louis Dionne [Tue, 26 Feb 2019 06:34:42 +0000 (06:34 +0000)]
[libc++] Rename _NOALIAS macro to _LIBCPP_NOALIAS

Summary:
For consistency, libc++ macros always start with _LIBCPP. This should
have no functionality change.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 354848

5 years ago[NFC] Add to contributor list.
Chen Zheng [Tue, 26 Feb 2019 05:46:45 +0000 (05:46 +0000)]
[NFC] Add to contributor list.

llvm-svn: 354847

5 years ago[WebAssembly] Properly align fp128 arguments in outgoing varargs arguments
Dan Gohman [Tue, 26 Feb 2019 05:20:19 +0000 (05:20 +0000)]
[WebAssembly] Properly align fp128 arguments in outgoing varargs arguments

For outgoing varargs arguments, it's necessary to check the OrigAlign field
of the corresponding OutputArg entry to determine argument alignment, rather
than just computing an alignment from the argument value type. This is
because types like fp128 are split into multiple argument values, with
narrower types that don't reflect the ABI alignment of the full fp128.

This fixes the printf("printfL: %4.*Lf\n", 2, lval); testcase.

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

llvm-svn: 354846

5 years ago[ARM] Be super conservative about atomics
Philip Reames [Tue, 26 Feb 2019 04:30:33 +0000 (04:30 +0000)]
[ARM] Be super conservative about atomics

As requested during review of D57601 <https://reviews.llvm.org/D57601> https://reviews.llvm.org/D57601, be equally conservative for atomic MMOs as for volatile MMOs in all in tree backends. At the moment, all atomic MMOs are also volatile, but I'm about to change that.

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

Note: D58498 landed in several pieces as individual backends were approved.  This is the last chunk.
llvm-svn: 354845

5 years ago[WebAssembly] Fix a bug deleting instruction in a ranged for loop
Heejin Ahn [Tue, 26 Feb 2019 04:08:49 +0000 (04:08 +0000)]
[WebAssembly] Fix a bug deleting instruction in a ranged for loop

Summary: We shouldn't delete elements while iterating a ranged for loop.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 354844

5 years ago[CGDebugInfo] Set NonTrivial DIFlag to a c++ record if it's not trivial
Aaron Smith [Tue, 26 Feb 2019 03:49:05 +0000 (03:49 +0000)]
[CGDebugInfo] Set NonTrivial DIFlag to a c++ record if it's not trivial

This goes with https://reviews.llvm.org/D44406

llvm-svn: 354843

5 years ago[WebAssembly] Improve readability of EH tests
Heejin Ahn [Tue, 26 Feb 2019 03:29:59 +0000 (03:29 +0000)]
[WebAssembly] Improve readability of EH tests

Summary:
- Indent check lines to easily figure out try-catch-end structure
- Add the original C++ code the tests were genereated from
- Add a few more lines to make the structure more readable
- Rename a couple function / structures
- Add label and branch annotations to cfg-stackify-eh.ll
- Temporarily delete check lines for `test1` in `cfg-stackify-eh.ll`
  because it will be updated in a later CL soon and there's no point of
  making it look better here

Reviewers: dschuff

Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits

Tags: #llvm

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

llvm-svn: 354842

5 years ago[CodeView] Emit HasConstructorOrDestructor class option for non-trivial constructors
Aaron Smith [Tue, 26 Feb 2019 03:23:56 +0000 (03:23 +0000)]
[CodeView] Emit HasConstructorOrDestructor class option for non-trivial constructors

Reviewers: zturner, rnk, llvm-commits, aleksandr.urakov

Reviewed By: zturner, rnk

Subscribers: jdoerfert, majnemer, asmith

Tags: #llvm

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

llvm-svn: 354841

5 years ago[llvm-cov] Fix llvm-cov on Windows and un-XFAIL test
Reid Kleckner [Tue, 26 Feb 2019 02:30:00 +0000 (02:30 +0000)]
[llvm-cov] Fix llvm-cov on Windows and un-XFAIL test

Summary:
The llvm-cov tool needs to be able to find coverage names in the
executable, so the .lprfn and .lcovmap sections cannot be merged into
.rdata.

Also, the linker merges .lprfn$M into .lprfn, so llvm-cov needs to
handle that when looking up sections. It has to support running on both
relocatable object files and linked PE files.

Lastly, when loading .lprfn from a PE file, llvm-cov needs to skip the
leading zero byte added by the profile runtime.

Reviewers: vsk

Subscribers: hiraditya, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 354840

5 years agoRevert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."
Reid Kleckner [Tue, 26 Feb 2019 02:22:22 +0000 (02:22 +0000)]
Revert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."

Test does not pass on Windows

llvm-svn: 354839

5 years ago[MS] Fix for Bug 8446, template instantiation without a 'typename' keyword
Reid Kleckner [Tue, 26 Feb 2019 02:22:17 +0000 (02:22 +0000)]
[MS] Fix for Bug 8446, template instantiation without a 'typename' keyword

Patch by Zahira Ammarguellat!

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

llvm-svn: 354838

5 years ago[X86] Fix bug in x86_intrcc with arg copy elision
Reid Kleckner [Tue, 26 Feb 2019 02:11:25 +0000 (02:11 +0000)]
[X86] Fix bug in x86_intrcc with arg copy elision

Summary:
Use a custom calling convention handler for interrupts instead of fixing
up the locations in LowerMemArgument. This way, the offsets are correct
when constructed and we don't need to account for them in as many
places.

Depends on D56883

Replaces D56275

Reviewers: craig.topper, phil-opp

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 354837

5 years ago[winasan] Unpoison stack memory when threads exit (redux)
David Major [Tue, 26 Feb 2019 01:35:48 +0000 (01:35 +0000)]
[winasan] Unpoison stack memory when threads exit (redux)

This is a second attempt at r342652 using a TLS callback instead of an
interceptor.

In long-running builds we've seen some ASan complaints during thread creation
that we suspect are due to leftover poisoning from previous threads whose
stacks occupied that memory. This patch adds a callback that unpoisons the
stack memory when a thread exits.

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

llvm-svn: 354836

5 years ago[sanitizer] Re-disable a few tests on android.
Evgeniy Stepanov [Tue, 26 Feb 2019 00:22:22 +0000 (00:22 +0000)]
[sanitizer] Re-disable a few tests on android.

Tests were accidentally enabled r354829.

llvm-svn: 354834

5 years agoImprove "llvm-nm -f sysv" output for Elf files
Sunil Srivastava [Tue, 26 Feb 2019 00:19:39 +0000 (00:19 +0000)]
Improve "llvm-nm -f sysv" output for Elf files

Specifically, compute and Print Type and Section columns.

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

llvm-svn: 354833

5 years ago[ASTImporter] Add support for importing ChooseExpr AST nodes.
Tom Roeder [Mon, 25 Feb 2019 23:24:58 +0000 (23:24 +0000)]
[ASTImporter] Add support for importing ChooseExpr AST nodes.

Summary:
This allows ASTs to be merged when they contain ChooseExpr (the GNU
__builtin_choose_expr construction). This is needed, for example, for
cross-CTU analysis of C code that makes use of __builtin_choose_expr.

The node is already supported in the AST, but it didn't have a matcher
in ASTMatchers. So, this change adds the matcher and adds support to
ASTImporter.

Reviewers: shafik, a_sidorin, martong, aaron.ballman

Subscribers: aaron.ballman, rnkovacs, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354832

5 years ago[NFC] Reorder some mis-ordered tests
JF Bastien [Mon, 25 Feb 2019 23:09:34 +0000 (23:09 +0000)]
[NFC] Reorder some mis-ordered tests

I somehow had misaligned some of the tests when I originally wrote this. Re-order them properly.

llvm-svn: 354831

5 years ago[AMDGPU] Added target to mir test. NFC.
Stanislav Mekhanoshin [Mon, 25 Feb 2019 22:59:55 +0000 (22:59 +0000)]
[AMDGPU] Added target to mir test. NFC.

Test was used without -mcpu, although tested instructions
not available on all ASICs.

llvm-svn: 354830

5 years ago[sanitizer] Remove "-android" from test_arch.
Evgeniy Stepanov [Mon, 25 Feb 2019 22:32:30 +0000 (22:32 +0000)]
[sanitizer] Remove "-android" from test_arch.

Summary:
ASan and Scudo tests are adding "-android" to test arch.
There are no tests that depend on it as far as I can see.
If necessary, do this instead:
  REQUIRES: aarch64-target-arch && android

Reviewers: pcc, vitalybuka

Subscribers: srhines, kubamracek, mgorny, javed.absar, kristof.beyls, cryptoad, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 354829

5 years agoRegBankSelect: Handle slightly more complex value mappings
Matt Arsenault [Mon, 25 Feb 2019 22:24:13 +0000 (22:24 +0000)]
RegBankSelect: Handle slightly more complex value mappings

Try to use concat_vectors. Also remove unnecessary assert on
pointers. Fixes asserting for <4 x s16> operations and 64-bit pointers
for AMDGPU.

llvm-svn: 354828

5 years agoReapply "Make static counters in ASTContext non-static." with fixes.
Alexander Kornienko [Mon, 25 Feb 2019 22:22:09 +0000 (22:22 +0000)]
Reapply "Make static counters in ASTContext non-static." with fixes.

This reverts commit e50038e4dc53caee1acc811362ac0b15e00ef5eb.

llvm-svn: 354827

5 years ago[CodeGenObjC] Fix a nullptr dyn_cast
Erik Pilkington [Mon, 25 Feb 2019 21:35:14 +0000 (21:35 +0000)]
[CodeGenObjC] Fix a nullptr dyn_cast

ObjCMessageExpr::getInstanceReceiver returns nullptr if the receiver
is 'super'. Make this check more strict, since we don't care about
messages to super here.

rdar://48247290

llvm-svn: 354826

5 years agoAMDGPU/GlobalISel: Fix bit ops for non-power-of-2 sizes
Matt Arsenault [Mon, 25 Feb 2019 21:32:48 +0000 (21:32 +0000)]
AMDGPU/GlobalISel: Fix bit ops for non-power-of-2 sizes

llvm-svn: 354825

5 years ago[libclang] Expose warn_unused and warn_unused_result attributes.
Emilio Cobos Alvarez [Mon, 25 Feb 2019 21:24:52 +0000 (21:24 +0000)]
[libclang] Expose warn_unused and warn_unused_result attributes.

This is helpful to properly detect them, and fixing issues like
https://github.com/rust-lang/rust-bindgen/issues/1518.

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

llvm-svn: 354824

5 years ago[libclang] Fix a trivial error introduced in D57946.
Emilio Cobos Alvarez [Mon, 25 Feb 2019 21:15:34 +0000 (21:15 +0000)]
[libclang] Fix a trivial error introduced in D57946.

The value for CXCursor_ConvergentAttr is not 420. I'm not really sure how easy
it is to test this, and I'm not familiar with the python bindings, just noticed
the error while looking at D57946 to write D58570.

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

llvm-svn: 354823

5 years agoRevert "[Support] Make raw_string_ostream unbuffered"
Roman Lebedev [Mon, 25 Feb 2019 21:11:19 +0000 (21:11 +0000)]
Revert "[Support] Make raw_string_ostream unbuffered"

Shame on me, did not run all the tests, bots are angry.

This reverts commit r354819.

llvm-svn: 354822

5 years ago[LangRef] *.overflow intrinsics now support vectors
Simon Pilgrim [Mon, 25 Feb 2019 21:05:09 +0000 (21:05 +0000)]
[LangRef] *.overflow intrinsics now support vectors

We have all the necessary legalization, expansion and unrolling support required for the *.overflow intrinsics with vector types, so update the docs to make that clear.

Note: vectorization is not in place yet (the non-homogenous return types aren't well supported) so we still must explicitly use the vectors intrinsics and not reply on slp/loop.

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

llvm-svn: 354821

5 years ago[Support] Make raw_string_ostream unbuffered
Roman Lebedev [Mon, 25 Feb 2019 20:51:49 +0000 (20:51 +0000)]
[Support] Make raw_string_ostream unbuffered

Summary:
In D58580 i have noted that `llvm::to_string()` is a memory hog.
It uses `raw_string_ostream`, and since it was buffered,
every `raw_string_ostream` had a cost of `BUFSIZ` bytes
(which is `8192` at least here). So every `llvm::to_string()`
call, even to just print an `int`, costed `8192` bytes.

In D58580, getting rid of that buffering //had// significant
performance and memory consumption improvements for `llvm-xray convert`.

Similarly, in D58580 @rnk pointed out that the `raw_svector_ostream`
is already unbuffered, and `write_unsigned_impl` and friends
do internal buffering. So it should be ok performance-wise to just
make the `raw_string_ostream` itself unbuffered.

Here, i don't have any perf measurements.
Another letdown is that i'm leaving a loose-end - not deleting the
`flush()` method. I  don't expect that cleanup to be anything more
than just fixing every new compiler error, but i'm presently unable
to do that. Will look into that later.

Reviewers: rnk, zturner

Reviewed By: rnk

Subscribers: kristina, jdoerfert, llvm-commits, rnk

Tags: #llvm

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

llvm-svn: 354819

5 years agoAMDGPU/GlobalISel: Clamp max implicit_def elements
Matt Arsenault [Mon, 25 Feb 2019 20:46:06 +0000 (20:46 +0000)]
AMDGPU/GlobalISel: Clamp max implicit_def elements

llvm-svn: 354818

5 years ago[OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.
Michael Kruse [Mon, 25 Feb 2019 20:34:15 +0000 (20:34 +0000)]
[OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.

This patch implements the parsing and sema support for the OpenMP
'from'-clause with potential user-defined mappers attached.
User-defined mappers are a new feature in OpenMP 5.0. A 'from'-clause
can have an explicit or implicit associated mapper, which instructs the
compiler to generate and use customized mapping functions. An example is
shown below:

    struct S { int len; int *d; };
    #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len])
    struct S ss;
    #pragma omp target update from(mapper(id): ss) // use the mapper with name 'id' to map ss from device

Contributed-by: Lingda Li <lildmh@gmail.com>
Differential Revision: https://reviews.llvm.org/D58638

llvm-svn: 354817

5 years agoRegisterScavenger: Allow fail without spill
Matt Arsenault [Mon, 25 Feb 2019 20:29:04 +0000 (20:29 +0000)]
RegisterScavenger: Allow fail without spill

AMDGPU wants to use this in some contexts where
the spilling is either impossible, or a worse alternative
to doing something else.

llvm-svn: 354816

5 years agoAMDGPU: Remove IntrReadMem from memtime/memrealtime intrinsics
Matt Arsenault [Mon, 25 Feb 2019 20:16:11 +0000 (20:16 +0000)]
AMDGPU: Remove IntrReadMem from memtime/memrealtime intrinsics

EarlyCSE with MemorySSA was able to use this to merge multiple calls
with no intervening store.

llvm-svn: 354814

5 years agoGlobalISel: Make legalizer/regbankselect clear NoPHIs property
Matt Arsenault [Mon, 25 Feb 2019 20:00:25 +0000 (20:00 +0000)]
GlobalISel: Make legalizer/regbankselect clear NoPHIs property

If no phi existed in the original MIR and these introduced one, the
verifier would fail.

llvm-svn: 354813

5 years agoRevert "Make static counters in ASTContext non-static."
Vlad Tsyrklevich [Mon, 25 Feb 2019 19:53:13 +0000 (19:53 +0000)]
Revert "Make static counters in ASTContext non-static."

This reverts commit r354795, I suspect it is causing test failures
on MSan sanitizer bots.

llvm-svn: 354812

5 years ago[X86] Improve detection of unneeded shift amount masking to also handle the case...
Craig Topper [Mon, 25 Feb 2019 19:42:47 +0000 (19:42 +0000)]
[X86] Improve detection of unneeded shift amount masking to also handle the case that the LHS has known zeroes in it

If the LHS has known zeros, the RHS immediate will have had bits removed. So call computeKnownBits to get the known zeroes so we can handle this case.

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

llvm-svn: 354811

5 years agoFix a sign compare warning breaking the -Werror build.
Andrea Di Biagio [Mon, 25 Feb 2019 19:33:58 +0000 (19:33 +0000)]
Fix a sign compare warning breaking the -Werror build.

The warning was introduced at r354793.

llvm-svn: 354810

5 years agoAMDGPU: Correct definitions for bitset instructions
Matt Arsenault [Mon, 25 Feb 2019 19:24:46 +0000 (19:24 +0000)]
AMDGPU: Correct definitions for bitset instructions

These really read and write the result register, so these need a tied
input.

llvm-svn: 354809

5 years ago[Mips] Fix missing masking in fast-isel of br (PR40325)
Nikita Popov [Mon, 25 Feb 2019 18:54:17 +0000 (18:54 +0000)]
[Mips] Fix missing masking in fast-isel of br (PR40325)

Fixes https://bugs.llvm.org/show_bug.cgi?id=40325 by zero extending
(and x, 1) the condition before branching on it.

To avoid regressing trivial cases, I'm combining emission of cmp+br
sequences for the single-use + same block case (similar to what we
do in x86). icmpbr1.ll still regresses due to the cross-bb usage
of the condition.

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

llvm-svn: 354808

5 years ago[AArch64][GlobalISel] Refactor selectBuildVector to use MachineIRBuilder. NFC.
Amara Emerson [Mon, 25 Feb 2019 18:52:54 +0000 (18:52 +0000)]
[AArch64][GlobalISel] Refactor selectBuildVector to use MachineIRBuilder. NFC.

This is a preparatory change as I want to use emitScalarToVector() elsewhere,
and in general we want to transition to MIRBuilder instead of using BuildMI
directly.

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

llvm-svn: 354807

5 years ago[analyzer] Fix infinite recursion in printing macros
Kristof Umann [Mon, 25 Feb 2019 18:49:42 +0000 (18:49 +0000)]
[analyzer] Fix infinite recursion in printing macros

#define f(y) x
#define x f(x)
int main() { x; }

This example results a compilation error since "x" in the first line was not
defined earlier. However, the macro expression printer goes to an infinite
recursion on this example.

Patch by Tibor Brunner!

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

llvm-svn: 354806

5 years agoLWG3101 - span's Container constructors need another constraint. Reviewed as https...
Marshall Clow [Mon, 25 Feb 2019 18:32:57 +0000 (18:32 +0000)]
LWG3101 - span's Container constructors need another constraint. Reviewed as https://reviews.llvm.org/D57058.

llvm-svn: 354805

5 years ago[lldb-mi] Return source line number in proper format
Tatyana Krasnukha [Mon, 25 Feb 2019 18:32:46 +0000 (18:32 +0000)]
[lldb-mi] Return source line number in proper format

Line number is a decimal number and is printed as such, however for some
reason it was prefixed with '0x', thus turning printed value invalid.

Patch by Anton Kolesov <Anton.Kolesov@synopsys.com>

llvm-svn: 354804

5 years ago[lldb-mi] Fix conversion warning for 64-bit build
Tatyana Krasnukha [Mon, 25 Feb 2019 18:23:44 +0000 (18:23 +0000)]
[lldb-mi] Fix conversion warning for 64-bit build

llvm-svn: 354803

5 years agoCommit LWG3144 - span does not have a const_pointer typedef. Reviewed as D57039.
Marshall Clow [Mon, 25 Feb 2019 17:58:03 +0000 (17:58 +0000)]
Commit LWG3144 - span does not have a const_pointer typedef. Reviewed as D57039.

llvm-svn: 354802

5 years agoFirst part of P1024: Usability Enhancements for std::span. Remove operator() for...
Marshall Clow [Mon, 25 Feb 2019 17:54:08 +0000 (17:54 +0000)]
First part of P1024: Usability Enhancements for std::span. Remove operator() for indexing, and add 'front' and 'back' calls.

llvm-svn: 354801

5 years ago[Lanai] Be super conservative about atomics
Philip Reames [Mon, 25 Feb 2019 17:36:10 +0000 (17:36 +0000)]
[Lanai] Be super conservative about atomics

As requested during review of D57601 <https://reviews.llvm.org/D57601>, be equally conservative for atomic MMOs as for volatile MMOs in all in tree backends. At the moment, all atomic MMOs are also volatile, but I'm about to change that.

Reviewed as part of https://reviews.llvm.org/D58490, with other backends still pending review.

llvm-svn: 354800

5 years ago[lldb-mi] Check raw pointers before passing them to std::string ctor/assignment
Tatyana Krasnukha [Mon, 25 Feb 2019 16:40:11 +0000 (16:40 +0000)]
[lldb-mi] Check raw pointers before passing them to std::string ctor/assignment

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

llvm-svn: 354798

5 years ago[SelectionDAG] Add demanded elts variants to isConstOrConstSplat helpers. NFCI.
Simon Pilgrim [Mon, 25 Feb 2019 16:31:58 +0000 (16:31 +0000)]
[SelectionDAG] Add demanded elts variants to isConstOrConstSplat helpers. NFCI.

These helpers extend the existing isConstOrConstSplat helper checks to support DemandedElts masks as well.

We already had a local version of this in SelectionDAG that computeKnownBits/ComputeNumSignBits made use of, but this adds the functionality directly to the BuildVectorSDNode node and extends isConstOrConstSplat etc. to use that.

This will allow us to reuse the functionality in SimplifyDemandedVectorElts/SimplifyDemandedBits.

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

llvm-svn: 354797

5 years agoUpdate status page with papers/issues adopted in Kona
Marshall Clow [Mon, 25 Feb 2019 16:12:00 +0000 (16:12 +0000)]
Update status page with papers/issues adopted in Kona

llvm-svn: 354796

5 years agoMake static counters in ASTContext non-static.
Alexander Kornienko [Mon, 25 Feb 2019 16:08:46 +0000 (16:08 +0000)]
Make static counters in ASTContext non-static.

Summary:
Fixes a data race and makes it possible to run clang-based tools in
multithreaded environment with TSan.

Reviewers: ilya-biryukov, riccibruno

Reviewed By: riccibruno

Subscribers: riccibruno, jfb, cfe-commits

Tags: #clang

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

llvm-svn: 354795

5 years ago[DAGCombine] Add undef shuffle elt support to partitionShuffleOfConcats
Simon Pilgrim [Mon, 25 Feb 2019 16:02:01 +0000 (16:02 +0000)]
[DAGCombine] Add undef shuffle elt support to partitionShuffleOfConcats

Support undef shuffle mask indices in the shuffle(concat_vectors, concat_vectors) -> concat_vectors fold

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

llvm-svn: 354793

5 years ago[clangd] Drop documentation in static index if symbols are not indexed for completion.
Haojian Wu [Mon, 25 Feb 2019 16:00:00 +0000 (16:00 +0000)]
[clangd] Drop documentation in static index if symbols are not indexed for completion.

Summary:
This is a further optimization of r350803, we drop docs in static index for
symbols not being indexed for completion, while keeping the docs in dynamic
index (we rely on dynamic index to get docs for class members).

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

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

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

llvm-svn: 354792

5 years ago[ARM] Add some more missing T1 opcodes for the peephole optimisier
David Green [Mon, 25 Feb 2019 15:50:54 +0000 (15:50 +0000)]
[ARM] Add some more missing T1 opcodes for the peephole optimisier

This adds a few extra Thumb1 opcodes to improve the peephole opimisers
ability to remove redundant cmp instructions. tADC and tSBC require
a small fixup to prevent MOVS being moved past the instruction, giving
the wrong flags.

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

llvm-svn: 354791

5 years ago[Vectorizer] Add vectorization support for fixed smul/umul intrinsics
Simon Pilgrim [Mon, 25 Feb 2019 15:42:02 +0000 (15:42 +0000)]
[Vectorizer] Add vectorization support for fixed smul/umul intrinsics

This requires a couple of tweaks to existing vectorization functions as they were assuming that only the second call argument (ctlz/cttz/powi) could ever be the 'always scalar' argument, but for smul.fix + umul.fix its the third argument.

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

llvm-svn: 354790

5 years ago[AArch64] Add support for Cortex-A76 and Cortex-A76AE
Luke Cheeseman [Mon, 25 Feb 2019 15:11:31 +0000 (15:11 +0000)]
[AArch64] Add support for Cortex-A76 and Cortex-A76AE

- Add LLVM backend support for Cortex-A76 and Cortex-A76AE
- Documentation can be found at
  https://developer.arm.com/products/processors/cortex-a/cortex-a76

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

llvm-svn: 354789

5 years ago[AArch64] Add support for Cortex-A76 and Cortex-A76AE
Luke Cheeseman [Mon, 25 Feb 2019 15:08:27 +0000 (15:08 +0000)]
[AArch64] Add support for Cortex-A76 and Cortex-A76AE

- Add LLVM backend support for Cortex-A76 and Cortex-A76AE
- Documentation can be found at
  https://developer.arm.com/products/processors/cortex-a/cortex-a76

llvm-svn: 354788

5 years ago[llvm-objcopy] Add --add-symbol
Eugene Leviant [Mon, 25 Feb 2019 14:12:41 +0000 (14:12 +0000)]
[llvm-objcopy] Add --add-symbol

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

llvm-svn: 354787

5 years agoMoved clangd docs to a separate directory in preparation to restructure them into...
Dmitri Gribenko [Mon, 25 Feb 2019 13:43:48 +0000 (13:43 +0000)]
Moved clangd docs to a separate directory in preparation to restructure them into multiple files

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354786

5 years agoFixed typos in tests: s/CHEKC/CHECK/
Dmitri Gribenko [Mon, 25 Feb 2019 13:41:59 +0000 (13:41 +0000)]
Fixed typos in tests: s/CHEKC/CHECK/

Reviewers: ilya-biryukov

Subscribers: nemanjai, javed.absar, jsji, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 354785

5 years ago[TTI] Add generic cost model for smul/umul overflow intrinsics
Simon Pilgrim [Mon, 25 Feb 2019 13:30:23 +0000 (13:30 +0000)]
[TTI] Add generic cost model for smul/umul overflow intrinsics

Based off smul/umul fixed costs and the implementation in TargetLowering::expandMULO.

llvm-svn: 354784

5 years ago[SLPVectorizer][X86] Add fixed smul/umul tests
Simon Pilgrim [Mon, 25 Feb 2019 13:26:30 +0000 (13:26 +0000)]
[SLPVectorizer][X86] Add fixed smul/umul tests

Baseline tests - fixed mul intrinsics aren't flagged as vectorizable yet

llvm-svn: 354783

5 years ago[llvm-objdump] Add `Version References` dumper
Xing GUO [Mon, 25 Feb 2019 13:13:19 +0000 (13:13 +0000)]
[llvm-objdump] Add `Version References` dumper

Summary: Add symbol version dumper for [#30241](https://bugs.llvm.org/show_bug.cgi?id=30241)

Reviewers: jhenderson, MaskRay, kristina, emaste, grimar

Reviewed By: jhenderson, grimar

Subscribers: grimar, rupprecht, jakehehrlich, llvm-commits

Tags: #llvm

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

llvm-svn: 354782

5 years agoFixed typos in tests: s/CEHCK/CHECK/
Dmitri Gribenko [Mon, 25 Feb 2019 13:12:33 +0000 (13:12 +0000)]
Fixed typos in tests: s/CEHCK/CHECK/

Reviewers: ilya-biryukov

Subscribers: sanjoy, sdardis, javed.absar, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

llvm-svn: 354781

5 years ago[clang-tidy] misc-string-integer-assignment: ignore toupper/tolower
Clement Courbet [Mon, 25 Feb 2019 13:09:02 +0000 (13:09 +0000)]
[clang-tidy] misc-string-integer-assignment: ignore toupper/tolower

Summary: Tis represents ~20% of false positives. See PR27723.

Reviewers: xazax.hun, alexfh

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

llvm-svn: 354780

5 years agoUpdated the documentation build instructions for the current CMake build system
Dmitri Gribenko [Mon, 25 Feb 2019 13:03:44 +0000 (13:03 +0000)]
Updated the documentation build instructions for the current CMake build system

Reviewers: ilya-biryukov

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 354779

5 years agoFixed grammar in index.rst
Dmitri Gribenko [Mon, 25 Feb 2019 12:49:27 +0000 (12:49 +0000)]
Fixed grammar in index.rst

Subscribers: arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 354778

5 years agoRemoved an unhelpful comment in index.rst
Dmitri Gribenko [Mon, 25 Feb 2019 12:48:52 +0000 (12:48 +0000)]
Removed an unhelpful comment in index.rst

Reviewers: ilya-biryukov

Subscribers: arphaman, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354777

5 years agoTest commit (remove a blank space)
Ganesh Gopalasubramanian [Mon, 25 Feb 2019 12:27:49 +0000 (12:27 +0000)]
Test commit (remove a blank space)

Change-Id: I69175571d3b1defeb85e96fdd87db5c3ccadcb63
llvm-svn: 354775

5 years ago[TTI] Add generic cost model for fixed point smul/umul
Simon Pilgrim [Mon, 25 Feb 2019 11:59:23 +0000 (11:59 +0000)]
[TTI] Add generic cost model for fixed point smul/umul

Based on an IR equivalent of target lowering's generic expansion - target specific costs will typically be lower (IR doesn't have a good mull/mulh equivalent) but we need a baseline.

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

llvm-svn: 354774

5 years ago[SYCL] Add clang front-end option to enable SYCL device compilation flow.
Alexey Bader [Mon, 25 Feb 2019 11:48:48 +0000 (11:48 +0000)]
[SYCL] Add clang front-end option to enable SYCL device compilation flow.

Patch by Mariya Podchishchaeva <mariya.podchishchaeva@intel.com>

llvm-svn: 354773

5 years ago[mips] Reduce number of tools invocations in the test. NFC
Simon Atanasyan [Mon, 25 Feb 2019 11:30:33 +0000 (11:30 +0000)]
[mips] Reduce number of tools invocations in the test. NFC

llvm-svn: 354772

5 years ago[X86] Merge ISD::ADD/SUB nodes into X86ISD::ADD/SUB equivalents (PR40483)
Simon Pilgrim [Mon, 25 Feb 2019 11:19:37 +0000 (11:19 +0000)]
[X86] Merge ISD::ADD/SUB nodes into X86ISD::ADD/SUB equivalents (PR40483)

Avoid ADD/SUB instruction duplication by reusing the X86ISD::ADD/SUB results.

Includes ADD commutation - I tried to include NEG+SUB SUB commutation as well but this causes regressions as we don't have good combine coverage to simplify X86ISD::SUB.

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

llvm-svn: 354771

5 years ago[yaml2obj]Re-allow dynamic sections to have raw content
James Henderson [Mon, 25 Feb 2019 11:02:24 +0000 (11:02 +0000)]
[yaml2obj]Re-allow dynamic sections to have raw content

Recently, support was added to yaml2obj to allow dynamic sections to
have a list of entries, to make it easier to write tests with dynamic
sections. However, this change also removed the ability to provide
custom contents to the dynamic section, making it hard to test
malformed contents (e.g. because the section is not a valid size to
contain an array of entries). This change reinstates this. An error is
emitted if raw content and dynamic entries are both specified.

Reviewed by: grimar, ruiu

Differential Review: https://reviews.llvm.org/D58543

llvm-svn: 354770

5 years ago[ELF][ARM] Accept and ignore -p and -no-pipleline-knowledge
Peter Smith [Mon, 25 Feb 2019 10:48:31 +0000 (10:48 +0000)]
[ELF][ARM] Accept and ignore -p and -no-pipleline-knowledge

The linux kernel uses an old flag -p/-no-pipeline-knowledge that is
accepted by bfd and gold but ignored by modern versions of them. The
original option is very old and is pre-ABI, it sometimes comes up in
code-bases that had support for pre ABI toolchains. The Linux kernel uses
it in 3 places in the ARM specific section.

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

llvm-svn: 354769

5 years ago[ARM] Make fullfp16 instructions not conditionalisable.
Simon Tatham [Mon, 25 Feb 2019 10:39:53 +0000 (10:39 +0000)]
[ARM] Make fullfp16 instructions not conditionalisable.

More or less all the instructions defined in the v8.2a full-fp16
extension are defined as UNPREDICTABLE if you put them in an IT block
(Thumb) or use with any condition other than AL (ARM). LLVM didn't
know that, and was happy to conditionalise them.

In order to force these instructions to count as not predicable, I had
to make a small Tablegen change. The code generation back end mostly
decides if an instruction was predicable by looking for something it
can identify as a predicate operand; there's an isPredicable bit flag
that overrides that check in the positive direction, but nothing that
overrides it in the negative direction.

(I considered the alternative approach of actually removing the
predicate operand from those instructions, but thought that it would
be more painful overall for instructions differing only in data type
to have different shapes of operand list. This way, the only code that
has to notice the difference is the if-converter.)

So I've added an isUnpredicable bit alongside isPredicable, and set
that bit on the right subset of FP16 instructions, and also on the
VSEL, VMAXNM/VMINNM and VRINT[ANPM] families which should be
unpredicable for all data types.

I've included a couple of representative regression tests, both of
which previously caused an fp16 instruction to be conditionalised in
ARM state and (with -arm-no-restrict-it) to be put in an IT block in
Thumb.

Reviewers: SjoerdMeijer, t.p.northover, efriedma

Reviewed By: efriedma

Subscribers: jdoerfert, javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 354768

5 years ago[llvm-exegesis] Split Epsilon param into two (PR40787)
Roman Lebedev [Mon, 25 Feb 2019 09:36:12 +0000 (09:36 +0000)]
[llvm-exegesis] Split Epsilon param into two (PR40787)

Summary:
This eps param is used for two distinct things:
* initial point clusterization
* checking clusters against the llvm values

What if one wants to only look at highly different clusters, without changing
the clustering itself? In particular, this helps to weed out noisy measurements
(since the clusterization epsilon is still small, so there is a better chance
that noisy measurements from the same opcode will go into different clusters)

By splitting it into two params it is now possible.

This is nearly-free performance-wise:
Old:
```
$ perf stat -r 25 ./bin/llvm-exegesis -mode=analysis -benchmarks-file=/home/lebedevri/PileDriver-Sched/benchmarks-latency-1.yaml -analysis-inconsistencies-output-file=/tmp/clusters-old.html
no exegesis target for x86_64-unknown-linux-gnu, using default
Parsed 10099 benchmark points
Printing sched class consistency analysis results to file '/tmp/clusters-old.html'
...
 Performance counter stats for './bin/llvm-exegesis -mode=analysis -benchmarks-file=/home/lebedevri/PileDriver-Sched/benchmarks-latency-1.yaml -analysis-inconsistencies-output-file=/tmp/clusters-old.html' (25 runs):

            390.01 msec task-clock                #    0.998 CPUs utilized            ( +-  0.25% )
                12      context-switches          #   31.735 M/sec                    ( +- 27.38% )
                 0      cpu-migrations            #    0.000 K/sec
              4745      page-faults               # 12183.732 M/sec                   ( +-  0.54% )
        1562711900      cycles                    # 4012303.327 GHz                   ( +-  0.24% )  (82.90%)
         185567822      stalled-cycles-frontend   #   11.87% frontend cycles idle     ( +-  0.52% )  (83.30%)
         392106234      stalled-cycles-backend    #   25.09% backend cycles idle      ( +-  1.31% )  (33.79%)
        1839236666      instructions              #    1.18  insn per cycle
                                                  #    0.21  stalled cycles per insn  ( +-  0.15% )  (50.37%)
         407035764      branches                  # 1045074878.710 M/sec              ( +-  0.12% )  (66.80%)
          10896459      branch-misses             #    2.68% of all branches          ( +-  0.17% )  (83.20%)

          0.390629 +- 0.000972 seconds time elapsed  ( +-  0.25% )
```
```
$ perf stat -r 9 ./bin/llvm-exegesis -mode=analysis -benchmarks-file=/home/lebedevri/PileDriver-Sched/benchmarks-latency.yml -analysis-inconsistencies-output-file=/tmp/clusters-old.html
no exegesis target for x86_64-unknown-linux-gnu, using default
Parsed 50572 benchmark points
Printing sched class consistency analysis results to file '/tmp/clusters-old.html'
...
 Performance counter stats for './bin/llvm-exegesis -mode=analysis -benchmarks-file=/home/lebedevri/PileDriver-Sched/benchmarks-latency.yml -analysis-inconsistencies-output-file=/tmp/clusters-old.html' (9 runs):

           6803.36 msec task-clock                #    0.999 CPUs utilized            ( +-  0.96% )
               262      context-switches          #   38.546 M/sec                    ( +- 23.06% )
                 0      cpu-migrations            #    0.065 M/sec                    ( +- 76.03% )
             13287      page-faults               # 1953.206 M/sec                    ( +-  0.32% )
       27252537904      cycles                    # 4006024.257 GHz                   ( +-  0.95% )  (83.31%)
        1496314935      stalled-cycles-frontend   #    5.49% frontend cycles idle     ( +-  0.97% )  (83.32%)
       16128404524      stalled-cycles-backend    #   59.18% backend cycles idle      ( +-  0.30% )  (33.37%)
       17611143370      instructions              #    0.65  insn per cycle
                                                  #    0.92  stalled cycles per insn  ( +-  0.05% )  (50.04%)
        3894906599      branches                  # 572537147.437 M/sec               ( +-  0.03% )  (66.69%)
         116314514      branch-misses             #    2.99% of all branches          ( +-  0.20% )  (83.35%)

            6.8118 +- 0.0689 seconds time elapsed  ( +-  1.01%)
```
New:
```
$ perf stat -r 25 ./bin/llvm-exegesis -mode=analysis -benchmarks-file=/home/lebedevri/PileDriver-Sched/benchmarks-latency-1.yaml -analysis-inconsistencies-output-file=/tmp/clusters-new.html
no exegesis target for x86_64-unknown-linux-gnu, using default
Parsed 10099 benchmark points
Printing sched class consistency analysis results to file '/tmp/clusters-new.html'
...
 Performance counter stats for './bin/llvm-exegesis -mode=analysis -benchmarks-file=/home/lebedevri/PileDriver-Sched/benchmarks-latency-1.yaml -analysis-inconsistencies-output-file=/tmp/clusters-new.html' (25 runs):

            400.14 msec task-clock                #    0.998 CPUs utilized            ( +-  0.66% )
                12      context-switches          #   29.429 M/sec                    ( +- 25.95% )
                 0      cpu-migrations            #    0.100 M/sec                    ( +-100.00% )
              4714      page-faults               # 11796.496 M/sec                   ( +-  0.55% )
        1603131306      cycles                    # 4011840.105 GHz                   ( +-  0.66% )  (82.85%)
         199538509      stalled-cycles-frontend   #   12.45% frontend cycles idle     ( +-  2.40% )  (83.10%)
         402249109      stalled-cycles-backend    #   25.09% backend cycles idle      ( +-  1.19% )  (34.05%)
        1847783963      instructions              #    1.15  insn per cycle
                                                  #    0.22  stalled cycles per insn  ( +-  0.18% )  (50.64%)
         407162722      branches                  # 1018925730.631 M/sec              ( +-  0.12% )  (67.02%)
          10932779      branch-misses             #    2.69% of all branches          ( +-  0.51% )  (83.28%)

           0.40077 +- 0.00267 seconds time elapsed  ( +-  0.67% )

lebedevri@pini-pini:/build/llvm-build-Clang-release$ perf stat -r 9 ./bin/llvm-exegesis -mode=analysis -benchmarks-file=/home/lebedevri/PileDriver-Sched/benchmarks-latency.yml -analysis-inconsistencies-output-file=/tmp/clusters-new.html
no exegesis target for x86_64-unknown-linux-gnu, using default
Parsed 50572 benchmark points
Printing sched class consistency analysis results to file '/tmp/clusters-new.html'
...
 Performance counter stats for './bin/llvm-exegesis -mode=analysis -benchmarks-file=/home/lebedevri/PileDriver-Sched/benchmarks-latency.yml -analysis-inconsistencies-output-file=/tmp/clusters-new.html' (9 runs):

           6947.79 msec task-clock                #    1.000 CPUs utilized            ( +-  0.90% )
               217      context-switches          #   31.236 M/sec                    ( +- 36.16% )
                 1      cpu-migrations            #    0.096 M/sec                    ( +- 50.00% )
             13258      page-faults               # 1908.389 M/sec                    ( +-  0.34% )
       27830796523      cycles                    # 4006032.286 GHz                   ( +-  0.89% )  (83.30%)
        1504554006      stalled-cycles-frontend   #    5.41% frontend cycles idle     ( +-  2.10% )  (83.32%)
       16716574843      stalled-cycles-backend    #   60.07% backend cycles idle      ( +-  0.65% )  (33.38%)
       17755545931      instructions              #    0.64  insn per cycle
                                                  #    0.94  stalled cycles per insn  ( +-  0.09% )  (50.04%)
        3897255686      branches                  # 560980426.597 M/sec               ( +-  0.06% )  (66.70%)
         117045395      branch-misses             #    3.00% of all branches          ( +-  0.47% )  (83.34%)

            6.9507 +- 0.0627 seconds time elapsed  ( +-  0.90% )
```

I.e. it's +2.6% slowdown for one whole sweep, or +2% for 5 whole sweeps.
Within noise i'd say.

Should help with [[ https://bugs.llvm.org/show_bug.cgi?id=40787 | PR40787 ]].

Reviewers: courbet, gchatelet

Reviewed By: courbet

Subscribers: tschuett, RKSimon, llvm-commits

Tags: #llvm

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

llvm-svn: 354767

5 years agoFinish revert of r354706
Pavel Labath [Mon, 25 Feb 2019 09:30:41 +0000 (09:30 +0000)]
Finish revert of r354706

The revert in r354711 wasn't complete. Finish the job.

llvm-svn: 354766