platform/upstream/llvm.git
3 years agoReapply "[LV] Vectorize (some) early and multiple exit loops"" w/fix for builder
Philip Reames [Mon, 28 Dec 2020 18:11:06 +0000 (10:11 -0800)]
Reapply "[LV] Vectorize (some) early and multiple exit loops"" w/fix for builder

This reverts commit 4ffcd4fe9ac2ee948948f732baa16663eb63f1c7 thus restoring e4df6a40dad.

The only change from the original patch is to add "llvm::" before the call to empty(iterator_range).  This is a speculative fix for the ambiguity reported on some builders.

3 years agoRevert "[LV] Vectorize (some) early and multiple exit loops"
Arthur Eubanks [Mon, 28 Dec 2020 18:05:41 +0000 (10:05 -0800)]
Revert "[LV] Vectorize (some) early and multiple exit loops"

This reverts commit e4df6a40dad66e989a4333c11d39cf3ed9635135.

Breaks Windows bots, e.g. http://45.33.8.238/win/30472/step_4.txt
and http://lab.llvm.org:8011/#/builders/83/builds/2078/steps/5/logs/stdio

3 years ago[LV] Vectorize (some) early and multiple exit loops
Philip Reames [Mon, 28 Dec 2020 17:39:09 +0000 (09:39 -0800)]
[LV] Vectorize (some) early and multiple exit loops

This patch is a major step towards supporting multiple exit loops in the vectorizer. This patch on it's own extends the loop forms allowed in two ways:

    single exit loops which are not bottom tested
    multiple exit loops w/ a single exit block reached from all exits and no phis in the exit block (because of LCSSA this implies no values defined in the loop used later)

The restrictions on multiple exit loop structures will be removed in follow up patches; disallowing cases for now makes the code changes smaller and more obvious. As before, we can only handle loops with entirely analyzable exits. Removing that restriction is much harder, and is not part of currently planned efforts.

The basic idea here is that we can force the last iteration to run in the scalar epilogue loop (if we have one). From the definition of SCEV's backedge taken count, we know that no earlier iteration can exit the vector body. As such, we can leave the decision on which exit to be taken to the scalar code and generate a bottom tested vector loop which runs all but the last iteration.

The existing code already had the notion of requiring one iteration in the scalar epilogue, this patch is mainly about generalizing that support slightly, making sure we don't try to use this mechanism when tail folding, and updating the code to reflect the difference between a single exit block and a unique exit block (very mechanical).

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

3 years ago[ValueTracking] Fix isKnownNonEqual() with constexpr mul
Nikita Popov [Mon, 28 Dec 2020 17:30:17 +0000 (18:30 +0100)]
[ValueTracking] Fix isKnownNonEqual() with constexpr mul

Confusingly, BinaryOperator is not an Operator,
OverflowingBinaryOperator is... We were implicitly assuming that
the multiply is an Instruction here.

This fixes the assertion failure reported in
https://reviews.llvm.org/D92726#2472827.

3 years ago[AMDGPU][MC][NFC] Split large asm tests into smaller chunks
Dmitry Preobrazhensky [Mon, 28 Dec 2020 17:13:17 +0000 (20:13 +0300)]
[AMDGPU][MC][NFC] Split large asm tests into smaller chunks

The following large tests have been split into smaller parts by instruction formats:

    gfx7_asm_all.s
    gfx8_asm_all.s
    gfx9_asm_all.s
    gfx10_asm_all.s

This change results in noticeable lit testing speedup.
For example, on a debug Windows build, split asm tests are run 3.5 times faster.

3 years agoRevert "[benchmark] Fixed a build error when using CMake 3.15.1 + NDK-R20"
Roman Lebedev [Mon, 28 Dec 2020 17:17:25 +0000 (20:17 +0300)]
Revert "[benchmark] Fixed a build error when using CMake 3.15.1 + NDK-R20"

Temporairly revert until a consensus on post-commit comments is achieved.

This reverts commit a485a59d2172daaee1d5e734da54fbb243f7d54c.

3 years ago[TableGen] Fix bug in !interleave operator
Paul C. Anagnostopoulos [Fri, 25 Dec 2020 16:50:12 +0000 (11:50 -0500)]
[TableGen] Fix bug in !interleave operator

I forgot to account for unresolved elements of the list.

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

3 years ago[InstCombine] 'hoist xor-by-constant from xor-by-value': ignore constantexprs
Roman Lebedev [Mon, 28 Dec 2020 17:14:56 +0000 (20:14 +0300)]
[InstCombine] 'hoist xor-by-constant from xor-by-value': ignore constantexprs

As it is being reported (in post-commit review) in
https://reviews.llvm.org/D93857
this fold (as i expected, but failed to come up with test coverage
despite trying) has issues with constant expressions.
Since we only care about true constants, which constantexprs are not,
don't perform such hoisting for constant expressions.

3 years ago[MIRPrinter] Fix incorrect output of unnamed stack names
Gabriel Hjort Åkerlund [Mon, 28 Dec 2020 16:41:25 +0000 (17:41 +0100)]
[MIRPrinter] Fix incorrect output of unnamed stack names

The MIRParser expects unnamed stack entries to have empty names ('').
In case of unnamed alloca instructions, the MIRPrinter would output
'<unnamed alloca>', which caused the MIRParser to reject the generated
code.

Reviewed By: arsenm

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

3 years ago[flang] Fix bugs in .mod file for abstract interface
Tim Keith [Mon, 28 Dec 2020 16:50:30 +0000 (08:50 -0800)]
[flang] Fix bugs in .mod file for abstract interface

When an abstract interface is defined, add the ABSTRACT attribute to
subprogram symbols that define the interface body. Make use of that
when writing .mod files to include "abstract" on the interface statement.

Also, fix a problem with the order of symbols in a .mod file. Sometimes
a name is mentioned before the "real" declaration, e.g. in an access
statement. We want the order to be based on the real definitions. In
these cases we replace the symbol name with an identical name with a
different source location. Then by sorting based on the source location
we get symbols in the right order.

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

3 years ago[MachO] Fix enum-int mismatch warning
Gabriel Hjort Åkerlund [Mon, 28 Dec 2020 16:09:35 +0000 (17:09 +0100)]
[MachO] Fix enum-int mismatch warning

Change-Id: Ie637dc7761144e5552b05a9c286f1e736579823d

Reviewed By: arsenm

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

3 years ago[PowerPC] Remove redundant COPY_TO_REGCLASS introduced by 8a58f21f5b6c
Nemanja Ivanovic [Mon, 28 Dec 2020 15:25:25 +0000 (09:25 -0600)]
[PowerPC] Remove redundant COPY_TO_REGCLASS introduced by 8a58f21f5b6c

3 years ago[clang-tidy][NFC] Remove unnecessary headers
Nathan James [Mon, 28 Dec 2020 15:01:51 +0000 (15:01 +0000)]
[clang-tidy][NFC] Remove unnecessary headers

3 years ago[clangd] Add error handling (elog) in code completion.
Adam Czachorowski [Mon, 14 Dec 2020 16:05:59 +0000 (17:05 +0100)]
[clangd] Add error handling (elog) in code completion.

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

3 years ago[AMDGPU] Split edge to make si_if dominate end_cf
alex-t [Fri, 13 Nov 2020 16:07:29 +0000 (19:07 +0300)]
[AMDGPU] Split edge to make si_if dominate end_cf

Basic block containing "if" not necessarily dominates block that is the "false" target for the if.

That "false" target block may have another predecessor besides the "if" block. IR value corresponding to the Exec mask is generated by the

si_if intrinsic and then used by the end_cf intrinsic. In this case IR verifier complains that 'Def does not dominate all uses'.

This change split the edge between the "if" block and "false" target block to make it dominated by the "if" block.

Reviewed By: arsenm

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

3 years ago[RISCV] Define vmsbf.m/vmsif.m/vmsof.m/viota.m/vid.v intrinsics.
Zakk Chen [Fri, 25 Dec 2020 02:13:56 +0000 (18:13 -0800)]
[RISCV] Define vmsbf.m/vmsif.m/vmsof.m/viota.m/vid.v intrinsics.

Define those intrinsics and lower to V instructions.

Use update_llc_test_checks.py for viota.m tests to check
earlyclobber is applied correctly.
mask viota.m tests uses the same argument as input and mask for
avoid dependency of D93364.

We work with @rogfer01 from BSC to come out this patch.

Reviewed By: HsiangKai

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

3 years ago[AMDGPU][MC] Improved errors handling for v_interp* operands
Dmitry Preobrazhensky [Mon, 28 Dec 2020 13:15:48 +0000 (16:15 +0300)]
[AMDGPU][MC] Improved errors handling for v_interp* operands

See bug 48596 (https://bugs.llvm.org/show_bug.cgi?id=48596)

Reviewers: rampitec

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

3 years ago[AMDGPU][MC][NFC] Parser refactoring
Dmitry Preobrazhensky [Mon, 28 Dec 2020 11:59:49 +0000 (14:59 +0300)]
[AMDGPU][MC][NFC] Parser refactoring

See bug 48515 (https://bugs.llvm.org/show_bug.cgi?id=48515)

Reviewers: rampitec

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

3 years ago[benchmark] Fixed a build error when using CMake 3.15.1 + NDK-R20
AnZhong Huang [Mon, 28 Dec 2020 08:24:29 +0000 (11:24 +0300)]
[benchmark] Fixed a build error when using CMake 3.15.1 + NDK-R20

std::decay_t used by llvm/utils/benchmark/include/benchmark/benchmark.h
is a c++14 feature, but the CMakelist uses c++11,
it's the root-cause of build error.

There are two options to fix the error.
1) change the CMakelist to support c++14.
2) change std::decay_t to std::decay, it's what the patch done.

This bug can only be reproduced by CMake 3.15, we didn't observer the bug
with CMake 3.16. But based on the code's logic, it's an obvious bug of LLVM.

The upstream code is fine, the problem was introduced by
rG1bd6123b781120c9190b9ba58b900cdcb718cdd1.

Reviewed By: lebedev.ri

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

3 years ago[RISCV] Pattern-match more vector-splatted constants
Fraser Cormack [Thu, 24 Dec 2020 13:20:51 +0000 (13:20 +0000)]
[RISCV] Pattern-match more vector-splatted constants

This patch extends the pattern-matching capability of vector-splatted
constants. When illegally-typed constants are legalized they are
canonically sign-extended to XLenVT. This preserves the sign and allows
us to match simm5. If they were zero-extended for whatever reason we'd
lose that ability: e.g. `(i8 -1) -> (XLenVT 255)` would not be matched
under the current logic.

To address this we first manually sign-extend the splatted constant from
the vector element type to int64_t. This preserves the semantics while
removing any implicitly-truncated bits.

The corresponding logic for uimm5 was not updated, the rationale being
that neither sign- nor zero-extending a legal uimm5 immediate should
change that (unless we expect actual "garbage" upper bits).

Reviewed By: craig.topper

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

3 years ago[msan] Delete unused glibc header <execinfo.h>
Fangrui Song [Mon, 28 Dec 2020 05:59:23 +0000 (21:59 -0800)]
[msan] Delete unused glibc header <execinfo.h>

The file does not call backtrace/backtrace_symbols.

3 years ago[compiler-rt][test] Make glibc-* feature detection work on a musl distribution
Fangrui Song [Mon, 28 Dec 2020 05:50:47 +0000 (21:50 -0800)]
[compiler-rt][test] Make glibc-* feature detection work on a musl distribution

... where `ldd --version` has empty stdout and non-empty stderr.

3 years ago[sanitizer] Defined SANITIZER_TEST_HAS_PVALLOC only on glibc
Fangrui Song [Mon, 28 Dec 2020 05:33:41 +0000 (21:33 -0800)]
[sanitizer] Defined SANITIZER_TEST_HAS_PVALLOC only on glibc

This simplifies the condition and makes it work on musl.

3 years ago[asan][memprof] Declare _DYNAMIC and fix -Wparentheses
Fangrui Song [Mon, 28 Dec 2020 04:28:59 +0000 (20:28 -0800)]
[asan][memprof] Declare _DYNAMIC and fix -Wparentheses

Declare `extern ElfW(Dyn) _DYNAMIC[];` so that it will trivially work on musl.

3 years ago[MachineSink] add threshold in machinesink pass to reduce compiling time.
Chen Zheng [Mon, 28 Dec 2020 01:39:13 +0000 (20:39 -0500)]
[MachineSink] add threshold in machinesink pass to reduce compiling time.

3 years ago[RS4GC] Lazily set changed flag when folding single entry phis
Yevgeny Rouban [Mon, 28 Dec 2020 03:54:21 +0000 (10:54 +0700)]
[RS4GC] Lazily set changed flag when folding single entry phis

The function FoldSingleEntryPHINodes() is changed to return if
it has changed IR or not. This return value is used by RS4GC to
set the MadeChange flag respectively.

Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D93810

3 years ago[InstCombine] use poison as placeholder for undemanded elems
Juneyoung Lee [Sun, 27 Dec 2020 23:58:15 +0000 (08:58 +0900)]
[InstCombine] use poison as placeholder for undemanded elems

Currently undef is used as a don’t-care vector when constructing a vector using a series of insertelement.
However, this is problematic because undef isn’t undefined enough.
Especially, a sequence of insertelement can be optimized to shufflevector, but using undef as its placeholder makes shufflevector a poison-blocking instruction because undef cannot be optimized to poison.
This makes a few straightforward optimizations incorrect, such as:

```
;  https://bugs.llvm.org/show_bug.cgi?id=44185

define <4 x float> @insert_not_undef_shuffle_translate_commute(float %x, <4 x float> %y, <4 x float> %q) {
  %xv = insertelement <4 x float> %q, float %x, i32 2
  %r = shufflevector <4 x float> %y, <4 x float> %xv, <4 x i32> { 0, 6, 2, undef }
  ret <4 x float> %r ; %r[3] is undef
}
=>
define <4 x float> @insert_not_undef_shuffle_translate_commute(float %x, <4 x float> %y, <4 x float> %q) {
  %r = insertelement <4 x float> %y, float %x, i32 1
  ret <4 x float> %r ; %r[3] = %y[3], incorrect if %y[3] = poison
}

Transformation doesn't verify!
ERROR: Target is more poisonous than source
```

I’d like to suggest
1. Using poison as insertelement’s placeholder value (IRBuilder::CreateVectorSplat should be patched too)
2. Updating shufflevector’s semantics to return poison element if mask is undef

Note that poison is currently lowered into UNDEF in SelDag, so codegen part is okay.
m_Undef() matches PoisonValue as well, so existing optimizations will still fire.

The only concern is hidden miscompilations that will go incorrect when poison constant is given.
A conservative way is copying all tests having `insertelement undef` & replacing it with `insertelement poison` & run Alive2 on it, but it will create many tests and people won’t like it. :(

Instead, I’ll simply locally maintain the tests and run Alive2.
If there is any bug found, I’ll report it.

Relevant links: https://bugs.llvm.org/show_bug.cgi?id=43958 , http://lists.llvm.org/pipermail/llvm-dev/2019-November/137242.html

Reviewed By: nikic

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

3 years ago[ValueTracking] Use m_LogicalAnd/Or to look into conditions
Juneyoung Lee [Sun, 27 Dec 2020 23:32:45 +0000 (08:32 +0900)]
[ValueTracking] Use m_LogicalAnd/Or to look into conditions

This patch updates isImpliedCondition/isKnownNonZero to look into select form of
and/or as well.

See llvm.org/pr48353 and D93065 for more context

Reviewed By: nikic

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

3 years ago[GVN] Correctly set modified status when doing PRE on indices.
Florian Hahn [Sun, 27 Dec 2020 21:20:45 +0000 (21:20 +0000)]
[GVN] Correctly set modified status when doing PRE on indices.

This patch updates GVN to correctly return the modified status, if PRE
is performed on indices. It fixes a crash when building the test-suite
with EXPENSIVE_CHECKS and LTO.

3 years ago[ValueTracking] Add unit tests for isKnownNonZero, isImpliedCondition (NFC)
Juneyoung Lee [Sun, 27 Dec 2020 21:32:57 +0000 (06:32 +0900)]
[ValueTracking] Add unit tests for isKnownNonZero, isImpliedCondition (NFC)

3 years ago[EarlyCSE] Use m_LogicalAnd/Or matchers to handle branch conditions
Juneyoung Lee [Sun, 27 Dec 2020 20:36:26 +0000 (05:36 +0900)]
[EarlyCSE] Use m_LogicalAnd/Or matchers to handle branch conditions

EarlyCSE's handleBranchCondition says:

```
// If the condition is AND operation, we can propagate its operands into the
// true branch. If it is OR operation, we can propagate them into the false
// branch.
```

This holds for the corresponding select patterns as well.

This is a part of an ongoing work for disabling buggy select->and/or transformations.
See llvm.org/pr48353 and D93065 for more context

Proof:
and: https://alive2.llvm.org/ce/z/MQWodU
or: https://alive2.llvm.org/ce/z/9GLbB_

Reviewed By: nikic

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

3 years ago[GVN] Use m_LogicalAnd/Or to propagate equality from branch conditions
Juneyoung Lee [Sun, 27 Dec 2020 18:46:28 +0000 (03:46 +0900)]
[GVN] Use m_LogicalAnd/Or to propagate equality from branch conditions

This patch makes GVN recognize `select c1, c2, false` as well as `select c1, true, c2`
branch condition and propagate equality from these.

See llvm.org/pr48353, D93065

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

3 years ago[EarlyCSE] Add tests for select form of and/or (NFC)
Juneyoung Lee [Sun, 27 Dec 2020 19:04:07 +0000 (04:04 +0900)]
[EarlyCSE] Add tests for select form of and/or (NFC)

3 years ago[GVN] Add tests for select form of and/or (NFC)
Juneyoung Lee [Sun, 27 Dec 2020 18:39:27 +0000 (03:39 +0900)]
[GVN] Add tests for select form of and/or (NFC)

3 years ago[LV] Set up branch from middle block earlier.
Florian Hahn [Sun, 27 Dec 2020 15:13:09 +0000 (15:13 +0000)]
[LV] Set up branch from middle block earlier.

Previously the branch from the middle block to the scalar preheader & exit
was being set-up at the end of skeleton creation in completeLoopSkeleton.
Inserting SCEV or runtime checks may result in LCSSA phis being created,
if they are required. Adjusting branches afterwards may break those
PHIs.

To avoid this, we can instead create the branch from the middle block
to the exit after we created the middle block, so we have the final CFG
before potentially adjusting/creating PHIs.

This fixes a crash for the included test case. For the non-crashing
case, this is almost a NFC with respect to the generated code. The
only change is the order of the predecessors of the involved branch
targets.

Note an assertion was moved from LoopVersioning() to
LoopVersioning::versionLoop. Adjusting the branches means loop-simplify
form may be broken before constructing LoopVersioning. But LV only uses
LoopVersioning to annotate the loop instructions with !noalias metadata,
which does not require loop-simplify form.

This is a fix for an existing issue uncovered by D93317.

3 years ago[Transforms] Use llvm::append_range (NFC)
Kazu Hirata [Sun, 27 Dec 2020 17:57:28 +0000 (09:57 -0800)]
[Transforms] Use llvm::append_range (NFC)

3 years ago[CodeGen, Transforms] Use *Map::lookup (NFC)
Kazu Hirata [Sun, 27 Dec 2020 17:57:27 +0000 (09:57 -0800)]
[CodeGen, Transforms] Use *Map::lookup (NFC)

3 years ago[llvm-cov] Use is_contained (NFC)
Kazu Hirata [Sun, 27 Dec 2020 17:57:25 +0000 (09:57 -0800)]
[llvm-cov] Use is_contained (NFC)

3 years ago[PatternMatch][LVI] Handle select-form and/or in LVI
Nikita Popov [Tue, 22 Dec 2020 20:20:56 +0000 (21:20 +0100)]
[PatternMatch][LVI] Handle select-form and/or in LVI

Following the discussion in D93065, this adds m_LogicalAnd() and
m_LogicalOr() matchers, that match A && B and A || B logical
operations, either as bitwise operations or select expressions.
As an example usage, LVI is adapted to use these matchers for its
condition reasoning.

The plan here is to switch other parts of LLVM that reason about
and/or of conditions to also support the select forms, and then
merge D93065 (or a variant thereof) to disable the poison-unsafe
select to and/or transform.

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

3 years ago[AArch64] Fix legalization of i128 ctpop without neon
Nikita Popov [Sat, 26 Dec 2020 20:22:34 +0000 (21:22 +0100)]
[AArch64] Fix legalization of i128 ctpop without neon

If neon is disabled, LowerCTPOP will return SDValue() to indicate
that normal legalization should be used. However, ReplaceNodeResults
does not check for this and pushes the empty SDValue() onto the
result vector, which will subsequently result in a crash.

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

3 years ago[AArch64] Add some anyextend testing. NFC
David Green [Sun, 27 Dec 2020 13:36:03 +0000 (13:36 +0000)]
[AArch64] Add some anyextend testing. NFC

This cleans up and regenerates the NEON addw/addl/subw/subl/mlal etc
tests, adding some tests that turn the zext into anyextend using an and
mask.

3 years ago[ARM] Add some NEON anyextend testing. NFC
David Green [Sun, 27 Dec 2020 13:18:10 +0000 (13:18 +0000)]
[ARM] Add some NEON anyextend testing. NFC

This cleans up and regenerates the NEON addw/addl/subw/subl/mlal etc
tests, adding some tests that turn the zext into anyextend using an and
mask.

3 years ago[lldb/test] Automatically skip remote lldb-server tests when applicable
Pavel Labath [Fri, 18 Dec 2020 20:52:26 +0000 (21:52 +0100)]
[lldb/test] Automatically skip remote lldb-server tests when applicable

The tests don't work with remote debugservers. This isn't a problem with
any particular test, but the test infrastructure itself, which is why
each of these tests has a @skipIfDarwinEmbedded decorator.

This patch replaces that with a central category-based solution. It also
moves the ad-hoc windows skipping mechanism there too.

3 years ago[lldb] Surpress "ingoring result" warning in reproducer_handler
Pavel Labath [Sun, 27 Dec 2020 12:56:35 +0000 (13:56 +0100)]
[lldb] Surpress "ingoring result" warning in reproducer_handler

3 years ago[GlobalISel] Fix assertion failures after "GlobalISel: Return APInt from getConstantV...
Amara Emerson [Sun, 27 Dec 2020 07:49:51 +0000 (23:49 -0800)]
[GlobalISel] Fix assertion failures after "GlobalISel: Return APInt from getConstantVRegVal" landed.

APInt binary ops don't promote types but instead assert, which a combine was
relying on.

3 years ago[X86] Remove X86Fmadd SDNode from tablegen. Use standard fma instead. NFC
Craig Topper [Sun, 27 Dec 2020 07:35:48 +0000 (23:35 -0800)]
[X86] Remove X86Fmadd SDNode from tablegen. Use standard fma instead. NFC

I guess I missed this in 4252f7773a5b98b825d17e5f77c7d349cb2fb7c7
when I modified most patterns.

3 years ago[RISCV] Improve VMConstraint checking on more unary and nullary instructions.
Craig Topper [Sun, 27 Dec 2020 02:47:58 +0000 (18:47 -0800)]
[RISCV] Improve VMConstraint checking on more unary and nullary instructions.

We weren't consistently marking unary instructions as OneInput
and vid.v is really ZeroInput but we had no way to mark that.

This patch improves this by removing the error prone OneInput constraint.
Instead we just always look for the mask in the last operand.

It appears that the "CheckReg" variable used for the check on the broken
instruction was unitialized or garbage because it was also used for
VS1/VS2 constraints. I've scoped the variable locally to each check now.

I've gone through and set NoConstraint on instructions that don't have
a real VMConstraint and don't have a mask as the last operand.

I've also removed the unused enum values in RISCVBaseInfo.h. We
never use them in C++ and we have separate versions in a td file.

Reviewed By: HsiangKai

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

3 years ago[ODS] Make the getType() method on a OneResult instruction return a specific type.
Chris Lattner [Thu, 24 Dec 2020 02:13:39 +0000 (18:13 -0800)]
[ODS] Make the getType() method on a OneResult instruction return a specific type.

Implement Bug 46698, making ODS synthesize a getType() method that returns a
specific C++ class for OneResult methods where we know that class.  This eliminates
a common source of casts in things like:

   myOp.getType().cast<FIRRTLType>().getPassive()

because we know that myOp always returns a FIRRTLType.  This also encourages
op authors to type their results more tightly (which is also good for
verification).

I chose to implement this by splitting the OneResult trait into itself plus a
OneTypedResult trait, given that many things are using `hasTrait<OneResult>`
to conditionalize various logic.

While this changes makes many many ops get more specific getType() results, it
is generally drop-in compatible with the previous behavior because 'x.cast<T>()'
is allowed when x is already known to be a T.  The one exception to this is that
we need declarations of the types used by ops, which is why a couple headers
needed additional #includes.

I updated a few things in tree to remove the now-redundant `.cast<>`'s, but there
are probably many more than can be removed.

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

3 years ago[test] Pin some tests to legacy PM
Arthur Eubanks [Sat, 26 Dec 2020 21:46:02 +0000 (13:46 -0800)]
[test] Pin some tests to legacy PM

These all have NPM RUN lines.

3 years ago[CVP] Add tests for select form of and/or (NFC)
Nikita Popov [Sat, 26 Dec 2020 20:47:14 +0000 (21:47 +0100)]
[CVP] Add tests for select form of and/or (NFC)

This tests their handling inside LVI. See D93065 for wider context.

3 years ago[llvm-cov, llvm-symbolizer] Use llvm::erase_if (NFC)
Kazu Hirata [Sat, 26 Dec 2020 20:06:27 +0000 (12:06 -0800)]
[llvm-cov, llvm-symbolizer] Use llvm::erase_if (NFC)

3 years ago[TableGen] Use llvm::erase_if (NFC)
Kazu Hirata [Sat, 26 Dec 2020 20:06:25 +0000 (12:06 -0800)]
[TableGen] Use llvm::erase_if (NFC)

3 years ago[llvm-pdbutil] Use llvm::is_contained (NFC)
Kazu Hirata [Sat, 26 Dec 2020 20:06:24 +0000 (12:06 -0800)]
[llvm-pdbutil] Use llvm::is_contained (NFC)

3 years ago[NFC] Refactor some SourceMgr code
Nathan James [Sat, 26 Dec 2020 17:53:32 +0000 (17:53 +0000)]
[NFC] Refactor some SourceMgr code

3 years ago[SLP] rename reduction variables for readability; NFC
Sanjay Patel [Thu, 24 Dec 2020 19:01:12 +0000 (14:01 -0500)]
[SLP] rename reduction variables for readability; NFC

I am hoping to extend the reduction matching code, and it is
hard to distinguish "ReductionData" from "ReducedValueData".
So extend the tree/root metaphor to include leaves.

Another problem is that the name "OperationData" does not
provide insight into its purpose. I'm not sure if we can alter
that underlying data structure to make the code clearer.

3 years ago[SLP] use switch to improve readability; NFC
Sanjay Patel [Tue, 22 Dec 2020 22:16:30 +0000 (17:16 -0500)]
[SLP] use switch to improve readability; NFC

This will get more complicated when we handle intrinsics like maxnum.

3 years ago[clang-format] PR48569 clang-format fails to align case label with `switch` with...
mydeveloperday [Sat, 26 Dec 2020 15:18:14 +0000 (15:18 +0000)]
[clang-format] PR48569 clang-format fails to align case label with `switch` with Whitesmith Indentation

https://bugs.llvm.org/show_bug.cgi?id=48569

This is a tentative fix which addresses a PR raise regarding Case indentation when working with Whitesmiths Indentation

I could not find online any reference sources as to what the case indentation for Whitesmith's should be (or be allowed to be)

But according to the documentation, we don't obey the rules for Whitesmith's

```
In particular, the documentation states that this option is to "indent case labels one level from the switch statement. When false, use the same indentation level as for the switch statement."
```

The behaviour we add here is actually as the TODO in the tests used to state in {D67627}, but when {D82016} was added and I brought these tests out from being TODO I realized I changed the indentation.

Reviewed By: curdeius, HazardyKnusperkeks

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

3 years ago[ValueTracking] Handle more non-trivial conditions in isKnownNonZero()
Nikita Popov [Sat, 26 Dec 2020 14:22:20 +0000 (15:22 +0100)]
[ValueTracking] Handle more non-trivial conditions in isKnownNonZero()

In 35676a4f9a536a2aab768af63ddbb15bc722d7f9 I've added handling for
non-trivial dominating conditions that imply non-zero on the true
branch. This adds the same support for the false branch.

The changes in pr45360.ll change block ordering and naming, but
don't change the control flow. The urem is still guaraded by a
non-zero check correctly.

3 years ago[ValueTracking] Add more known non zero tests (NFC)
Nikita Popov [Sat, 26 Dec 2020 14:31:49 +0000 (15:31 +0100)]
[ValueTracking] Add more known non zero tests (NFC)

Add tests for non-trivial conditions that imply non-zero on the
false branch rather than the true branch.

The last case already folds due to canonicalization.

3 years ago[RISCV] Define vector widening reduction intrinsic.
Monk Chiang [Sat, 26 Dec 2020 13:21:46 +0000 (21:21 +0800)]
[RISCV] Define vector widening reduction intrinsic.

Define vwredsumu/vwredsum/vfwredosum/vfwredsum

We work with @rogfer01 from BSC to come out this patch.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Zakk Chen <zakk.chen@sifive.com>
Differential Revision: https://reviews.llvm.org/D93807

3 years ago[llvm-objcopy] Use llvm::erase_if (NFC)
Kazu Hirata [Fri, 25 Dec 2020 18:13:18 +0000 (10:13 -0800)]
[llvm-objcopy] Use llvm::erase_if (NFC)

3 years ago[Local] Remove unused function RemovePredecessorAndSimplify (NFC)
Kazu Hirata [Fri, 25 Dec 2020 17:35:20 +0000 (09:35 -0800)]
[Local] Remove unused function RemovePredecessorAndSimplify (NFC)

The last use of the function was removed on Sep 29, 2010 in commit
99c985c37dd45dd0fbd03863037d8e93153783e6.

3 years ago[BasicAA] Pass AC/DT to isKnownNonEqual()
Nikita Popov [Fri, 25 Dec 2020 17:26:00 +0000 (18:26 +0100)]
[BasicAA] Pass AC/DT to isKnownNonEqual()

This allows us to handle assumes etc in the recursive
isKnownNonZero() checks.

3 years ago[llvm-nm, llvm-objdump] Use llvm::is_contained (NFC)
Kazu Hirata [Fri, 25 Dec 2020 17:22:37 +0000 (09:22 -0800)]
[llvm-nm, llvm-objdump] Use llvm::is_contained (NFC)

3 years ago[InstCombine] Generalize icmp handling in isKnownNonZero()
Nikita Popov [Fri, 25 Dec 2020 11:28:01 +0000 (12:28 +0100)]
[InstCombine] Generalize icmp handling in isKnownNonZero()

The dominating condition handling in isKnownNonZero() currently
only takes into account conditions of the form "x != 0" or "x == 0".
However, there are plenty of other conditions that imply non-zero,
a common one being "x s> 0".

Peculiarly, the handling for assumes was already dealing with more
general non-zero-ness conditions, so this just reuses the same
logic for the dominating condition case.

3 years ago[InstCombine] Add additional tests for known non zero (NFC)
Nikita Popov [Fri, 25 Dec 2020 15:13:42 +0000 (16:13 +0100)]
[InstCombine] Add additional tests for known non zero (NFC)

Check conditions that imply non-zero, even if they are not literally
"x != 0".

Using ctlz for testing, as explicit comparison might get folded by
other reasoning.

3 years ago[BasicAA] Pass context instruction to isKnownNonZero()
Nikita Popov [Fri, 25 Dec 2020 10:43:08 +0000 (11:43 +0100)]
[BasicAA] Pass context instruction to isKnownNonZero()

This allows us to handle additional cases like assumes.

3 years ago[BasicAA] Make sure context instruction is symmetric
Nikita Popov [Sun, 13 Dec 2020 19:27:16 +0000 (20:27 +0100)]
[BasicAA] Make sure context instruction is symmetric

D71264 started using a context instruction in a computeKnownBits()
call. However, if aliasing between two GEPs is checked, then the
choice of context instruction will be different for alias(GEP1, GEP2)
and alias(GEP2, GEP1), which is not supposed to happen.

Resolve this by remembering which GEP a certain VarIndex belongs to,
and use that as the context instruction. This makes the choice of
context instruction predictable and symmetric.

It should be noted that this choice of context instruction is
non-optimal (just like the previous choice): The AA query result is
only valid at points that are reachable from *both* instructions.
Using either one of them is conservatively correct, but a larger
context may also be valid to use.

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

3 years ago[mlir] Async: add support for lowering async value operands to LLVM
Eugene Zhulenev [Thu, 24 Dec 2020 13:08:47 +0000 (05:08 -0800)]
[mlir] Async: add support for lowering async value operands to LLVM

Depends On D93592

Add support for `async.execute` async value unwrapping operands:

```
%token = async.execute(%async_value as %unwrapped : !async.value<!my.type>) {
  ...
  async.yield
}
```

Reviewed By: csigg

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

3 years ago[mlir] Async: lowering async.value to LLVM
Eugene Zhulenev [Thu, 24 Dec 2020 13:08:09 +0000 (05:08 -0800)]
[mlir] Async: lowering async.value to LLVM

1. Add new methods to Async runtime API to support yielding async values
2. Add lowering from `async.yield` with value payload to the new runtime API calls

`async.value` lowering requires that payload type is convertible to LLVM and supported by `llvm.mlir.cast` (DialectCast) operation.

Reviewed By: csigg

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

3 years ago[Flang][OpenMP] Add semantic check for OpenMP Private, Firstprivate and Lastprivate...
Praveen [Fri, 25 Dec 2020 08:49:50 +0000 (14:19 +0530)]
[Flang][OpenMP] Add semantic check for OpenMP Private, Firstprivate and Lastprivate clauses.

OpenMP 4.5 - Variables that appear in expressions for statement function definitions
             may not appear in OpenMP Private, Firstprivate or Lastprivate clauses.

Test case : omp-private03.f90

Reviewed By: kiranchandramohan

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

3 years ago[obj2yaml] - Dump the content of a broken hash table properly.
Georgii Rymar [Thu, 24 Dec 2020 10:05:55 +0000 (13:05 +0300)]
[obj2yaml] - Dump the content of a broken hash table properly.

This is similar to D93760.

When something is wrong with the hash table header we dump
its context as a raw data.

Currently we have the calculation overflow issue and it is possible to
bypass the validation we have (and crash).

The patch fixes it.

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

3 years ago[llvm-readelf/obj] - Improve the warning reported when unable to read the stack size.
Georgii Rymar [Thu, 24 Dec 2020 12:32:34 +0000 (15:32 +0300)]
[llvm-readelf/obj] - Improve the warning reported when unable to read the stack size.

It was discussed in D92545 that we might want to improve messages
reported when something is wrong with the stack size section.
This patch does it.

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

3 years ago[libObject] - Add more ELF types to LLVM_ELF_IMPORT_TYPES_ELFT define (ELFTypes.h).
Georgii Rymar [Thu, 24 Dec 2020 11:48:57 +0000 (14:48 +0300)]
[libObject] - Add more ELF types to LLVM_ELF_IMPORT_TYPES_ELFT define (ELFTypes.h).

This allows to get rid of lots for typedefs/usings from many places.

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

3 years ago[AArch64][GlobalISel] Notify observer of mutated instruction for shift custom legaliz...
Amara Emerson [Fri, 25 Dec 2020 08:31:47 +0000 (00:31 -0800)]
[AArch64][GlobalISel] Notify observer of mutated instruction for shift custom legalization.

No test for this because it's a CSE verifier failure that's only exposed in a
WIP patch for enabling CSE throughout the AArch64 GISel pipeline.

3 years ago[RISCV] Define vpopc/vfirst intrinsics.
Zakk Chen [Wed, 23 Dec 2020 15:42:36 +0000 (07:42 -0800)]
[RISCV] Define vpopc/vfirst intrinsics.

Define vpopc/vfirst intrinsics and lower to V instructions.

We work with @rogfer01 from BSC to come out this patch.

Reviewed By: craig.topper

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

3 years ago[Target] Use llvm::any_of (NFC)
Kazu Hirata [Fri, 25 Dec 2020 03:43:26 +0000 (19:43 -0800)]
[Target] Use llvm::any_of (NFC)

3 years ago[RISCV] Define vector mask-register logical intrinsics.
Zakk Chen [Fri, 25 Dec 2020 02:59:05 +0000 (18:59 -0800)]
[RISCV] Define vector mask-register logical intrinsics.

Define vector mask-register logical intrinsics and lower them
to V instructions. Also define pseudo instructions vmmv.m
and vmnot.m.

We work with @rogfer01 from BSC to come out this patch.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Zakk Chen <zakk.chen@sifive.com>
Differential Revision: https://reviews.llvm.org/D93705

3 years ago[RISCV] Add intrinsics for vrgather instruction
ShihPo Hung [Thu, 24 Dec 2020 08:23:35 +0000 (00:23 -0800)]
[RISCV] Add intrinsics for vrgather instruction

This patch defines vrgather intrinsics and lower to V instructions.

We work with @rogfer01 from BSC to come out this patch.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: ShihPo Hung <shihpo.hung@sifive.com>
Differential revision: https://reviews.llvm.org/D93797

3 years ago[RISCV] Define vector single-width reduction intrinsic.
Monk Chiang [Thu, 24 Dec 2020 02:31:35 +0000 (10:31 +0800)]
[RISCV] Define vector single-width reduction intrinsic.

integer group:
vredsum/vredmaxu/vredmax/vredminu/vredmin/vredand/vredor/vredxor
float group:
vfredosum/vfredsum/vfredmax/vfredmin

We work with @rogfer01 from BSC to come out this patch.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Zakk Chen <zakk.chen@sifive.com>
Differential Revision: https://reviews.llvm.org/D93746

3 years ago[LoopIdiom] 'left-shift-until-bittest': keep no-wrap flags on shift, fix edge-case...
Roman Lebedev [Thu, 24 Dec 2020 15:05:38 +0000 (18:05 +0300)]
[LoopIdiom] 'left-shift-until-bittest': keep no-wrap flags on shift, fix edge-case miscompilation for %x.next

While `%x.curr` is always safe to compute, because `LoopBackedgeTakenCount`
will always be smaller than `bitwidth(X)`, i.e. we never get poison,
rewriting `%x.next` is more complicated, however, because `X << LoopTripCount`
will be poison iff `LoopTripCount == bitwidth(X)` (which will happen
iff `BitPos` is `bitwidth(x) - 1` and `X` is `1`).

So unless we know that isn't the case (as alive2 notes, we know it's safe
to do iff shift had no-wrap flags, or bitpos does not indicate signbit,
or we know that %x is never `1`), we'll need to emit an alternative,
safe IR, by either just shifting the `%x.curr`, or conditionally selecting
between the computed `%x.next` and `0`..
Former IR looks better so let's do that.

While there, ensure that we don't drop no-wrap flags from said shift.

3 years ago[NFC][LoopIdiom] Improve test coverage for 'left-shift-until-bittest' pattern
Roman Lebedev [Thu, 24 Dec 2020 13:44:17 +0000 (16:44 +0300)]
[NFC][LoopIdiom] Improve test coverage for 'left-shift-until-bittest' pattern

In particular, add tests with no-wrap flags on shift,
a test where %x is not `1`, and ensure that tests where %bit
is a constant bitwidth-1, or is not a constant bitwidth-1
test both liveout values.

3 years ago[InstCombine] Hoist xor-by-constant from xor-by-value
Roman Lebedev [Thu, 24 Dec 2020 09:29:16 +0000 (12:29 +0300)]
[InstCombine] Hoist xor-by-constant from xor-by-value

This is one of the deficiencies that can be observed in
https://godbolt.org/z/YPczsG after D91038 patch set.

This exposed two missing folds, one was fixed by the previous commit,
another one is `(A ^ B) | ~(A ^ B) --> -1` / `(A ^ B) & ~(A ^ B) --> 0`.

`-early-cse` will catch it: https://godbolt.org/z/4n1T1v,
but isn't meaningful to fix it in InstCombine,
because we'd need to essentially do our own CSE,
and we can't even rely on `Instruction::isIdenticalTo()`,
because there are no guarantees that the order of operands matches.
So let's just accept it as a loss.

3 years ago[NFC][InstCombine] Add test coverage for `(x ^ C) ^ y` pattern
Roman Lebedev [Thu, 24 Dec 2020 09:29:10 +0000 (12:29 +0300)]
[NFC][InstCombine] Add test coverage for `(x ^ C) ^ y` pattern

3 years ago[InstCombine] Fold `a & ~(a ^ b)` to `x & y`
Roman Lebedev [Thu, 24 Dec 2020 11:09:49 +0000 (14:09 +0300)]
[InstCombine] Fold `a & ~(a ^ b)` to `x & y`

```
----------------------------------------
define i32 @and_xor_not_common_op(i32 %a, i32 %b) {
%0:
  %b2 = xor i32 %b, 4294967295
  %t2 = xor i32 %a, %b2
  %t4 = and i32 %t2, %a
  ret i32 %t4
}
=>
define i32 @and_xor_not_common_op(i32 %a, i32 %b) {
%0:
  %t4 = and i32 %a, %b
  ret i32 %t4
}
Transformation seems to be correct!
```

3 years ago[NFC][InstCombine] Add test for `a & ~(a ^ b)` pattern
Roman Lebedev [Thu, 24 Dec 2020 10:48:07 +0000 (13:48 +0300)]
[NFC][InstCombine] Add test for `a & ~(a ^ b)` pattern

... which is a variation of `a & (a ^ ~b)` --> a & b`.
A follow-up patch exposes this missing fold, so we need to fix it first.

3 years ago[NFC][InstCombine] Autogenerate check lines in vec_shuffle.ll test
Roman Lebedev [Thu, 24 Dec 2020 10:46:54 +0000 (13:46 +0300)]
[NFC][InstCombine] Autogenerate check lines in vec_shuffle.ll test

3 years ago[IR][InstCombine] Add m_ImmConstant(), that matches on non-ConstantExpr constants...
Roman Lebedev [Thu, 24 Dec 2020 08:57:35 +0000 (11:57 +0300)]
[IR][InstCombine] Add m_ImmConstant(), that matches on non-ConstantExpr constants, and use it

A pattern to ignore ConstantExpr's is quite common, since they frequently
lead into infinite combine loops, so let's make writing it easier.

3 years ago[NFC] SimplifyCFGOpt::simplifyUnreachable(): pacify unused variable warning
Roman Lebedev [Thu, 24 Dec 2020 18:15:13 +0000 (21:15 +0300)]
[NFC] SimplifyCFGOpt::simplifyUnreachable(): pacify unused variable warning

Thanks to Luke Benes for pointing it out.

3 years ago[CodeGen] Remove unused function hasInlineAsmMemConstraint (NFC)
Kazu Hirata [Thu, 24 Dec 2020 17:17:58 +0000 (09:17 -0800)]
[CodeGen] Remove unused function hasInlineAsmMemConstraint (NFC)

The last use of the function was removed on Sep 13, 2010 in commit
1094c80281e3cdd9e9a9d7ee716da6386b33359b.

3 years ago[CodeGen, Transforms] Use llvm::any_of (NFC)
Kazu Hirata [Thu, 24 Dec 2020 17:08:36 +0000 (09:08 -0800)]
[CodeGen, Transforms] Use llvm::any_of (NFC)

3 years ago[InstCombine] foldICmpUsingKnownBits - use KnownBits signed/unsigned getMin/MaxValue...
Simon Pilgrim [Thu, 24 Dec 2020 14:22:26 +0000 (14:22 +0000)]
[InstCombine] foldICmpUsingKnownBits - use KnownBits signed/unsigned getMin/MaxValue helpers. NFCI.

Replace the local compute*SignedMinMaxValuesFromKnownBits methods with the equivalent KnownBits helpers to determine the min/max value ranges.

3 years ago[Support] Add KnownBits::getSignedMinValue/getSignedMaxValue helpers.
Simon Pilgrim [Thu, 24 Dec 2020 12:07:55 +0000 (12:07 +0000)]
[Support] Add KnownBits::getSignedMinValue/getSignedMaxValue helpers.

Add unit test coverage - a followup will update InstCombineCompares.cpp to use this and could be used by D86578 as well.

3 years ago[Support] Explicitly state that KnownBits::getMinValue/getMaxValue are UNSIGNED value...
Simon Pilgrim [Wed, 23 Dec 2020 14:18:07 +0000 (14:18 +0000)]
[Support] Explicitly state that KnownBits::getMinValue/getMaxValue are UNSIGNED values. NFCI.

Update the comment to make this clear, following the same approach as APInt.

3 years agoMoved dwarf_eh_resume.ll from Generic to X86 folder
Evgeniy Brevnov [Thu, 24 Dec 2020 12:44:50 +0000 (19:44 +0700)]
Moved dwarf_eh_resume.ll from Generic to X86 folder

Make test case x86 specific.

Reviewed By: xbolva00

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

3 years agoRevert "[InstCombine] Check inbounds in load/store of gep null transform (PR48577)"
Nikita Popov [Thu, 24 Dec 2020 11:34:14 +0000 (12:34 +0100)]
Revert "[InstCombine] Check inbounds in load/store of gep null transform (PR48577)"

This reverts commit 899faa50f206073cdd8eeaaa130ffa15f850e656.

Upon further consideration, this does not fix the right issue.
Doing this fold for non-inbounds GEPs is legal, because the
resulting pointer is still based-on null, which has no associated
address range, and as such and access to it is UB.

https://bugs.llvm.org/show_bug.cgi?id=48577#c3

3 years ago[CodeGen] Add "noreturn" attirbute to _Unwind_Resume
Evgeniy Brevnov [Wed, 23 Dec 2020 07:50:36 +0000 (14:50 +0700)]
[CodeGen] Add "noreturn" attirbute to _Unwind_Resume

Currently 'resume' is lowered to _Unwind_Resume with out "noreturn" attribute. Semantically _Unwind_Resume  library call is expected to never return and should be marked as such. Though I didn't find any changes in behavior of existing tests there will be a difference once https://reviews.llvm.org/D79485 lands.

I was not able to come up with the test case anything better than just checking for presence of "noreturn" attribute. Please let me know if there is a better way to test the change.

Reviewed By: xbolva00

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

3 years ago[AMDGPU] Use MUBUF instructions for global address space access
Praveen Velliengiri [Thu, 24 Dec 2020 09:44:01 +0000 (09:44 +0000)]
[AMDGPU] Use MUBUF instructions for global address space access

Currently, the compiler crashes in instruction selection of global
load/stores in gfx600 due to the lack of FLAT instructions. This patch
fix the crash by selecting MUBUF instructions for global load/stores
in gfx600.

Authored-by: Praveen Velliengiri <Praveen.Velliengiri@amd.com>
Reviewed by: t-tye

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

3 years agoRevert "[InstCombine] Fold gep inbounds of null to null"
Nikita Popov [Thu, 24 Dec 2020 09:19:11 +0000 (10:19 +0100)]
Revert "[InstCombine] Fold gep inbounds of null to null"

This reverts commit eb79fd3c928dbbb97f7937963361c1dad2bf8222.

This causes stage2 crashes, possibly due to StringMap being
miscompiled. Reverting for now.

3 years ago[obj2yaml] - Dump the content of a broken GNU hash table properly.
Georgii Rymar [Wed, 23 Dec 2020 13:00:54 +0000 (16:00 +0300)]
[obj2yaml] - Dump the content of a broken GNU hash table properly.

When something is wrong with the GNU hash table header we dump
its context as a raw data.

Currently we have the calculation overflow issue and it is possible to
bypass the validation we have (and crash).

The patch fixes it.

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