Commit Graph

288901 Commits

Author SHA1 Message Date
Joachim Protze 9be9cf20bf [OMPT] Fix thread_num for implicit_task_end callbacks in nested parallel regions
implicit_task_end callbacks in nested parallel regions did not always give the
correct thread_num, since the inner parallel region may have already been
finalized.
Now, the thread_num is stored at the beginning of the implicit task and
retrieved at the end, whenever necessary.

A testcase was added as well.

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

llvm-svn: 331632
2018-05-07 12:42:21 +00:00
Joachim Protze 8fc39f6b19 [OMPT] Add api_calls_misc.c testcase and rename api_calls.c testcase
The api_calls_misc.c testcase tests the following api calls:

ompt_get_callback()
ompt_get_state()
ompt_enumerate_states()
ompt_enumerate_mutex_impls()
These have not been tested previously.

The api_calls.c testcase has been renamed to api_calls_places.c because it only tests api calls that are related to places.

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

llvm-svn: 331631
2018-05-07 12:42:15 +00:00
Peter Szecsi ce7f318f21 [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr
The visit callback implementations for the 3 C++ AST Node added to the ASTImporter.

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

llvm-svn: 331630
2018-05-07 12:08:27 +00:00
Simon Pilgrim f3ae50fca2 [X86] Split WriteFRcp/WriteFRsqrt/WriteFSqrt schedule classes
WriteFRcp/WriteFRsqrt are split to support scalar, XMM and YMM/ZMM instructions.

WriteFSqrt is split into single/double/long-double sizes and scalar, XMM, YMM and ZMM instructions.

This removes all InstrRW overrides for these instructions.

NOTE: There were a couple of typos in the Znver1 model - notably a 1cy throughput for SQRT that is highly unlikely and doesn't tally with Agner.

NOTE: I had to add Agner's numbers for several targets for WriteFSqrt80.
llvm-svn: 331629
2018-05-07 11:50:44 +00:00
Petar Jovanovic 3ae0c0e291 Skip unreachable blocks for CFIInstrInserter verify
Iterate only through reachable blocks. This finetunes r330706 and
it resolves build issue reported by Craig Topper.

llvm-svn: 331628
2018-05-07 11:47:48 +00:00
Jonas Paulsson ebb1605bf3 [SystemZ] Bugfix for MVCLoop CC clobbering.
MVCLoop clobbers CC (since it emits a compare/branch), but this was not
modelled.

Review: Ulrich Weigand
llvm-svn: 331627
2018-05-07 10:48:43 +00:00
Igor Kudrin 61de8a5aef [sanitizer] Be more accurate when calculating the previous instruction address on ARM.
Differential Revision: https://reviews.llvm.org/D46004

llvm-svn: 331626
2018-05-07 10:07:22 +00:00
Roman Lebedev ffec58bce6 [InstCombine][NFC] Add tests for one more masked merge pattern.
This pattern came up in D46494.
I'm pretty sure we want to canonicalize it from
	(x | ~m) & (y &  m)
to
	(x &  m) | (y & ~m)

https://rise4fun.com/Alive/TEM

llvm-svn: 331625
2018-05-07 09:42:45 +00:00
Clement Courbet 967154148d Re-land r331622 "[llvm-exegesis] Add a library to cluster benchmark results."
Add missing move.

llvm-svn: 331624
2018-05-07 09:09:48 +00:00
Clement Courbet e9174bc2c8 Revert r331622 "[llvm-exegesis] Add a library to cluster benchmark results."
Breaks build over llvm::Error copy construction.

llvm-svn: 331623
2018-05-07 08:30:18 +00:00
Clement Courbet a7fb139e9d [llvm-exegesis] Add a library to cluster benchmark results.
Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

llvm-svn: 331622
2018-05-07 08:20:00 +00:00
Richard Smith c2fccf8338 Remove now-unnecessary check for non-zero nvsize in addition to
emptyness in MS record layout.

llvm-svn: 331621
2018-05-07 06:43:31 +00:00
Richard Smith b5a317fbf6 Non-zero-length bit-fields make a class non-empty.
This implements the rule intended by the standard (see LWG 2358)
and the rule intended by the Itanium C++ ABI (see
https://github.com/itanium-cxx-abi/cxx-abi/pull/51), and makes
Clang match the behavior of GCC, ICC, and MSVC.

A pedantic reading of both the standard and the ABI indicate that Clang
is currently technically correct, but that's not worth much when it's
clear that the wording is wrong in both those places.

This is an ABI break for classes that derive from a class that is empty
other than one or more unnamed non-zero-length bit-fields. Such cases
are expected to be rare, but -fclang-abi-compat=6 restores the old
behavior just in case.

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

llvm-svn: 331620
2018-05-07 06:43:30 +00:00
Vitaly Buka fac095caba [sanitizer] Add operator== and operator!= for InternalMmapVectorNoCtor
llvm-svn: 331619
2018-05-07 06:14:12 +00:00
Vitaly Buka 2a20955169 [sanitizer] Replace InternalScopedBuffer with InternalMmapVector
llvm-svn: 331618
2018-05-07 05:56:36 +00:00
Vitaly Buka 44f55509d7 [sanitizer] Remove reserving constructor from InternalMmapVector
llvm-svn: 331617
2018-05-07 05:56:24 +00:00
Vitaly Buka db4241a046 [sanitizer] Implement InternalScopedBuffer with InternalMmapVector
llvm-svn: 331616
2018-05-07 05:56:12 +00:00
Fangrui Song 4ba3e97333 Fix comment. NFC
llvm-svn: 331615
2018-05-07 05:21:20 +00:00
Amaury Sechet f91b6a8cf7 [ARM] Select result 1 from ConvertBooleanCarryToCarryFlag's result automatically. NFC
The old behavior return the value 0, which is error prone.

llvm-svn: 331614
2018-05-07 01:43:42 +00:00
Craig Topper 7413b322ea [TargetLowering] Use StringRef::split instead of SplitString. NFC
SplitString splits based on a list of delimeters, but we're only using one delimeter so we should use the simpler split.

llvm-svn: 331613
2018-05-07 01:32:18 +00:00
Vitaly Buka 20f49662f6 [sanitizer] Make InternalScopedBuffer::size() behavior similar to vector.
llvm-svn: 331612
2018-05-07 01:08:13 +00:00
Craig Topper c882014f43 [X86] Fix copy/paste mistake in comment. NFC
llvm-svn: 331611
2018-05-07 00:47:02 +00:00
Fangrui Song 07f0a68ba3 [llvm-dwp] Define InitLLVM.
llvm-svn: 331610
2018-05-06 23:08:29 +00:00
Roman Lebedev cb1af9134a [NFC][DAGCombine] unfoldMaskedMerge(): rename two variables
The current names can be confused with the A and B sides
of the canonical masked merge pattern.

llvm-svn: 331609
2018-05-06 20:02:22 +00:00
Roman Lebedev 7cb6896732 ELF Thunks: fix build error: missing 'overrides'
llvm-svn: 331608
2018-05-06 19:50:04 +00:00
Sean Fertile d2e887d2f6 [PPC64] Emit plt call stubs to the text section rather then the plt section.
On PowerPC calls to functions through the plt must be done through a call stub
that is responsible for:
1) Saving the toc pointer to the stack.
2) Loading the target functions address from the plt into both r12 and the
   count register.
3) Indirectly branching to the target function.

Previously we have been emitting these call stubs to the .plt section, however
the .plt section should be reserved for the lazy symbol resolution stubs. This
patch moves the call stubs to the text section by moving the implementation from
writePlt to the thunk framework.

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

llvm-svn: 331607
2018-05-06 19:13:29 +00:00
Craig Topper cb2abc7977 [X86] Enable reciprocal estimates for v16f32 vectors by using VRCP14PS/VRSQRT14PS
Summary:
The legacy VRCPPS/VRSQRTPS instructions aren't available in 512-bit versions. The new increased precision versions are. So we can use those to implement v16f32 reciprocal estimates.

For KNL CPUs we can probably use VRCP28PS/VRSQRT28PS and avoid the NR step altogether, but I leave that for a future patch.

Reviewers: spatel

Reviewed By: spatel

Subscribers: RKSimon, llvm-commits, mehdi_amini

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

llvm-svn: 331606
2018-05-06 17:48:21 +00:00
Craig Topper b02e3dec4b [X86] Add test cases for reciprocal estimation for v16f32 vectors with AVX512F.
We should be able to use the vrsqrt14ps and vrcp14ps instructions for these cases.

llvm-svn: 331605
2018-05-06 17:45:40 +00:00
Amaury Sechet 0ea2936104 Add test cases for large integer legalization of add and sub. NFC
llvm-svn: 331604
2018-05-06 16:00:23 +00:00
Daniel Sanders acc008cb0c [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC
As Roman Tereshin pointed out in https://reviews.llvm.org/D45541, the
-global-isel option is redundant when -run-pass is given. -global-isel sets up
the GlobalISel passes in the pass manager but -run-pass skips that entirely and
configures it's own pipeline.

llvm-svn: 331603
2018-05-05 21:19:59 +00:00
Fangrui Song 1e5d47768a [MC] Remove unused MCOI::GenericOperandType
llvm-svn: 331602
2018-05-05 20:54:03 +00:00
Daniel Sanders f84bc3793e [globalisel] Update GlobalISel emitter to match new representation of extending loads
Summary:
Previously, a extending load was represented at (G_*EXT (G_LOAD x)).
This had a few drawbacks:
* G_LOAD had to be legal for all sizes you could extend from, even if
  registers didn't naturally hold those sizes.
* All sizes you could extend from had to be allocatable just in case the
  extend went missing (e.g. by optimization).
* At minimum, G_*EXT and G_TRUNC had to be legal for these sizes. As we
  improve optimization of extends and truncates, this legality requirement
  would spread without considerable care w.r.t when certain combines were
  permitted.
* The SelectionDAG importer required some ugly and fragile pattern
  rewriting to translate patterns into this style.

This patch changes the representation to:
* (G_[SZ]EXTLOAD x)
* (G_LOAD x) any-extends when MMO.getSize() * 8 < ResultTy.getSizeInBits()
which resolves these issues by allowing targets to work entirely in their
native register sizes, and by having a more direct translation from
SelectionDAG patterns.

Each extending load can be lowered by the legalizer into separate extends
and loads, however a target that supports s1 will need the any-extending
load to extend to at least s8 since LLVM does not represent memory accesses
smaller than 8 bit. The legalizer can widenScalar G_LOAD into an
any-extending load but sign/zero-extending loads need help from something
else like a combiner pass. A follow-up patch that adds combiner helpers for
for this will follow.

The new representation requires that the MMO correctly reflect the memory
access so this has been corrected in a couple tests. I've also moved the
extending loads to their own tests since they are (mostly) separate opcodes
now. Additionally, the re-write appears to have invalidated two tests from
select-with-no-legality-check.mir since the matcher table no longer contains
loads that result in s1's and they aren't legal in AArch64 anymore.

Depends on D45540

Reviewers: ab, aditya_nandakumar, bogner, rtereshin, volkan, rovka, javed.absar

Reviewed By: rtereshin

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

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

llvm-svn: 331601
2018-05-05 20:53:24 +00:00
Heejin Ahn c86da6bcfe [MIRPraser] Improve error checking for typed immediate operands
Summary:
This improves error checks for typed immediate operands introduced in
D45948 (rL331586), and removes a code block copied by mistake.

Reviewers: rtereshin

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

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

llvm-svn: 331600
2018-05-05 20:53:23 +00:00
Fangrui Song 862eebb6d6 Simplify LLVM_ATTRIBUTE_USED call sites.
llvm-svn: 331599
2018-05-05 20:14:38 +00:00
Aaron Ballman a383c94ccd Disallow pointers to const in __sync_fetch_and_xxx.
Diagnoses code like:

void f(const int *ptr) {
  __sync_fetch_and_add(ptr, 1);
}

which matches the behavior of GCC and ICC.

llvm-svn: 331598
2018-05-05 17:38:42 +00:00
Teresa Johnson fedd39045f Add -target to address errors in test from r331592
The error turns out to be:
Assertion failed: (Target.isCompatibleDataLayout(getDataLayout()) && "Can't create a MachineFunction using a Module with a " "Target-incompatible DataLayout attached\n"), function init, file /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm/lib/CodeGen/MachineFunction.cpp, line 180.

Add -target to address this. Also re-enable the test I had temporarily
commented, and move it further down in case there is still a failure
(since it pipes stderr to FileCheck).

llvm-svn: 331597
2018-05-05 16:37:31 +00:00
Teresa Johnson 1237b3acc9 Skip part of test added in r331592 to help debug bot failures
Trying to debug why/where a few bots getting exit code 256 e.g.
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/48471/testReport/Clang/CodeGen/thinlto_diagnostic_handler_remarks_with_hotness_ll/

and a few windows bots getting no output from that RUN line e.g.
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11865/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Athinlto-diagnostic-handler-remarks-with-hotness.ll

llvm-svn: 331596
2018-05-05 15:54:57 +00:00
Roman Lebedev a3b0b59f54 [DAGCombiner] Masked merge: don't touch "not" xor's.
Summary:
Split off form D46031.

It seems we don't want to transform the pattern if the `xor`'s are actually `not`'s.
In vector case, this breaks `andnpd` / `vandnps` patterns.

That being said, we may want to re-visit this `not` handling, maybe in D46073.

Reviewers: spatel, craig.topper, javed.absar

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 331595
2018-05-05 15:45:40 +00:00
Andrea Di Biagio 450ea7aed3 [llvm-mca] removes flag -instruction-tables from the "View Options" category.
This patch also improves the description of a couple of flags in the view
options. With this change, the -help now specifies which views are enabled by
default.

llvm-svn: 331594
2018-05-05 15:36:47 +00:00
Teresa Johnson 259f8ddff5 Add required target to address bot failures from r331592
Failing on non-x86 bots, needs x86 target for code gen.

llvm-svn: 331593
2018-05-05 15:15:04 +00:00
Teresa Johnson 66744f8137 [ThinLTO] Support opt remarks options with distributed ThinLTO backends
Summary:
Passes down the necessary code ge options to the LTO Config to enable
-fdiagnostics-show-hotness and -fsave-optimization-record in the ThinLTO
backend for a distributed build.

Also, remove warning about not having PGO when the input is IR.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

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

llvm-svn: 331592
2018-05-05 14:37:29 +00:00
Teresa Johnson 81d9207317 [LTO] Handle Task=-1 passed to addSaveTemps
Summary:
This change is necessary for D46464, which will pass -1 as the Task
ID for distributed backends, so that the save temps files don't end
up with "4294967295" in their path. For distributed back ends, when -1
is passed, don't append any Task ID.

An existing test (tools/clang/test/CodeGen/thinlto_backend.ll) will
fail without this change after D46464.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, llvm-commits

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

llvm-svn: 331591
2018-05-05 14:37:20 +00:00
Andrea Di Biagio 7bf825618c [llvm-mca] minor tweak to the resource pressure printing functionality. NFC.
llvm-svn: 331590
2018-05-05 12:21:54 +00:00
Andrea Di Biagio 25c1a2f0d1 Fix -Wunused-variable warning introduced at r331566.
llvm-svn: 331589
2018-05-05 10:53:31 +00:00
Roman Lebedev 49ada82fa7 [NFC][DagCombiner] unfoldMaskedMerge(): improve readability.
llvm-svn: 331588
2018-05-05 10:39:54 +00:00
Piotr Padlewski e9832dfdf3 [CaptureTracking] Handle capturing of launder.invariant.group
Summary:
launder.invariant.group has the same rules of capturing as
bitcast, gep, etc - the original value is not captured
if the returned pointer is not captured.

With this patch, we mark 40% more functions as noalias when compiling with -fstrict-vtable-pointers;
1078 vs 1778  (39.37%)

Reviewers: sanjoy, davide, nlewycky, majnemer, mehdi_amini

Subscribers: JDevlieghere, llvm-commits

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

llvm-svn: 331587
2018-05-05 10:23:27 +00:00
Heejin Ahn c2ad096845 [MIRParser] Allow register class names in the form of integer/scalar
Summary:
The current code cannot handle register class names like 'i32', which is
a valid register class name in WebAssembly. This patch removes special
handling for integer/scalar/pointer type parsing and treats them as
normal identifiers.

Reviewers: thegameg

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

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

llvm-svn: 331586
2018-05-05 07:05:51 +00:00
Fangrui Song 2569f3eb80 [Option] Remove an unnecessary conversion function.
llvm-svn: 331585
2018-05-05 06:05:31 +00:00
George Burgess IV f9d26af4ea Range-ify for loop; NFC
llvm-svn: 331582
2018-05-05 04:52:26 +00:00
Kamil Rytarowski bbe9e2a13c Remove dead sanitizer_procmaps_freebsd.cc
This file has been obsoleted by sanitizer_procmaps_bsd.cc.

llvm-svn: 331581
2018-05-05 03:57:07 +00:00