platform/upstream/llvm.git
3 years ago[LLDB] dotest.py set selected_platform on remote connection
Muhammad Omair Javaid [Mon, 28 Jun 2021 21:14:17 +0000 (21:14 +0000)]
[LLDB] dotest.py set selected_platform on remote connection

This patch fixes a bug in dotest.py where lldb.selected_platform was
being set to host platform even after a successful connection to a
remote platform via platform url. This patch fixes this behavior and
sets selected_platform to remote_platform after a successful connection.

This patch also removes target_platform variable from run_suite.

Reviewed By: JDevlieghere

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

3 years ago[DebugInfo] Enforce implicit constraints on `distinct` MDNodes
Scott Linder [Mon, 28 Jun 2021 19:40:45 +0000 (19:40 +0000)]
[DebugInfo] Enforce implicit constraints on `distinct` MDNodes

Add UNIQUED and DISTINCT properties in Metadata.def and use them to
implement restrictions on the `distinct` property of MDNodes:

* DIExpression can currently be parsed from IR or read from bitcode
  as `distinct`, but this property is silently dropped when printing
  to IR. This causes accepted IR to fail to round-trip. As DIExpression
  appears inline at each use in the canonical form of IR, it cannot
  actually be `distinct` anyway, as there is no syntax to describe it.
* Similarly, DIArgList is conceptually always uniqued. It is currently
  restricted to only appearing in contexts where there is no syntax for
  `distinct`, but for consistency it is treated equivalently to
  DIExpression in this patch.
* DICompileUnit is already restricted to always being `distinct`, but
  along with adding general support for the inverse restriction I went
  ahead and described this in Metadata.def and updated the parser to be
  general. Future nodes which have this restriction can share this
  support.

The new UNIQUED property applies to DIExpression and DIArgList, and
forbids them to be `distinct`. It also implies they are canonically
printed inline at each use, rather than via MDNode ID.

The new DISTINCT property applies to DICompileUnit, and requires it to
be `distinct`.

A potential alternative change is to forbid the non-inline syntax for
DIExpression entirely, as is done with DIArgList implicitly by requiring
it appear in the context of a function. For example, we would forbid:

    !named = !{!0}
    !0 = !DIExpression()

Instead we would only accept the equivalent inlined version:

    !named = !{!DIExpression()}

This essentially removes the ability to create a `distinct` DIExpression
by construction, as there is no syntax for `distinct` inline. If this
patch is accepted as-is, the result would be that the non-canonical
version is accepted, but the following would be an error and produce a diagnostic:

    !named = !{!0}
    ; error: 'distinct' not allowed for !DIExpression()
    !0 = distinct !DIExpression()

Also update some documentation to consistently use the inline syntax for
DIExpression, and to describe the restrictions on `distinct` for nodes
where applicable.

Reviewed By: StephenTozer, t-tye

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

3 years ago[AsmWriter] Properly handle uselistorder for global symbols
Nikita Popov [Sat, 26 Jun 2021 13:42:49 +0000 (15:42 +0200)]
[AsmWriter] Properly handle uselistorder for global symbols

Currently, AsmWriter will stick uselistorder directives for global
values inside individual functions. This doesn't make a lot of sense,
and interacts badly with D104950, as use list order adjustments will
be performed while still working on a forward reference.

This patch instead always prints uselistorder directives for globals
at the module level. This isn't really compatible with the previously
used implementation approach. Rather than walking through all values
again, use the OrderMap (after stabilizing its order) to go through
all values and compute the use list shuffles for them. Classify them
per-function, or nullptr for globals.

Even independently of D104950, this seems to fix a few
verify-uselistorder failures. Conveniently, there is even a
pre-existing failing test that this fixes.

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

3 years ago[OpenMP][Documentation] Add FAQ entry for CMake module
Joseph Huber [Mon, 28 Jun 2021 19:34:15 +0000 (15:34 -0400)]
[OpenMP][Documentation] Add FAQ entry for CMake module

This patch adds documentation for using the CMake find module for OpenMP
target offloading provided by LLVM. It also removes the requirement for
AMD's architecture to be set as this isn't necessary for upstream LLVM.

Reviewed By: jdoerfert

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

3 years ago[OpenMP][Documentation] Add OpenMPOpt optimization section
Joseph Huber [Mon, 28 Jun 2021 19:21:18 +0000 (15:21 -0400)]
[OpenMP][Documentation] Add OpenMPOpt optimization section

Add some information about the optimizations currently provided by
OpenMPOpt. Every optimization performed should eventually be listed
here.

Reviewed By: jdoerfert

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

3 years ago[mlir] Skip scalar operands when tiling to linalg.tiled_loop.
Alexander Belyaev [Mon, 28 Jun 2021 20:20:30 +0000 (22:20 +0200)]
[mlir] Skip scalar operands when tiling to linalg.tiled_loop.

We are interested only in tensors/memrefs when creating a TiledLoopOp.

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

3 years ago[InstCombine] don't try to fold a constant expression that can trap (PR50906)
Sanjay Patel [Mon, 28 Jun 2021 20:37:10 +0000 (16:37 -0400)]
[InstCombine] don't try to fold a constant expression that can trap (PR50906)

We could use a bigger hammer and bail out on any constant
expression, but there's a regression test that appears to
validly do the transform (although it may not have been
intending to check that optimization).

3 years ago[InstCombine][test] add test for potential miscompile with constant expression; NFC...
Sanjay Patel [Mon, 28 Jun 2021 19:57:38 +0000 (15:57 -0400)]
[InstCombine][test] add test for potential miscompile with constant expression; NFC (PR50906)

3 years ago[IR] remove assert since always_inline can appear on CallBase
Nick Desaulniers [Mon, 28 Jun 2021 20:53:55 +0000 (13:53 -0700)]
[IR] remove assert since always_inline can appear on CallBase

I added an assertion in D91816 (documenting behavior added in D93422)
that callers and callees with mismatched fn attr's related to stack
protectors should not occur unless the callee was attributed
always_inline.

This falls apart when a call, invoke, or callbr (any instruction
inheriting from CallBase) itself has an always_inline attribute. Clang
will emit such attributes on Instructions when __attribute__((flatten))
is used to recursively force inlining from a caller.

Since these assertions only had the caller and callee Functions, and not
the call site (CallBase derived classes), we would have to search the
caller for such instructions to reconstruct the call site information.
But at that point, inlining has already occurred; the call site has
already been removed from the caller.

Remove the assertions, add a unit test for always_inline call sites, and
update the LangRef.

Another curiosity is that the always_inline Attribute on Instructions is
only expanded by the inline pass, not the always_inline pass.

Thanks to @pcc on this report when building Android's RunTime (ART)
interpreter.

Reviewed By: pcc, MaskRay

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

3 years ago[Test] rewrite inline_nossp.ll
Nick Desaulniers [Mon, 28 Jun 2021 20:52:41 +0000 (13:52 -0700)]
[Test] rewrite inline_nossp.ll

While adding remark based tests in D104944, I noticed that the tests
that we were passing were passing for the wrong reason. They were
passing because the dynamic allocas were preventing inlining, not the
code I added in D91816.

Rewrite and simplify the test. Add remark based checks to validate we're
preventing inline substitutions for the right reasons.

Reviewed By: MaskRay

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

3 years ago[OpenMP] Prevent OpenMPOpt from internalizing uncalled functions
Joseph Huber [Fri, 25 Jun 2021 00:42:31 +0000 (20:42 -0400)]
[OpenMP] Prevent OpenMPOpt from internalizing uncalled functions

Currently OpenMPOpt will only check if a function is a kernel before deciding not to internalize it. Any uncalled function that gets internalized will be trivially dead in the module so this is unnnecessary.

Depends on D102423

Reviewed By: jdoerfert

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

3 years ago[drr] Enable specifying range in NativeCodeCall replacement.
Jacques Pienaar [Mon, 28 Jun 2021 20:42:16 +0000 (13:42 -0700)]
[drr] Enable specifying range in NativeCodeCall replacement.

This enables creating a replacement rule where range of positional replacements
need not be spelled out, or are not known (e.g., enable having a rewrite that
forward all operands to a call generically).

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

3 years ago[mlir] Destroy MLIRContext thread pool when disable multi threading
Eugene Zhulenev [Mon, 28 Jun 2021 20:15:24 +0000 (13:15 -0700)]
[mlir] Destroy MLIRContext thread pool when disable multi threading

Reviewed By: rriddle

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

3 years ago[SanitizerCoverage] Support opaque pointers
Nikita Popov [Mon, 28 Jun 2021 19:12:12 +0000 (21:12 +0200)]
[SanitizerCoverage] Support opaque pointers

Pass element type rather than pointer type to some functions, so
we know which type to use for the global variables.

3 years ago[ADT] Add makeVisitor to STLExtras.h
Scott Linder [Mon, 28 Jun 2021 19:54:14 +0000 (19:54 +0000)]
[ADT] Add makeVisitor to STLExtras.h

Relands patch reverted by 61242c0addb120294211d24a97ed89837418cb36
The original patch mistakenly included unrelated tests.

Adds a utility to combine multiple Callables into a single Callable.
This is useful to make constructing a visitor for `std::visit`-like
functions more natural; functions like this will be added in future
patches.

Intended to supercede https://reviews.llvm.org/D99560 by
perfectly-forwarding the combined Callables.

Reviewed By: dblaikie

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

3 years agoIR: Fix use-list-order round-tripping for br
Duncan P. N. Exon Smith [Fri, 25 Jun 2021 23:38:41 +0000 (16:38 -0700)]
IR: Fix use-list-order round-tripping for br

Fix the use-list-order for br instructions by setting the operands in
order of their index to match the use-list-order prediction. The case
where this matters is when there is a condition but the if-true and
if-false branches are identical.

Bug was found when reviewing failures pointed at by
https://reviews.llvm.org/D104950. Fix is similar to
3cf415c6c367ced43175ebd1dc4bd9582c7f5376.

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

3 years agoRevert "[ADT] Add makeVisitor to STLExtras.h"
Scott Linder [Mon, 28 Jun 2021 19:51:25 +0000 (19:51 +0000)]
Revert "[ADT] Add makeVisitor to STLExtras.h"

This reverts commit 14a8aa615597ef0aa424ac9545906bf8b9865063.

Mistakenly landed this before a patch it should depend on was accepted.

3 years agoRevert "[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine...
Melanie Blower [Mon, 28 Jun 2021 19:47:03 +0000 (15:47 -0400)]
Revert "[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine to allow diagnostics on target-unsupported options"

This reverts commit 2dbe1c675fe94eeb7973dcc25b049d25f4ca4fa0.
More buildbot failures

3 years ago[Verifier] Support opaque pointers for global_ctors
Nikita Popov [Mon, 28 Jun 2021 19:24:16 +0000 (21:24 +0200)]
[Verifier] Support opaque pointers for global_ctors

Adjust the assertion to allow opaque pointers.

3 years ago[ADT] Add makeVisitor to STLExtras.h
Scott Linder [Mon, 28 Jun 2021 18:54:41 +0000 (18:54 +0000)]
[ADT] Add makeVisitor to STLExtras.h

Adds a utility to combine multiple Callables into a single Callable.
This is useful to make constructing a visitor for `std::visit`-like
functions more natural; functions like this will be added in future
patches.

Intended to supercede https://reviews.llvm.org/D99560 by
perfectly-forwarding the combined Callables.

Reviewed By: dblaikie

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

3 years ago[flang] Fix "non-advancing" I/O, support $ in FORMAT
peter klausler [Mon, 28 Jun 2021 18:41:04 +0000 (11:41 -0700)]
[flang] Fix "non-advancing" I/O, support $ in FORMAT

Non-advancing I/O was failing; ExternalFileUnit was losing
track of what writes had been committed to the file.  Fixed.
Also, support the common extension of $ and \ in a FORMAT
as being equivalent to ADVANCE=NO.

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

3 years ago[clang-tidy] Add -line-filter to run-clang-tidy.py
Kirill Bobyrev [Mon, 28 Jun 2021 19:15:00 +0000 (21:15 +0200)]
[clang-tidy] Add -line-filter to run-clang-tidy.py

This patch allows the use of --line-filter in clang-tidy.py from
run-clang-tidy.py

Author: [bansan (Vincent LE GARREC)](https://reviews.llvm.org/p/bansan/)

Reviewed By: kbobyrev

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

3 years ago[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine to allow...
Melanie Blower [Mon, 28 Jun 2021 19:09:27 +0000 (15:09 -0400)]
[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine to allow diagnostics on target-unsupported options

Reviewed By: aaron.ballman

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

3 years ago[clangd] Add a flag to disable formatting of tweak edits
Kadir Cetinkaya [Mon, 28 Jun 2021 16:11:22 +0000 (18:11 +0200)]
[clangd] Add a flag to disable formatting of tweak edits

Some tweaks might edit file types not supported by clang-format. This
patch gives them a way to signal that they do not require formatting.

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

3 years ago[Clang] [NFC] fix CHECK lines for convergent attribute tests
Sameer Sahasrabuddhe [Mon, 28 Jun 2021 08:13:02 +0000 (13:43 +0530)]
[Clang] [NFC] fix CHECK lines for convergent attribute tests

3 years ago[lld-macho][nfc] Remove unnecessary dyn_cast and simplify code
Jez Ng [Sat, 26 Jun 2021 21:38:25 +0000 (17:38 -0400)]
[lld-macho][nfc] Remove unnecessary dyn_cast and simplify code

3 years ago[lld-macho][nfc] Add absolute-vs-non-absolute symbol test for ICF
Jez Ng [Mon, 28 Jun 2021 18:43:36 +0000 (14:43 -0400)]
[lld-macho][nfc] Add absolute-vs-non-absolute symbol test for ICF

Make sure we don't wrongly fold two sections that refer to
symbols with the same value if they are not both absolute /
non-absolute.

Reviewed By: #lld-macho, gkm

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

3 years ago[lld-macho] Extend ICF to literal sections
Jez Ng [Mon, 28 Jun 2021 18:43:34 +0000 (14:43 -0400)]
[lld-macho] Extend ICF to literal sections

Literal sections can be deduplicated before running ICF. That makes it
easy to compare them during ICF: we can tell if two literals are
constant-equal by comparing their offsets in their OutputSection.

LLD-ELF takes a similar approach.

Reviewed By: #lld-macho, gkm

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

3 years ago[flang] Implement user-defined derived type runtime I/O
peter klausler [Fri, 25 Jun 2021 17:40:08 +0000 (10:40 -0700)]
[flang] Implement user-defined derived type runtime I/O

With derived type description tables now available to the
runtime library, it is possible to implement the concept
of "child" I/O statements in the runtime and use them to
convert instances of derived type I/O data transfers into
calls to user-defined subroutines when they have been specified
for a type.  (See Fortran 2018, subclauses 12.6.4.8 & 13.7.6).

 - Support formatted, list-directed, and NAMELIST
   transfers to internal parent units; support these, and unformatted
   transfers, for external parent units.
 - Support nested child defined derived type I/O.
 - Parse DT'foo'(v-list) FORMAT data edit descriptors and passes
   their strings &/or v-list values as arguments to the defined
   formatted I/O routines.
 - Fix problems with this feature encountered in semantics and
   FORMAT valiation during development and end-to-end testing.
 - Convert typeInfo::SpecialBinding from a struct to a class
   after adding a member function.

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

3 years ago[libc++] NFCI: Remove unused Lit parameter sanitizer_library
Louis Dionne [Mon, 28 Jun 2021 18:20:45 +0000 (14:20 -0400)]
[libc++] NFCI: Remove unused Lit parameter sanitizer_library

3 years ago[flang] Fix conformability for intrinsic procedures
Peter Steinfeld [Fri, 25 Jun 2021 18:28:30 +0000 (11:28 -0700)]
[flang] Fix conformability for intrinsic procedures

There are situations where the arguments of intrinsics must be
conformable, which is defined in section 3.36.  This means they must
have "the same shape, or one being an array and the other being scalar".
But the check we were actually making was that their ranks were the same.

This change fixes that and adds a test for the UNPACK intrinsic, where
the FIELD argument "shall be conformable with MASK".

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

3 years ago[SystemZ][z/OS][libcxx]: fix libcxx test cases failed on ebcdic mode on z/OS
Nancy Wang [Mon, 28 Jun 2021 18:04:02 +0000 (14:04 -0400)]
[SystemZ][z/OS][libcxx]: fix libcxx test cases failed on ebcdic mode on z/OS

This patch is to fix 2 libcxx test cases, test cases assumed 'a' > 'A' which is not case in z/OS platform on ebcdic mode, modified test cases to compare between upper letters or lower letters, or digits so ordering will be true for all platform.

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

3 years ago[ObjC][ARC] Ignore operand bundle "clang.arc.attachedcall" on a call if
Akira Hatanaka [Mon, 28 Jun 2021 18:02:30 +0000 (11:02 -0700)]
[ObjC][ARC] Ignore operand bundle "clang.arc.attachedcall" on a call if
the call's return type is void

Instead of trying hard to prevent global optimization passes such as
deadargelim from changing the return type to void, just ignore the
bundle if the return type is void. clang currently emits calls to
@llvm.objc.clang.arc.noop.use, which consumes the function call result,
immediately after the function call to prevent changes to the return
type, but optimization passes can delete the call to
@llvm.objc.clang.arc.noop.use if the function call doesn't return, which
enables deadargelim to change the return type.

rdar://76671438

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

3 years ago[hwasan] print exact mismatch offset for short granules.
Florian Mayer [Mon, 28 Jun 2021 10:34:30 +0000 (11:34 +0100)]
[hwasan] print exact mismatch offset for short granules.

Reviewed By: eugenis

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

3 years ago[lldb] Avoid using any shell when calling xcrun.
Raphael Isemann [Mon, 28 Jun 2021 16:58:42 +0000 (18:58 +0200)]
[lldb] Avoid using any shell when calling xcrun.

When we run `xcrun` we don't have any user input in our command so relying on
the user's default shell doesn't make a lot of sense. If the user has set the
system shell to a something that isn't supported yet (dash, ash) then we would
run into the problem that we don't know how to escape our command string.

This patch just avoids using any shell at all as xcrun is always at the same
path.

Reviewed By: aprantl, JDevlieghere, kastiglione

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

3 years agoRevert "[MLIR][SCF] Inline ExecuteRegion if parent can contain multiple blocks"
William S. Moses [Mon, 28 Jun 2021 17:52:30 +0000 (13:52 -0400)]
Revert "[MLIR][SCF] Inline ExecuteRegion if parent can contain multiple blocks"

This reverts commit 5d6240b77e7e7199fcf0e89f6dd2f7eea3596a3c.

The commit was mistakenly landed without a PR approval, this will be
reverted now and resubmitted.

3 years agoAdd papers adopted by the C++ committee in the June 2021 plenary
Corentin Jabot [Mon, 28 Jun 2021 17:45:12 +0000 (13:45 -0400)]
Add papers adopted by the C++ committee in the June 2021 plenary

3 years ago[lldb] Remove spurious lldb/lldb subdirectory
Jonas Devlieghere [Mon, 28 Jun 2021 17:38:18 +0000 (10:38 -0700)]
[lldb] Remove spurious lldb/lldb subdirectory

Remove the lldb/lldb subdirectory which I must have accidentally created
when applying a patch with the wrong prefix number.

Thank you Nico Weber for pointing this out!

3 years ago[mlir][tosa] Update Tosa conv verifier to handle IntegerType input
Rob Suderman [Mon, 28 Jun 2021 17:17:32 +0000 (10:17 -0700)]
[mlir][tosa] Update Tosa conv verifier to handle IntegerType input

Input/output types can be integers, which represent a quantized convolution.
Update verifier to expect this behavior.

Reviewed By: sjarus

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

3 years ago[Hexagon] Add patterns to load i1
Krzysztof Parzyszek [Fri, 25 Jun 2021 22:45:50 +0000 (17:45 -0500)]
[Hexagon] Add patterns to load i1

This fixes https://llvm.org/PR50853

3 years ago[MLIR][SCF] Inline ExecuteRegion if parent can contain multiple blocks
William S. Moses [Fri, 25 Jun 2021 23:40:35 +0000 (19:40 -0400)]
[MLIR][SCF] Inline ExecuteRegion if parent can contain multiple blocks

The executeregionop is used to allow multiple blocks within SCF constructs. If the container allows multiple blocks, inline the region

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

3 years ago[libc++] Remove some _LIBCPP_CXX03_LANG from iostreams headers.
Arthur O'Dwyer [Tue, 15 Jun 2021 16:47:05 +0000 (12:47 -0400)]
[libc++] Remove some _LIBCPP_CXX03_LANG from iostreams headers.

With the STL containers, I didn't enable move operations in C++03 mode
because that would change the overload resolution for things that today
are copy operations. With iostreams, though, the copy operations aren't
present at all, and so I see no problem with enabling move operations
even in (Clang's greatly extended) C++03 mode.

Clang's C++03 mode does not support delegating constructors.

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

3 years agoRevert "Revert "[mlir][memref] Implement lowering of memref.copy to llvm""
Stephan Herhut [Mon, 28 Jun 2021 16:45:29 +0000 (18:45 +0200)]
Revert "Revert "[mlir][memref] Implement lowering of memref.copy to llvm""

This reverts commit 7d6e589fc86d7865fc4bf92c583209700dd32aac.

Windows build was unbroken.

3 years ago[AsmParser][SystemZ][z/OS] Fix hanging scenario in HLASMAsmParser class
Anirudh Prasad [Mon, 28 Jun 2021 16:46:31 +0000 (12:46 -0400)]
[AsmParser][SystemZ][z/OS] Fix hanging scenario in HLASMAsmParser class

- In the caller of the overridden `parseStatement` function (i.e. the `AsmParser::Run()`) in the case of an error **and** if we're not at the start of the statement, we "eat" up until the end of the current statement, so we don't have to process it again.
- However, in the HLASMAsmParser class what's happening is that, if an error occurs at the very start of the statement (for example, you invoke the HLASMAsmParser to parse a gnu directive), we will error out, but we never really progress in terms of the next token in the statement to parse. We simply keep looping processing the same error over and over again (partly because we're at the start of the statement)
- To remedy this, when the `parseAsHLASMLabel` function fails, before returning, we "eat" until the end of the statement function, so we don't process it anymore.

Reviewed By: uweigand

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

3 years agoRevert "[AArch64] Custom lower <4 x i8> loads"
Sjoerd Meijer [Mon, 28 Jun 2021 16:25:53 +0000 (17:25 +0100)]
Revert "[AArch64] Custom lower <4 x i8> loads"

This reverts commit 51e434fc2590d1d3ffa6545cd07290a238db2b88 because of a
build bot failure in test-suite::GCC-C-execute-pr60960.test that I need to
investigate.

3 years ago[AArch64] Added tests to neon-truncstore.ll. NFC.
Sjoerd Meijer [Fri, 25 Jun 2021 14:52:19 +0000 (15:52 +0100)]
[AArch64] Added tests to neon-truncstore.ll. NFC.

3 years agoRevert "[clang][patch][fpenv] Add builtin __arithmetic_fence and option fprotect...
Melanie Blower [Mon, 28 Jun 2021 16:41:57 +0000 (12:41 -0400)]
Revert "[clang][patch][fpenv] Add builtin __arithmetic_fence and option fprotect-parens"

This reverts commit 4f1238e44d803b145997fa984677a6c5cdf1f417.
Buildbot fails on predecessor patch

3 years agoRevert "[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine...
Melanie Blower [Mon, 28 Jun 2021 16:41:24 +0000 (12:41 -0400)]
Revert "[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine to allow diagnostics on target-unsupported options"

This reverts commit 2c02b0c3f45414ac6c64583e006a26113c028304.
buildbot fails

3 years ago[coro] Fix rematerializable instruction sinking to coro.suspend blocks
Arnold Schwaighofer [Wed, 23 Jun 2021 18:30:55 +0000 (11:30 -0700)]
[coro] Fix rematerializable instruction sinking to coro.suspend blocks

There is a constraint that coro.suspend instructions need to be in their
own blocks. The coro split pass initially creates IR that obeys this constraint
(which is later checked). Sinking rematerializable instructions into these
blocks breaks that constraint.

Instead rematerialize in the predecessor block to the suspend's single
predecessor block.

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

3 years ago[gn build] Port f32f3db9fcbf
LLVM GN Syncbot [Mon, 28 Jun 2021 16:30:29 +0000 (16:30 +0000)]
[gn build] Port f32f3db9fcbf

3 years ago[clang][patch][fpenv] Add builtin __arithmetic_fence and option fprotect-parens
Melanie Blower [Wed, 9 Jun 2021 15:38:34 +0000 (11:38 -0400)]
[clang][patch][fpenv] Add builtin __arithmetic_fence and option fprotect-parens

This patch adds a new clang builtin, __arithmetic_fence. The purpose of the
builtin is to provide the user fine control, at the expression level, over
floating point optimization when -ffast-math (-ffp-model=fast) is enabled.
The builtin prevents the optimizer from rearranging floating point expression
evaluation. The new option fprotect-parens has the same effect on
parenthesized expressions, forcing the optimizer to respect the parentheses.

Reviewed By: aaron.ballman, kpn

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

3 years ago[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine to allow...
Melanie Blower [Tue, 8 Jun 2021 20:55:54 +0000 (16:55 -0400)]
[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine to allow diagnostics on target-unsupported options

Reviewed By: aaron.ballman

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

3 years ago[llvm][clang][fpenv] Create new intrinsic llvm.arith.fence to control FP optimization...
Melanie Blower [Mon, 7 Jun 2021 13:34:09 +0000 (09:34 -0400)]
[llvm][clang][fpenv] Create new intrinsic llvm.arith.fence to control FP optimization at expression level

This intrinsic blocks floating point transformations by the optimizer.

Author: Pengfei

Reviewed By: LuoYuanke, Andy Kaylor, Craig Topper, kpn

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

3 years ago[libc++] Split the various iterator types out of <iterator>
Louis Dionne [Fri, 11 Jun 2021 13:55:11 +0000 (09:55 -0400)]
[libc++] Split the various iterator types out of <iterator>

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

3 years ago[MLIR] Correct memrefdataflow behavior in the presence of cast and other operations
William S. Moses [Thu, 10 Jun 2021 19:12:04 +0000 (15:12 -0400)]
[MLIR] Correct memrefdataflow behavior in the presence of cast and other operations

MemRefDataFlow performs mem2reg style operations for affine load/stores. Unfortunately, it is not presently correct in the presence of external operations such as memref.cast, or function calls. This diff extends the functionality of the pass to remain correct in the presence of such ops.

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

3 years ago[mlir][llvm] Fix windows build
Stephan Herhut [Mon, 28 Jun 2021 15:31:01 +0000 (17:31 +0200)]
[mlir][llvm] Fix windows build

Gate the include of alloca.h behind _WIN32 guard.

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

3 years ago[Clang] Add option to handle behaviour of vector bool/vector pixel.
Stefan Pintilie [Fri, 11 Jun 2021 10:39:28 +0000 (05:39 -0500)]
[Clang] Add option to handle behaviour of vector bool/vector pixel.

Added the option `-altivec-src-compat=[mixed,gcc,xl]`. The default at this time is `mixed`.

The default behavior for clang is for all vector compares to return a scalar unless the vectors being
compared are vector bool or vector pixel. In that case the compare returns a
vector. With the gcc case all vector compares return vectors and in the xl case
all vector compares return scalars.

This patch does not change the default behavior of clang.

This option will be used in future patches to implement behaviour compatibility for the vector bool/pixel types.

Reviewed By: bmahjour

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

3 years ago[MLIR] Don't remove memref allocation if stored into another allocation
William S. Moses [Fri, 25 Jun 2021 20:16:23 +0000 (16:16 -0400)]
[MLIR] Don't remove memref allocation if stored into another allocation

A canonicalization accidentally will remove a memref allocation if it is only stored into. However, this is incorrect if the allocation is the value being stored, not the allocation being stored into.

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

3 years ago[AMDGPU] Use opName instead of PseudoName in VOP2 multiclasses. NFC.
Jay Foad [Mon, 28 Jun 2021 15:44:39 +0000 (16:44 +0100)]
[AMDGPU] Use opName instead of PseudoName in VOP2 multiclasses. NFC.

This is just for consistency with all other instruction multiclasses
that pass around pseudo names as arguments.

3 years agoRevert "[Analyzer][solver] Add dump methods for (dis)equality classes."
Nico Weber [Mon, 28 Jun 2021 15:32:39 +0000 (11:32 -0400)]
Revert "[Analyzer][solver] Add dump methods for (dis)equality classes."

This reverts commit 6f3b775c3e9c685f74ecbe2ce1a94af52cc17c2f.
Test fails flakily, see comments on https://reviews.llvm.org/D103967

Also revert follow-up "[Analyzer] Attempt to fix windows bots test
failure b/c of new-line"
This reverts commit fe0e861a4d9946a3e7de1bc95a3ec12fa602b492.

3 years agoRevert "[DebugInfo] Enable variadic debug value salvaging"
Nico Weber [Mon, 28 Jun 2021 15:16:11 +0000 (11:16 -0400)]
Revert "[DebugInfo] Enable variadic debug value salvaging"

This reverts commit adace79652174d126be290cab42b3122569fe15d.
Still breaks things, see comment on https://reviews.llvm.org/D91722

3 years ago[llvm][ARM] Treat xscale arch as an alias of armv5te
David Spickett [Wed, 23 Jun 2021 11:15:24 +0000 (11:15 +0000)]
[llvm][ARM] Treat xscale arch as an alias of armv5te

Previously xscale was known to everything apart
from the ELF streamer so we would crash as soon
as you tried to output an object file.

Reviewed By: nickdesaulniers

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

3 years ago[BasicAA] Add test to cover GetIndexDifference change in D99424.
Florian Hahn [Mon, 28 Jun 2021 14:46:56 +0000 (15:46 +0100)]
[BasicAA] Add test to cover GetIndexDifference change in D99424.

Precommit test case for a change to GetIndexDifference in D99424.

3 years ago[flang][docs] Minor update to Fortran LLVM Tests-suite docs.
naromero77 [Fri, 25 Jun 2021 23:54:13 +0000 (18:54 -0500)]
[flang][docs] Minor update to Fortran LLVM Tests-suite docs.

Updated Fortran LLVM Test-suite docs to reflect latest changes.

Reviewed By: Meinersbur, xgupta

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

3 years ago[MLIR] Simplify select to a not
William S. Moses [Sat, 26 Jun 2021 03:23:14 +0000 (23:23 -0400)]
[MLIR] Simplify select to a not

Given a select that returns the logical negation of the condition, replace it with a not of the condition.

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

3 years ago[Orc][examples] Temporarily disable LLJITWithRemoteDebugging build and test
Stefan Gränitz [Mon, 28 Jun 2021 14:10:02 +0000 (16:10 +0200)]
[Orc][examples] Temporarily disable LLJITWithRemoteDebugging build and test

The underlying TargetProcessControl API changes with D104694. Once it landed I can patch and re-enable the example.

3 years agoRevert "[mlir][memref] Implement lowering of memref.copy to llvm"
Jacques Pienaar [Mon, 28 Jun 2021 14:50:11 +0000 (07:50 -0700)]
Revert "[mlir][memref] Implement lowering of memref.copy to llvm"

This reverts commit e9396449777f02d573deb25d603ee1b1d6e568c1.

Breaks Windows build.

3 years ago[AIX] Use less than or equal to for some alignment tests on AIX
Zarko Todorovski [Mon, 28 Jun 2021 14:31:55 +0000 (10:31 -0400)]
[AIX] Use less than or equal to for some alignment tests on AIX

On AIX the alignment implementation has the storage aligned to the
preferred alignment instead of the alignment of a type. Macro guard
these tests for AIX and have them pass when the "reference alignment" is
less than or equal to the alignment observed. In other words, the
alignment applied is at least as strict as the required alignment.

Reviewed By: hubert.reinterpretcast

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

3 years agoReland [GlobalISel] NFC: Have LLT::getSizeInBits/Bytes return a TypeSize.
Sander de Smalen [Sun, 27 Jun 2021 15:07:19 +0000 (16:07 +0100)]
Reland [GlobalISel] NFC: Have LLT::getSizeInBits/Bytes return a TypeSize.

This patch relands https://reviews.llvm.org/D104454, but fixes some failing
builds on Mac OS which apparently has a different definition for size_t,
that caused 'ambiguous operator overload' for the implicit conversion
of TypeSize to a scalar value.

This reverts commit b732e6c9a8438e5204ac96c8ca76f9b11abf98ff.

3 years agoTeach peephole optimizer to not emit sub-register defs
Ahsan Saghir [Mon, 31 May 2021 13:52:56 +0000 (08:52 -0500)]
Teach peephole optimizer to not emit sub-register defs

Peephole optimizer should not be introducing sub-reg definitions
as they are illegal in machine SSA phase. This patch modifies
the optimizer to not emit sub-register definitions.

Reviewed By: arsenm

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

3 years ago[AArch64][SVE] DAG combine SETCC_MERGE_ZERO of a SETCC_MERGE_ZERO
Bradley Smith [Fri, 25 Jun 2021 11:11:33 +0000 (12:11 +0100)]
[AArch64][SVE] DAG combine SETCC_MERGE_ZERO of a SETCC_MERGE_ZERO

This helps remove extra comparisons when generating masks for fixed
length masked operations.

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

3 years ago[libc++] Remove unnecessary reinterpret_cast from typeinfo
Jonathan Crowther [Mon, 28 Jun 2021 13:53:28 +0000 (09:53 -0400)]
[libc++] Remove unnecessary reinterpret_cast from typeinfo

In typeinfo there is a reinterpret_cast between a uintptr_t and size_t. These are two integer types and therefore a reinterpret_cast is not right for this situation. It looks like it may have been copied and pasted from above in the file. An implicit cast works in it's place.

Reviewed By: ldionne, #libc

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

3 years ago[InferAddressSpaces] NFC: For noop IntToPtr/PtrToInt pair cast to operator instead...
Reshabh Sharma [Mon, 28 Jun 2021 13:48:39 +0000 (19:18 +0530)]
[InferAddressSpaces] NFC: For noop IntToPtr/PtrToInt pair cast to operator instead of PtrToInt

Compiler crashes at an assertion while casting operands to PtrToIntInst at some cases when
ptrtoint is present as an explicit operand to inttoptr. Explicit instruction operator as
operand can not be casted to an Instruction.

This patch replaces cast from PtrToInst to Operator which are later checked for constant
expressions.

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

3 years ago[OpenMP][NFC] Fix typo in OpenMPOpt
Joseph Huber [Mon, 28 Jun 2021 13:48:54 +0000 (09:48 -0400)]
[OpenMP][NFC] Fix typo in OpenMPOpt

3 years ago[Analyzer] Attempt to fix windows bots test failure b/c of new-line
Gabor Marton [Mon, 28 Jun 2021 13:41:30 +0000 (15:41 +0200)]
[Analyzer] Attempt to fix windows bots test failure b/c of new-line

3 years ago[AVR][test] Add a new test: functions with struct return type
Ben Shi [Mon, 28 Jun 2021 13:19:26 +0000 (21:19 +0800)]
[AVR][test] Add a new test: functions with struct return type

Reviewed By: dylanmckay

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

3 years ago[OpenMP][NFC] Fix missing argument
Joseph Huber [Mon, 28 Jun 2021 13:14:46 +0000 (09:14 -0400)]
[OpenMP][NFC] Fix missing argument

3 years ago[AMDGPU][GlobalISel] Legalize and select G_SBFX and G_UBFX
Brendon Cahoon [Fri, 30 Apr 2021 13:57:44 +0000 (09:57 -0400)]
[AMDGPU][GlobalISel] Legalize and select G_SBFX and G_UBFX

Adds legalizer, register bank select, and instruction
select support for G_SBFX and G_UBFX. These opcodes generate
scalar or vector ALU bitfield extract instructions for
AMDGPU. The instructions allow both constant or register
values for the offset and width operands.

The 32-bit scalar version is expanded to a sequence that
combines the offset and width into a single register.

There are no 64-bit vgpr bitfield extract instructions, so the
operations are expanded to a sequence of instructions that
implement the operation. If the width is a constant,
then the 32-bit bitfield extract instructions are used.

Moved the AArch64 specific code for creating G_SBFX to
CombinerHelper.cpp so that it can be used by other targets.
Only bitfield extracts with constant offset and width values
are handled currently.

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

3 years ago[C++20] Support for lambdas in unevaluated context
Corentin Jabot [Mon, 28 Jun 2021 13:00:45 +0000 (09:00 -0400)]
[C++20] Support for lambdas in unevaluated context

Partially implement P0315R4.

This patch allow lambda in unevaluated context.
It does not implement temp.deduct/9.

3 years ago[NFC] Fixing short title underline in release notes file
Lucas Prates [Mon, 28 Jun 2021 12:51:27 +0000 (13:51 +0100)]
[NFC] Fixing short title underline in release notes file

3 years ago[mlir][memref] Implement lowering of memref.copy to llvm
Stephan Herhut [Mon, 28 Jun 2021 11:25:29 +0000 (13:25 +0200)]
[mlir][memref] Implement lowering of memref.copy to llvm

This lowering uses a library call to implement copying in the general case, i.e.,
supporting arbitrary rank and strided layouts.

3 years ago[OpenMP] Increase attributor iterations on the GPU
Joseph Huber [Fri, 25 Jun 2021 14:42:00 +0000 (10:42 -0400)]
[OpenMP] Increase attributor iterations on the GPU

Increase the number of attributor iterations on a GPU target. I forgot to
change this in D104416.

Reviewed By: jdoerfert

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

3 years ago[Aarch64] Adding support for Armv9-A Realm Management Extension
Lucas Prates [Tue, 22 Jun 2021 15:43:36 +0000 (16:43 +0100)]
[Aarch64] Adding support for Armv9-A Realm Management Extension

This adds support for Armv9-A's Realm Management Extension, including
three new system registers - MFAR_EL3, GPCCR_EL3 and GPTBR_EL3 - and
four new TLBI instructions.

The reference for the Realm Management Extension can be found at: https://developer.arm.com/documentation/ddi0615/aa.

Based on patches by Victor Campos.

Reviewed By: dmgreen

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

3 years ago[NFC] Adding test for clobbering of high registers in Thumb
Lucas Prates [Tue, 9 Feb 2021 13:39:08 +0000 (13:39 +0000)]
[NFC] Adding test for clobbering of high registers in Thumb

Prior to the changes from D52010, clobbering Thumb's high registers in
inline asm would cause incorrect code to be generated - or an assertion
failure for debug builds. Now that the issue is no longer reproducible,
this patch adds a MIR test to cover that scenario.

Reviewed By: arsenm

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

3 years ago[AMDGPU][Libomptarget] Collect allocatable memory pools using HSA
Pushpinder Singh [Mon, 28 Jun 2021 11:27:05 +0000 (11:27 +0000)]
[AMDGPU][Libomptarget] Collect allocatable memory pools using HSA

The logic is almost similar to that of system.cpp with one change that
instead of adding all the memory pools to a device struct it only
keeps a single pool. The existing approach also always allocated memory on
the first HSA pool found for a GPU.

This depends on D104691. The goal of this series of patches is to remove
_atl_machine global. The next patch will drop g_atl_machine entirely.

Reviewed By: JonChesterfield

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

3 years ago[analyzer][solver][NFC] Simplify function signatures
Valeriy Savchenko [Mon, 28 Jun 2021 08:56:05 +0000 (11:56 +0300)]
[analyzer][solver][NFC] Simplify function signatures

Since RangeSet::Factory actually contains BasicValueFactory, we can
remove value factory from many function signatures inside the solver.

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

3 years ago[Analyzer][solver] Add dump methods for (dis)equality classes.
Gabor Marton [Wed, 9 Jun 2021 15:03:47 +0000 (17:03 +0200)]
[Analyzer][solver] Add dump methods for (dis)equality classes.

This proved to be very useful during debugging.

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

3 years ago[compiler-rt][asan] Disable two tests on Arm Thumb
David Spickett [Mon, 28 Jun 2021 10:32:24 +0000 (10:32 +0000)]
[compiler-rt][asan] Disable two tests on Arm Thumb

I can't be sure of the cause but I believe these fail
due to to fast unwinding not working on Thumb.

Whatever the case, they have been failing on our bots
for a long time:
https://lab.llvm.org/buildbot/#/builders/170/builds/46

Require fast-unwinder-works for both.

3 years ago[cross-project-tests] Add/update check-* targets for cross-project-tests
James Henderson [Wed, 10 Feb 2021 14:16:45 +0000 (14:16 +0000)]
[cross-project-tests] Add/update check-* targets for cross-project-tests

This change modifies the existing check-debuginfo target to only run the
debuginfo tests within the cross-project-tests, and adds a new target
(check-cross-project) which runs all the tests. The former has also been
modified to not be included in check-all (since the check-cross-project
target covers them).

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

Reviewed by: aprantl

3 years ago[cross-project-tests] Make clang optional if not in LLVM_ENABLE_PROJECTS
James Henderson [Tue, 9 Feb 2021 15:19:27 +0000 (15:19 +0000)]
[cross-project-tests] Make clang optional if not in LLVM_ENABLE_PROJECTS

Also mark debuginfo_tests as UNSUPPORTED if clang can't be found and
remove it from the list of test dependencies if not in
LLVM_ENABLE_PROJECTS.

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

Reviewed by: aprantl

3 years ago[cross-project-tests] Add lld as a dependency if in LLVM_ENABLE_PROJECTS
James Henderson [Tue, 9 Feb 2021 14:57:03 +0000 (14:57 +0000)]
[cross-project-tests] Add lld as a dependency if in LLVM_ENABLE_PROJECTS

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

Reviewed by: aprantl

3 years ago[cross-project-tests] Rename vars to make sense for new directory name
James Henderson [Thu, 11 Feb 2021 15:41:32 +0000 (15:41 +0000)]
[cross-project-tests] Rename vars to make sense for new directory name

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

Reviewed by: aprantl

3 years ago[RFC][debuginfo-test] Rename debug-info lit tests for general purposes
James Henderson [Mon, 8 Feb 2021 15:40:55 +0000 (15:40 +0000)]
[RFC][debuginfo-test] Rename debug-info lit tests for general purposes

Discussion thread:
https://lists.llvm.org/pipermail/llvm-dev/2021-January/148048.html

Move debuginfo-test into a subdirectory of a new top-level directory,
called cross-project-tests. The new name replaces "debuginfo-test" as an
LLVM project enabled via LLVM_ENABLE_PROJECTS.

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

Reviewed by: aprantl

3 years ago[LoopVectorize] Fix strict reductions where VF = 1
Kerry McLaughlin [Mon, 28 Jun 2021 10:26:10 +0000 (11:26 +0100)]
[LoopVectorize] Fix strict reductions where VF = 1

Currently we will allow loops with a fixed width VF of 1 to vectorize
if the -enable-strict-reductions flag is set. However, the loop vectorizer
will not use ordered reductions if `VF.isScalar()` and the resulting
vectorized loop will be out of order.

This patch removes `VF.isVector()` when checking if ordered reductions
should be used. Also, instead of converting the FAdds to reductions if the
VF = 1, operands of the FAdds are changed such that the order is preserved.

Reviewed By: david-arm

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

3 years ago[VPlan] Merge predicated-triangle regions, after sinking.
Florian Hahn [Mon, 28 Jun 2021 10:01:27 +0000 (11:01 +0100)]
[VPlan] Merge predicated-triangle regions, after sinking.

Sinking scalar operands into predicated-triangle regions may allow
merging regions. This patch adds a VPlan-to-VPlan transform that tries
to merge predicate-triangle regions after sinking.

Reviewed By: Ayal

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

3 years ago[lld][MachO] Temporarily require 64 bit build for dead-strip.s
David Spickett [Mon, 28 Jun 2021 09:36:04 +0000 (09:36 +0000)]
[lld][MachO] Temporarily require 64 bit build for dead-strip.s

This test has always failed on 32 bit armv8 bots:
https://lab.llvm.org/buildbot/#/builders/178/builds/42

Due to the output order of some symbols changing.
I don't think this is an Arm specific issue so disabling
on 32 bit while it's investigated.

3 years ago[hwasan] Show sp in register dump.
Florian Mayer [Wed, 23 Jun 2021 14:36:14 +0000 (15:36 +0100)]
[hwasan] Show sp in register dump.

Reviewed By: hctim, eugenis

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

3 years ago[clang-tidy][NFC] Fix buildbot failures in 'bugprone-easily-swappable-parameters'
Whisperity [Mon, 28 Jun 2021 09:17:51 +0000 (11:17 +0200)]
[clang-tidy][NFC] Fix buildbot failures in 'bugprone-easily-swappable-parameters'

3 years ago[gn build] Port 499e39c5983d
LLVM GN Syncbot [Mon, 28 Jun 2021 08:50:56 +0000 (08:50 +0000)]
[gn build] Port 499e39c5983d

3 years ago[clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily...
Whisperity [Tue, 12 Jan 2021 16:03:42 +0000 (17:03 +0100)]
[clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily-swappable-parameters'

While the original check's purpose is to identify potentially dangerous
functions based on the parameter types (as identifier names do not mean
anything when it comes to the language rules), unfortunately, such a plain
interface check rule can be incredibly noisy. While the previous
"filtering heuristic" is able to find many similar usages, there is an entire
class of parameters that should not be warned about very easily mixed by that
check: parameters that have a name and their name follows a pattern,
e.g. `text1, text2, text3, ...`.`

This patch implements a simple, but powerful rule, that allows us to detect
such cases and ensure that no warnings are emitted for parameter sequences that
follow a pattern, even if their types allow for them to be potentially mixed at a call site.

Given a threshold `k`, warnings about two parameters are filtered from the
result set if the names of the parameters are either prefixes or suffixes of
each other, with at most k letters difference on the non-common end.
(Assuming that the names themselves are at least `k` long.)

 - The above `text1, text2` is an example of this. (Live finding from Xerces.)
 - `LHS` and `RHS` are also fitting the bill here. (Live finding from... virtually any project.)
 - So does `Qmat, Tmat, Rmat`. (Live finding from I think OpenCV.)

Reviewed By: aaron.ballman

Differential Revision: http://reviews.llvm.org/D97297