Kirill Bobyrev [Sun, 9 Aug 2020 20:07:26 +0000 (22:07 +0200)]
[clangd] Add more error details on the remote index server side
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D85502
Dávid Bolvanský [Sun, 9 Aug 2020 20:04:53 +0000 (22:04 +0200)]
[X86] Added testcases for PR47024 and PR46315
Vitaly Buka [Sun, 9 Aug 2020 19:38:53 +0000 (12:38 -0700)]
[NFC][StackSafety] Avoid some duplications in tests
Gousemoodhin Nadaf [Sun, 9 Aug 2020 19:01:36 +0000 (21:01 +0200)]
[clang] Fix typo in comment
In the handleIntToFloatConversion() function, 6th parameter is ConvertFloat, 7th parameter is ConvertInt.
Reviewed By: njames93, xbolva00
Differential Revision: https://reviews.llvm.org/D85568
Craig Topper [Sun, 9 Aug 2020 07:37:18 +0000 (00:37 -0700)]
[X86][GlobalISel] Enable a test case for sext i32->i64 that was commented out.
Test case seems to work so I guess whatever lead to it being
commented out with a FIXME has been fixed.
Piotr Sobczak [Thu, 30 Jul 2020 11:56:06 +0000 (13:56 +0200)]
Fix 64-bit copy to SCC
Fix 64-bit copy to SCC by restricting the pattern resulting
in such a copy to subtargets supporting 64-bit scalar compare,
and mapping the copy to S_CMP_LG_U64.
Before introducing the S_CSELECT pattern with explicit SCC
(
0045786f146e78afee49eee053dc29ebc842fee1), there was no need
for handling 64-bit copy to SCC ($scc = COPY sreg_64).
The proposed handling to read only the low bits was however
based on a false premise that it is only one bit that matters,
while in fact the copy source might be a vector of booleans and
all bits need to be considered.
The practical problem of mapping the 64-bit copy to SCC is that
the natural instruction to use (S_CMP_LG_U64) is not available
on old hardware. Fix it by restricting the problematic pattern
to subtargets supporting the instruction (hasScalarCompareEq64).
Differential Revision: https://reviews.llvm.org/D85207
Florian Hahn [Sun, 9 Aug 2020 18:47:16 +0000 (19:47 +0100)]
[InstSimplify] Make sure CanUseUndef is initialized in all cases.
This should fix a bunch of buildbot failures.
Florian Hahn [Sun, 9 Aug 2020 18:16:56 +0000 (19:16 +0100)]
[InstSimplify/NewGVN] Add option to control the use of undef.
Making use of undef is not safe if the simplification result is not used
to replace all uses of the result. This leads to problems in NewGVN,
which does not replace all uses in the IR directly. See PR33165 for more
details.
This patch adds an option to SimplifyQuery to disable the use of undef.
Note that I've only guarded uses if isa<UndefValue>/m_Undef where
SimplifyQuery is currently available. If we agree on the general
direction, I'll update the remaining uses.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D84792
Florian Hahn [Sun, 9 Aug 2020 15:48:44 +0000 (16:48 +0100)]
[SCEVExpander] Make sure cast properly dominates Builder's IP.
The selected cast must properly dominate the Builder's IP, so we cannot
re-use the cast, if it matches the builder's IP.
Aditya Kumar [Sun, 9 Aug 2020 15:45:36 +0000 (08:45 -0700)]
[HotColdSplit] Add options for splitting cold functions in separate section
Add support for (if enabled) splitting cold functions into a separate section
in order to further boost locality of hot code.
Authored by: rjf (Ruijie Fang)
Reviewed by: hiraditya,rcorcs,vsk
Differential Revision: https://reviews.llvm.org/D85331
Dávid Bolvanský [Sun, 9 Aug 2020 14:07:36 +0000 (16:07 +0200)]
[Tests] Precommit tests for D85593
Dávid Bolvanský [Sun, 9 Aug 2020 14:00:01 +0000 (16:00 +0200)]
[Diagnostics] Handle string concat pattern and avoid false positives
Sanjay Patel [Sun, 9 Aug 2020 12:59:54 +0000 (08:59 -0400)]
[VectorCombine] try to create vector loads from scalar loads
This patch was adjusted to match the most basic pattern that starts with an insertelement
(so there's no extract created here). Hopefully, that removes any concern about
interfering with other passes. Ie, the transform should almost always be profitable.
We could make an argument that this could be part of canonicalization, but we
conservatively try not to create vector ops from scalar ops in passes like instcombine.
If the transform is not profitable, the backend should be able to re-scalarize the load.
Differential Revision: https://reviews.llvm.org/D81766
Florian Hahn [Sun, 9 Aug 2020 12:16:59 +0000 (13:16 +0100)]
[SCEVExpander] Avoid re-using existing casts if it means updating users.
Currently the SCEVExpander tries to re-use existing casts, even if they
are not exactly at the insertion point it was asked to create the cast.
To do so in some case, it creates a new cast at the insertion point and
updates all users to use the new cast.
This behavior is problematic, because it changes the IR outside of the
instructions created during the expansion. Therefore we cannot
completely undo all changes made during expansion.
This re-use should be only an extra optimization, so only using the new
cast in the expanded instructions should not be a correctness issue.
There are many cases equivalent instructions are created during
expansion.
This patch also adjusts findInsertPointAfter to skip instructions
inserted during expansion. This enables re-using existing casts without
the renaming any uses, by picking a better insertion point.
Reviewed By: efriedma, lebedev.ri
Differential Revision: https://reviews.llvm.org/D84399
Michał Górny [Wed, 5 Aug 2020 08:15:41 +0000 (10:15 +0200)]
[Polly] Reuse LLVM's build rules for gtest/gmock
Reuse LLVM's CMakeLists.txt for gtest/gmock instead of reinventing
them in Polly. This fixes a lot of linking errors due to not linking
LLVMSupport in for me.
Differential Revision: https://reviews.llvm.org/D85280
Dávid Bolvanský [Sun, 9 Aug 2020 10:22:29 +0000 (12:22 +0200)]
[Diagnostics] Turn string concat warning to avoid false positives
David Green [Sun, 9 Aug 2020 10:09:49 +0000 (11:09 +0100)]
[ARM] Add VADDV and VMLAV patterns for v16i16
This adds patterns for v16i16's vecreduce, using all the existing code
to go via an i32 VADDV/VMLAV and truncating the result.
Differential Revision: https://reviews.llvm.org/D85452
David Green [Sun, 9 Aug 2020 09:57:17 +0000 (10:57 +0100)]
[ARM] Allow vecreduce_add in tail predicated loops
This allows vecreduce_add in loops so that we can tailpredicate them.
Differential Revision: https://reviews.llvm.org/D85454
David Green [Sat, 8 Aug 2020 13:43:09 +0000 (14:43 +0100)]
[ARM] Some formatting and predicate VRHADD patterns. NFC
This formats some of the MVE patterns, and adds a missing
Predicates = [HasMVEInt] to some VRHADD patterns I noticed
as going through. Although I don't believe NEON would ever
use the patterns (as it would use ADDL and VSHRN instead)
they should ideally be predicated on having MVE instructions.
Georgii Rymar [Fri, 7 Aug 2020 09:41:20 +0000 (12:41 +0300)]
[llvm-readelf/obj] - Refine the implementation of printMipsReginfo().
It adds the proper warnings reporting and updates the mips-reginfo.test to
remove using of the precompiled binary.
Differential revision: https://reviews.llvm.org/D85511
Georgii Rymar [Fri, 7 Aug 2020 10:38:16 +0000 (13:38 +0300)]
[llvm-readobj] - Remove 3 excessive test cases.
This patch does the following:
1) Removes mips-options.test and the corresponding Inputs/mips-options.elf-mips64el binary:
This is a test that checks that --dynamic-table is able to print the DT_MIPS_OPTIONS tag.
We are testing it in dynamic-tags-machine-specific.test already.
(https://github.com/llvm/llvm-project/blob/master/llvm/test/tools/llvm-readobj/ELF/dynamic-tags-machine-specific.test#L235)
2) Removes mips-rld-map-rel.test and the corresponding Inputs/mips-rld-map-rel.elf-mipsel binary.
This is a test that checks that --dynamic-table is able to print the DT_MIPS_RLD_MAP_REL tag.
We are testing it in dynamic-tags-machine-specific.test already.
(https://github.com/llvm/llvm-project/blob/master/llvm/test/tools/llvm-readobj/ELF/dynamic-tags-machine-specific.test#L257)
3) Removes ppc64-glink.test test and the corresponding Inputs/ppc64.exe binary.
This is a test that checks that --dynamic-table is able to print the DT_PPC64_GLINK tag.
We are testing it in dynamic-tags-machine-specific.test already.
(https://github.com/llvm/llvm-project/blob/master/llvm/test/tools/llvm-readobj/ELF/dynamic-tags-machine-specific.test#L337)
Differential revision: https://reviews.llvm.org/D85515
Craig Topper [Sun, 9 Aug 2020 07:24:53 +0000 (00:24 -0700)]
[X86][GlobalISel] Remove unneeded code for handling zext i8->16, i8->i64, i16->i64, i32->i64.
These all seem to be handled by tablegen pattern imports.
Uday Bondhugula [Sat, 8 Aug 2020 21:48:04 +0000 (03:18 +0530)]
[MLIR][NFC] Fix misleading diagnostic error + clang-tidy fix
Fix misleading diagnostic error in affine.yield verifier + a clang-tidy fix.
Differential Revision: https://reviews.llvm.org/D85587
Craig Topper [Sun, 9 Aug 2020 05:09:21 +0000 (22:09 -0700)]
[DAGCombiner] Teach SimplifySetCC SETUGE X, SINTMIN -> SETLT X, 0 and SETULE X, SINTMAX -> SETGT X, -1.
These aren't the canonical forms we'd get from InstCombine, but
we do have X86 tests for them. Recognizing them is pretty cheap.
While there make use of APInt:isSignedMinValue/isSignedMaxValue
instead of creating a new APInt to compare with. Also use
SelectionDAG::getAllOnesConstant helper to hide the all ones
APInt creation.
Craig Topper [Sun, 9 Aug 2020 00:12:20 +0000 (17:12 -0700)]
[X86] Autogenerate complete checks. NFC
Vitaly Buka [Sun, 9 Aug 2020 04:26:35 +0000 (21:26 -0700)]
Revert "[NFC][StackSafety] Add index test"
This reverts commit
5fd49911db546cda6b35dffb6be440385e8d96d5.
GUIDs don't match.
Vitaly Buka [Sun, 9 Aug 2020 02:09:34 +0000 (19:09 -0700)]
[NFC][StackSafety] Add index test
This directly covers generateParamAccessSummary
Vitaly Buka [Sat, 8 Aug 2020 00:22:08 +0000 (17:22 -0700)]
[NFC][StackSafety] noinline in alias tests
Fangrui Song [Sun, 9 Aug 2020 01:17:38 +0000 (18:17 -0700)]
[ELF] --wrap: don't leave the original symbol as SHN_UNDEF in .symtab or .dynsym
weihe [Sun, 9 Aug 2020 00:49:33 +0000 (17:49 -0700)]
[llvm-profdata] Implement llvm-profdata overlap for sample profiles
Implemented the `llvm-profdata overlap` feature for sample profiles. It reports weighted //similarity// and unweighted //overlap// metrics at program and function level for two input profiles. Similarity metrics are symmetric with regards to the order of two input profiles. By default, the tool only reports program-level summary. Users can look into function-level details via additional options `--function`, `--similarity-cutoff`, and `--value-cutoff`.
The similarity metrics are designed as follows:
* Program-level summary
* Whole program profile similarity is an aggregate over function-level similarity `FS`: `PS = sum(FS(A) * avg_weight(A))` for all function `A`.
* Whole program sample overlap: `PSO = common_samples / total_samples`.
* Function overlap: `FO = #common_function / #total_function`.
* Hot-function overlap: `HFO = #common_hot_function / #total_hot_function`.
* Hot-block overlap: `HBO = #common_hot_block / #total_hot_block`.
* Function-level details
* Function-level similarity is an aggregate over line/block-level similarities `BS` of all sample lines/blocks in the function, weighted by the closeness of the function's weights in two profiles: `FS = sum(BS(i)) * (1 - weight_distance(A))`.
* Function-level sample overlap: `FSO = common_samples / total_samples` for samples in the function.
Reviewed By: wenlei, hoyFB, wmi
Differential Revision: https://reviews.llvm.org/D83852
Petr Hosek [Sun, 9 Aug 2020 00:08:23 +0000 (17:08 -0700)]
Revert "[CMake] Simplify CMake handling for zlib"
This reverts commit
ccbc1485b55ff4acd21bcfafbf7aec4ed0fd818d which
is still failing on the Windows MLIR bots.
Petr Hosek [Thu, 30 Apr 2020 20:07:13 +0000 (13:07 -0700)]
[CMake] Simplify CMake handling for zlib
Rather than handling zlib handling manually, use find_package from CMake
to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB,
HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is
set to YES, which requires the distributor to explicitly select whether
zlib is enabled or not. This simplifies the CMake handling and usage in
the rest of the tooling.
This is a reland of abb0075 with all followup changes and fixes that
should address issues that were reported in PR44780.
Differential Revision: https://reviews.llvm.org/D79219
Brad Smith [Sat, 8 Aug 2020 22:39:43 +0000 (18:39 -0400)]
Backout a test that is dependent on an uncommited diff. Fix another.
Thomas Lively [Sat, 8 Aug 2020 22:23:11 +0000 (15:23 -0700)]
[WebAssembly] Fix FastISel address calculation bug
Fixes PR47040, in which an assertion was improperly triggered during
FastISel's address computation. The issue was that an `Address` set to
be relative to the FrameIndex with offset zero was incorrectly
considered to have an unset base. When the left hand side of an add
set the Address to be 0 off the FrameIndex, the right side would not
detect that the Address base had already been set and could try to set
the Address to be relative to a register instead, triggering an
assertion.
This patch fixes the issue by explicitly tracking whether an `Address`
has been set rather than interpreting an offset of zero to mean the
`Address` has not been set.
Differential Revision: https://reviews.llvm.org/D85581
Brad Smith [Sat, 8 Aug 2020 21:58:13 +0000 (17:58 -0400)]
fix typo
Brad Smith [Sat, 8 Aug 2020 21:51:19 +0000 (17:51 -0400)]
Hook up OpenBSD 64-bit PowerPC support
Vincent Zhao [Sat, 8 Aug 2020 21:41:44 +0000 (03:11 +0530)]
[MLIR] Consider AffineIfOp when getting the index set of an Op wrapped in nested loops
This diff attempts to resolve the TODO in `getOpIndexSet` (formerly
known as `getInstIndexSet`), which states "Add support to handle IfInsts
surronding `op`".
Major changes in this diff:
1. Overload `getIndexSet`. The overloaded version considers both
`AffineForOp` and `AffineIfOp`.
2. The `getInstIndexSet` is updated accordingly: its name is changed to
`getOpIndexSet` and its implementation is based on a new API `getIVs`
instead of `getLoopIVs`.
3. Add `addAffineIfOpDomain` to `FlatAffineConstraints`, which extracts
new constraints from the integer set of `AffineIfOp` and merges it to
the current constraint system.
4. Update how a `Value` is determined as dim or symbol for
`ValuePositionMap` in `buildDimAndSymbolPositionMaps`.
Differential Revision: https://reviews.llvm.org/D84698
Craig Topper [Sat, 8 Aug 2020 21:05:51 +0000 (14:05 -0700)]
[X86] Remove a DCI.isBeforeLegalize() call from combineVSelectWithAllOnesOrZeros.
This was blocking isTypeLegal call so that we could do a particular
transform on illegal types before type legalization. But the we
create a target specific node using that type. We shouldn't do
that if the type isn't legal. So I think we should just always
make sure the type is legal.
I suspect that in order to get the condition VT to not be a vector
of i1 we already completed type legalization anyway so this probably
doesn't matter much in practice.
Roman Lebedev [Sat, 8 Aug 2020 20:21:08 +0000 (23:21 +0300)]
[Reduce] Rewrite function body delta pass again
It is not enough to replace all uses of users of the function with undef,
the users, we only drop instruction users, so they may stick around.
Let's try different approach - first drop bodies for all the functions
we will drop, which should take care of blockaddress issue the previous
rewrite was dealing with; then, after dropping *all* such bodies,
replace remaining uses with undef (thus all the uses are either
outside of functions, or are in kept functions)
and then finally drop functions.
This seems to work, and passes the *existing* test coverage,
but it is possible that a new issue will be discovered later :)
A new (previously crashing) test added.
Dávid Bolvanský [Sat, 8 Aug 2020 20:44:14 +0000 (22:44 +0200)]
[libcxx-fuzzing] Fixed bug found by -Wstring-concatenation
Craig Topper [Sat, 8 Aug 2020 19:58:49 +0000 (12:58 -0700)]
[X86] Support matching VPTERNLOG when the root node is X86ISD::ANDNP.
Craig Topper [Sat, 8 Aug 2020 19:50:33 +0000 (12:50 -0700)]
[X86] Add VPTERNLOG test cases where the root node will be X86ISD::ANDNP. NFC
We currently fail to match this.
Dávid Bolvanský [Sat, 8 Aug 2020 19:47:01 +0000 (21:47 +0200)]
[AArch64RegisterInfo] Supress new warning
Craig Topper [Sat, 8 Aug 2020 19:00:15 +0000 (12:00 -0700)]
[X86] Remove isSafeToClobberEFLAGS helper and just inline it into the call sites.
This is just a thin wrapper around computeRegisterLivness which
we can just call directly. The only real difference is that
isSafeToClobberEFLAGS returns a bool and computeRegisterLivness
returns an enum. So we need to check for the specific enum value
that isSafeToClobberEFLAGS was hiding.
I've also adjusted which sites pass an explicit value for
Neighborhood since the default for computeRegisterLivness is 10.
Muhammad Omair Javaid [Fri, 7 Aug 2020 22:35:15 +0000 (03:35 +0500)]
[LLDB] Fix timeout value on expect_gdbremote_sequence
D83904 seems to have changed timeout value on expect_gdbremote_sequence which
was 120 previously. This seems to be causing intermittent failures on
lldb-aarch64-ubuntu buildbot.
This patch fixes the timeout value to see the impact on test suite.
Example:
http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/7401/steps/test/logs/stdio
Differential Revision: https://reviews.llvm.org/D85514
Craig Topper [Sat, 8 Aug 2020 18:38:50 +0000 (11:38 -0700)]
Recommit "[X86] Increase the number of instructions searched for isSafeToClobberEFLAGS in a couple places"
I messed up the bug numbers in the commit message before
Previously this function searched 4 instructions forwards or
backwards to determine if it was ok to clobber eflags.
This is called in 3 places: rematerialization, turning 2 operand
leas into adds or splitting 3 ops leas into an lea and add on some
CPU targets.
This patch increases the search limit to 10 instructions for
rematerialization and 2 operand lea to add. I've left the old
treshold for 3 ops lea spliting as that increases code size.
Fixes PR47024 and PR46315.
Craig Topper [Sat, 8 Aug 2020 18:38:26 +0000 (11:38 -0700)]
Revert "[X86] Increase the number of instructions searched for isSafeToClobberEFLAGS in a couple places"
This reverts commit
44b260cb0aab387d85e4d59c16fc7b8866264f5e.
I messed up the bug number in the commit message so I'm reverting
to fix it.
Dávid Bolvanský [Sat, 8 Aug 2020 18:45:24 +0000 (20:45 +0200)]
[FileCheckTest] Supress new warning
Simon Pilgrim [Sat, 8 Aug 2020 18:35:57 +0000 (19:35 +0100)]
[X86][SSE] combineTargetShuffle - use scaleShuffleMask helper to widen shuffle mask. NFCI.
Use scaleShuffleMask helper for the shuffle(hadd,hadd) canonicalization.
Craig Topper [Sat, 8 Aug 2020 18:03:16 +0000 (11:03 -0700)]
[X86] Increase the number of instructions searched for isSafeToClobberEFLAGS in a couple places
Previously this function searched 4 instructions forwards or
backwards to determine if it was ok to clobber eflags.
This is called in 3 places: rematerialization, turning 2 operand
leas into adds or splitting 3 ops leas into an lea and add on some
CPU targets.
This patch increases the search limit to 10 instructions for
rematerialization and 2 operand lea to add. I've left the old
treshold for 3 ops lea spliting as that increases code size.
Fixes PR47024 and PR43014
Simon Pilgrim [Sat, 8 Aug 2020 18:26:02 +0000 (19:26 +0100)]
[InstCombine] Use CreateVectorSplat(ElementCount) variant directly
This was introduced at rGe20223672100, and the CreateVectorSplat(unsigned NumElements) variant calls it internally
Simon Pilgrim [Sat, 8 Aug 2020 18:12:11 +0000 (19:12 +0100)]
Fix MSVC "not all control paths return a value" warning. NFC.
Brad Smith [Sat, 8 Aug 2020 17:49:45 +0000 (13:49 -0400)]
Change the default target CPU for OpenBSD/i386 to i586
Dávid Bolvanský [Sat, 8 Aug 2020 17:37:50 +0000 (19:37 +0200)]
[Clang] Fixed buildboit failure; bot defaults to older C++ standard
Dávid Bolvanský [Sat, 8 Aug 2020 17:34:07 +0000 (19:34 +0200)]
[Clang] Avoid whitespace in fixit note
Dávid Bolvanský [Sat, 8 Aug 2020 17:22:44 +0000 (19:22 +0200)]
[Diagnostics] Diagnose missing comma in string array initialization
Motivation (from PR37674):
const char *ss[] = {
"foo", "bar",
"baz", "qux" // <-- Missing comma!
"abc", "xyz"
};
This kind of bug was recently also found in LLVM codebase (see PR47030).
Solves PR47038, PR37674
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D85545
Roman Lebedev [Sat, 8 Aug 2020 14:57:32 +0000 (17:57 +0300)]
[SimplifyCFG] Fix invoke->call fold w/ multiple invokes in presence of lifetime intrinsics
SimplifyCFG has two main folds for resumes - one when resume is directly
using the landingpad, and the other one where resume is using a PHI node.
While for the first case, we were already correctly ignoring all the
PHI nodes, and both the debug info intrinsics and lifetime intrinsics,
in the PHI-based-one, we weren't ignoring PHI's in the resume block,
and weren't ignoring lifetime intrinsics. That is clearly a bug.
On RawSpeed library, this results in +9.34% (+81) more invoke->call folds,
-0.19% (-39) landing pads, -0.24% (-81) invoke instructions
but +51 call instructions and -132 basic blocks.
Though, the run-time performance impact appears to be within the noise.
Roman Lebedev [Sat, 8 Aug 2020 14:20:36 +0000 (17:20 +0300)]
[NFC][SimplifyCFG] Rewrite isCleanupBlockEmpty() to be iterator_range-based
Roman Lebedev [Sat, 8 Aug 2020 13:53:30 +0000 (16:53 +0300)]
[NFC][SimplifyCFG] Add a test showing invoke->call simplification failure
Roman Lebedev [Sat, 8 Aug 2020 13:46:31 +0000 (16:46 +0300)]
[NFC][SimplifyCFG] Count the number of invokes turned into calls due to empty cleanup blocks
Fangrui Song [Sat, 8 Aug 2020 16:24:08 +0000 (09:24 -0700)]
[ELF] --wrap: set isUsedInRegularObj of __wrap_ if it is defined or shared
Fixes PR47017 (a regression when fixing PR46169): if __wrap_ is shared,
it is not exported.
Sanjay Patel [Fri, 7 Aug 2020 20:57:27 +0000 (16:57 -0400)]
[DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP division, part 2
Follow-up to D82716 / rGea71ba11ab11
We do not have the fabs removal fold in IR yet for the case
where the sqrt operand is repeated, so that's another potential
improvement.
Sanjay Patel [Fri, 7 Aug 2020 16:27:55 +0000 (12:27 -0400)]
[x86] add tests for another reciprocal sqrt pattern; NFC
Benjamin Kramer [Sat, 8 Aug 2020 11:40:24 +0000 (13:40 +0200)]
lib/CodeGen doesn't depend on lib/Passes.
Rainer Orth [Sat, 8 Aug 2020 07:13:47 +0000 (09:13 +0200)]
[test][DebugInfo] Adapt two tests for Sun assembler syntax on Sparc
Two DebugInfo tests currently `FAIL` on Sparc:
LLVM :: DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
LLVM :: DebugInfo/Generic/array.ll
both in a similar way. E.g.
: 'RUN: at line 1'; /var/llvm/local-sparcv9-A/bin/llc -O2 /vol/llvm/src/llvm-project/local/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll -o - | /var/llvm/local-sparcv9-A/bin/FileCheck /vol/llvm/src/llvm-project/local/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
/vol/llvm/src/llvm-project/local/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll:4:10: error: CHECK: expected string not found in input
; CHECK: debug_info,
^
On `amd64-pc-solaris2.11`, the corresponding line is
.section .debug_info,"",@progbits
while on `sparcv9-sun-solaris2.11` we have only
.section .debug_info
This happens because Sparc currently emits `.section` directives using the
style of the Solaris/SPARC assembler (controlled by `SunStyleELFSectionSwitchSyntax`).
This patch takes the easy way out and allows both forms while tightening the
check to only match the `.section` directive.
Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`,
`x86_64-pc-linux-gnu`, and `x86_64-apple-darwin20.0.0`.
Differential Revision: https://reviews.llvm.org/D85414
Siva Chandra Reddy [Sat, 8 Aug 2020 06:45:18 +0000 (23:45 -0700)]
[libc][NFC] Disable a loader test as ld.gold fails to link.
Will be reenabled after investigating and fixing the problem.
Siva Chandra Reddy [Thu, 6 Aug 2020 07:19:08 +0000 (00:19 -0700)]
[libc][NFC] Add library of floating point test matchers.
This eliminates UnitTest's dependency on FPUtil and hence prevents
non-math tests from depending indirectly on FPUtil. The patch
essentially moves some of the existing pieces into a library of its own.
Along the way, renamed add_math_unittest to add_fp_unittest.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D85486
Feng Liu [Sat, 8 Aug 2020 06:23:06 +0000 (23:23 -0700)]
Add the inline interface to the shape dialect
This patch also fixes a minor issue that shape.rank should allow
returning !shape.size. The dialect doc has such an example for
shape.rank.
Differential Revision: https://reviews.llvm.org/D85556
Juneyoung Lee [Fri, 7 Aug 2020 12:12:52 +0000 (21:12 +0900)]
[InstCombine] Optimize select(freeze(icmp eq/ne x, y), x, y)
This patch adds an optimization that folds select(freeze(icmp eq/ne x, y), x, y)
to x or y.
This was needed to resolve slowdown after D84940 is applied.
I tried to bake this logic into foldSelectInstWithICmp, but it wasn't clear.
This patch conservatively writes the pattern in a separate function,
foldSelectWithFrozenICmp.
The output does not need freeze; https://alive2.llvm.org/ce/z/X49hNE (from @nikic)
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D85533
Siva Chandra Reddy [Wed, 24 Jun 2020 21:12:46 +0000 (14:12 -0700)]
[libc] Setup TLS in x86_64 loader.
The new code added is still very x86_64 specific. AArch64 support will
be added very soon and refactoring of the loader code will be done as
part of the patches adding it.
Reviewed By: asteinhauser
Differential Revision: https://reviews.llvm.org/D82700
Juneyoung Lee [Fri, 7 Aug 2020 12:11:58 +0000 (21:11 +0900)]
[InstCombine] Add tests for select(freeze(icmp x, y), x, y); NFC
Craig Topper [Sat, 8 Aug 2020 05:51:49 +0000 (22:51 -0700)]
[X86] Limit the scope of the min/max canonicalization in combineSelect
Previously the transform was doing these two canonicalizations
(x > y) ? x : y -> (x >= y) ? x : y
(x < y) ? x : y -> (x <= y) ? x : y
But those don't seem to be useful generally. And they actively
pessimize the cases in PR47049.
This patch limits it to
(x > 0) ? x : 0 -> (x >= 0) ? x : 0
(x < -1) ? x : -1 -> (x <= -1) ? x : -1
These are the cases mentioned in the comments as the motivation
for the canonicalization. These allow the CMOV to use the S
flag from the compare thus improving opportunities to use a TEST
or the flags from an arithmetic instruction.
Mehdi Amini [Sat, 8 Aug 2020 05:37:42 +0000 (05:37 +0000)]
Remove unused static helper getMemRefTypeFromTensorType() (NFC)
Mehdi Amini [Sat, 8 Aug 2020 05:36:41 +0000 (05:36 +0000)]
Remove unused class member (NFC)
Fix include/mlir/Reducer/ReductionNode.h:79:18: warning: private field 'parent' is not used [-Wunused-private-field]
Mehdi Amini [Sat, 8 Aug 2020 05:31:25 +0000 (05:31 +0000)]
Revert "[mlir] Add a utility class, ThreadLocalCache, for storing non static thread local objects."
This reverts commit
9f24640b7e6e61b0f293c724155a90a5e446dd7a.
We hit some dead-locks on thread exit in some configurations: TLS exit handler is taking a lock.
Temporarily reverting this change as we're debugging what is going on.
Fangrui Song [Sat, 8 Aug 2020 05:08:00 +0000 (22:08 -0700)]
[ELF] Support .cfi_signal_frame
glibc/sysdeps/unix/sysv/linux/x86_64/sigaction.c libc.a(sigaction.o) has a CIE
with the augmentation string "zRS". Support 'S' to allow --icf={safe,all}.
Vincent Zhao [Thu, 6 Aug 2020 20:25:49 +0000 (01:55 +0530)]
[MLIR] Add tiling validity check to loop tiling pass
This revision aims to provide a new API, `checkTilingLegality`, to
verify that the loop tiling result still satisifes the dependence
constraints of the original loop nest.
Previously, there was no check for the validity of tiling. For instance:
```
func @diagonal_dependence() {
%A = alloc() : memref<64x64xf32>
affine.for %i = 0 to 64 {
affine.for %j = 0 to 64 {
%0 = affine.load %A[%j, %i] : memref<64x64xf32>
%1 = affine.load %A[%i, %j - 1] : memref<64x64xf32>
%2 = addf %0, %1 : f32
affine.store %2, %A[%i, %j] : memref<64x64xf32>
}
}
return
}
```
You can find more information about this example from the Section 3.11
of [1].
In general, there are three types of dependences here: two flow
dependences, one in direction `(i, j) = (0, 1)` (notation that depicts a
vector in the 2D iteration space), one in `(i, j) = (1, -1)`; and one
anti dependence in the direction `(-1, 1)`.
Since two of them are along the diagonal in opposite directions, the
default tiling method in `affine`, which tiles the iteration space into
rectangles, will violate the legality condition proposed by Irigoin and
Triolet [2]. [2] implies two tiles cannot depend on each other, while in
the `affine` tiling case, two rectangles along the same diagonal are
indeed dependent, which simply violates the rule.
This diff attempts to put together a validator that checks whether the
rule from [2] is violated or not when applying the default tiling method
in `affine`.
The canonical way to perform such validation is by examining the effect
from adding the constraint from Irigoin and Triolet to the existing
dependence constraints.
Since we already have the prior knowlegde that `affine` tiles in a
hyper-rectangular way, and the resulting tiles will be scheduled in the
same order as their respective loop indices, we can simplify the
solution to just checking whether all dependence components are
non-negative along the tiling dimensions.
We put this algorithm into a new API called `checkTilingLegality` under
`LoopTiling.cpp`. This function iterates every `load`/`store` pair, and
if there is any dependence between them, we get the dependence component
and check whether it has any negative component. This function returns
`failure` if the legality condition is violated.
[1]. Bondhugula, Uday. Effective Automatic parallelization and locality optimization using the Polyhedral model. https://dl.acm.org/doi/book/10.5555/1559029
[2]. Irigoin, F. and Triolet, R. Supernode Partitioning. https://dl.acm.org/doi/10.1145/73560.73588
Differential Revision: https://reviews.llvm.org/D84882
Richard Smith [Sat, 8 Aug 2020 01:17:24 +0000 (18:17 -0700)]
PR47025, PR47043: Diagnose unexpanded parameter packs in concept
declarations and requires-expressions.
Keno Fischer [Fri, 7 Aug 2020 20:38:15 +0000 (16:38 -0400)]
[X86] Don't produce bad x86andp nodes for i1 vectors
In D85499, I attempted to fix this same issue by canonicalizing
andnp for i1 vectors, but since there was some opposition to such
a change, this commit just fixes the bug by using two different
forms depending on which kind of vector type is in use. We can
then always decide to switch the canonical forms later.
Description of the original bug:
We have a DAG combine that tries to fold (vselect cond, 0000..., X) -> (andnp cond, x).
However, it does so by attempting to create an i64 vector with the number
of elements obtained by truncating division by 64 from the bitwidth. This is
bad for mask vectors like v8i1, since that division is just zero. Besides,
we don't want i64 vectors anyway. For i1 vectors, switch the pattern
to (andnp (not cond), x), which is the canonical form for `kandn`
on mask registers.
Fixes https://github.com/JuliaLang/julia/issues/36955.
Differential Revision: https://reviews.llvm.org/D85553
LLVM GN Syncbot [Fri, 7 Aug 2020 23:43:14 +0000 (23:43 +0000)]
[gn build] Port
f5b5ccf2a68
Yuanfang Chen [Fri, 7 Aug 2020 19:57:38 +0000 (12:57 -0700)]
Reland "Revert "[NewPM][CodeGen] Introduce machine pass and machine pass manager""
This relands commit
320eab2d558fde0b61437e9b9075bfd301c2c474.
The test failed because it was looking for x86-linux target
unconditionally. Now it gets the default target.
peter klausler [Fri, 7 Aug 2020 20:25:11 +0000 (13:25 -0700)]
[flang] Handle DATA initialization of EQUIVALENCE'd objects
Objects that are storage associated by EQUIVALENCE and
initialized with DATA are initialized by creating a
compiler temporary data object in the same scope,
assigning it an offset, type, and size that covers the
transitive closure of the associated initialized original
symbols, and combining their initializers into one common
initializer for the temporary.
Some problems with offset assignment of EQUIVALENCE'd objects
in COMMON were exposed and corrected, and some more error
cases are checked.
Remove obsolete function.
Small bugfix (nested implied dos).
Add a test.
Fix struct/class warning.
Differential Revision: https://reviews.llvm.org/D85560
Matt Arsenault [Thu, 6 Aug 2020 23:59:25 +0000 (19:59 -0400)]
AMDGPU: Avoid explicitly listing all the memory nodes
Vitaly Buka [Fri, 7 Aug 2020 23:18:10 +0000 (16:18 -0700)]
[NFC][StackSafety] Fix statistics
Teresa Johnson [Fri, 7 Aug 2020 22:52:50 +0000 (15:52 -0700)]
[sanitizer] Fix comment (NFC)
As pointed out in D85387, part of the comment for MapDynamicShadow
refactored to sanitizer_common in D83247 was incorrect for non-Linux
versions. Update the comment to reflect that.
Mauricio Sifontes [Fri, 7 Aug 2020 23:17:27 +0000 (23:17 +0000)]
Create Reduction Tree Pass
Implement the Reduction Tree Pass framework as part of the MLIR Reduce tool. This is a parametarizable pass that allows for the implementation of custom reductions passes in the tool.
Implement the FunctionReducer class as an example of a Reducer class parameter for the instantiation of a Reduction Tree Pass.
Create a pass pipeline with a Reduction Tree Pass with the FunctionReducer class specified as parameter.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D83969
Nick Desaulniers [Fri, 7 Aug 2020 23:11:41 +0000 (16:11 -0700)]
Revert "[Clang] implement -fno-eliminate-unused-debug-types"
This reverts commit
e486921fd6cf96ae9114adac455f7c0b5c1088a7.
Breaks windows builds and osx builds.
Nick Desaulniers [Fri, 7 Aug 2020 23:11:26 +0000 (16:11 -0700)]
Revert "fix windows build for D80242"
This reverts commit
cbd8ec93709376fbf404c99f4eee399790e26db7.
cchen [Fri, 7 Aug 2020 23:04:56 +0000 (18:04 -0500)]
[OpenMP 5.0] Fix PR-45212: Shouldn't error out while using overloaded operator for map clause
LValue map checker should handle CXXOperatorCallExpr
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D85563
Sean Silva [Fri, 7 Aug 2020 18:40:58 +0000 (11:40 -0700)]
[mlir] Centralize handling of memref element types.
This also beefs up the test coverage:
- Make unranked memref testing consistent with ranked memrefs.
- Add testing for the invalid element type cases.
This is not quite NFC: index types are now allowed in unranked memrefs.
Differential Revision: https://reviews.llvm.org/D85541
Jonas Devlieghere [Fri, 7 Aug 2020 22:06:14 +0000 (15:06 -0700)]
[lldb] Assert the process has exited before we gets its output.
Arthur Eubanks [Fri, 7 Aug 2020 02:03:09 +0000 (19:03 -0700)]
[NewPM] Print 'Skipping pass' as pass instrumentation
If OptNoneInstrumentation prints it instead, 'Skipping pass' will print for even required passes.
Reviewed By: ychen
Differential Revision: https://reviews.llvm.org/D85493
Nick Desaulniers [Fri, 7 Aug 2020 21:59:35 +0000 (14:59 -0700)]
fix windows build for D80242
Mircea Trofin [Fri, 7 Aug 2020 21:56:31 +0000 (14:56 -0700)]
[NFC][MLInliner] Refactor logging implementation
This prepares it for logging externally-specified outputs.
Differential Revision: https://reviews.llvm.org/D85451
Jim Ingham [Fri, 7 Aug 2020 21:44:01 +0000 (14:44 -0700)]
Add a setting to force stepping to always run all threads.
Also allow ScriptedThreadPlans to set & get their StopOthers
state.
<rdar://problem/
64229484>
Differential Revision: https://reviews.llvm.org/D85265
Sameer Arora [Mon, 20 Jul 2020 23:10:07 +0000 (16:10 -0700)]
[llvm-libtool-darwin] Add support for -D and -U options
Add support for `-D` and `-U` options for llvm-libtool-darwin. `-D`
allows for using zero for timestamps and UIDs/GIDs. `-U` allows for
using actual timestamps and UIDs/GIDs.
Reviewed by jhenderson, smeenai
Differential Revision: https://reviews.llvm.org/D84209
Sameer Arora [Mon, 20 Jul 2020 21:27:48 +0000 (14:27 -0700)]
[llvm-libtool-darwin] Add support for -filelist option
Add support for `-filelist` option for llvm-libtool-darwin. `-filelist`
option allows for passing in a file containing a list of filenames.
Reviewed by jhenderson, smeenai
Differential Revision: https://reviews.llvm.org/D84206
Adrian Prantl [Fri, 7 Aug 2020 21:24:03 +0000 (14:24 -0700)]
Factor out reference-counting code from PlatformApple*
into PlatformAppleSimulator. This is legal because that is the only
entry point for the Terminate/Initialize functions.
Nick Desaulniers [Fri, 7 Aug 2020 21:10:04 +0000 (14:10 -0700)]
[Clang] implement -fno-eliminate-unused-debug-types
Fixes pr/11710.
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D80242
Sameer Arora [Fri, 31 Jul 2020 18:52:47 +0000 (11:52 -0700)]
[llvm-libtool-darwin] Add constant CPU_SUBTYPE_ARM64_V8
Add support for constant MachO::CPU_SUBTYPE_ARM64_V8. This constant is
needed so as to match `llvm-libtool-darwin`'s behavior to that of
cctools' libtool when `-arch_only` flag is passed in on command line.
Reviewed by jhenderson, alexshap, smeenai
Differential Revision: https://reviews.llvm.org/D85041