platform/upstream/llvm.git
3 years ago[CHR] Use pred_size (NFC)
Kazu Hirata [Wed, 25 Nov 2020 06:52:29 +0000 (22:52 -0800)]
[CHR] Use pred_size (NFC)

3 years agoRevert "[SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIte...
Max Kazantsev [Wed, 25 Nov 2020 06:20:15 +0000 (13:20 +0700)]
Revert "[SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIterations"

This reverts commit 7dcc8899174f44b7447bc48a9f2ff27f5458f8b7.

This patch introduced a logical error that breaks whole logic of this analysis.
All checks we are making are supposed to be loop-independent, so that we could
safely remove the range check. The 'nw' fact is loop-dependent, so we can remove
the check basing on facts from this very check.

Motivating examples will follow-up.

3 years ago[DAGCombine] Add hook to allow target specific test for sqrt input
QingShan Zhang [Wed, 25 Nov 2020 05:37:15 +0000 (05:37 +0000)]
[DAGCombine] Add hook to allow target specific test for sqrt input

PowerPC has instruction ftsqrt/xstsqrtdp etc to do the input test for software square root.
LLVM now tests it with smallest normalized value using abs + setcc. We should add hook to
target that has test instructions.

Reviewed By: Spatel, Chen Zheng, Qiu Chao Fang

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

3 years ago[NewPM] Add pipeline EP callback after initial frontend cleanup
Arthur Eubanks [Thu, 19 Nov 2020 17:38:14 +0000 (09:38 -0800)]
[NewPM] Add pipeline EP callback after initial frontend cleanup

This matches the legacy PM's EP_ModuleOptimizerEarly. Some backends use
this extension point and adding the pass somewhere else like
PipelineStartEPCallback doesn't work.

Reviewed By: ychen

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

3 years ago[IndVars] Use more precise context when eliminating narrowing
Max Kazantsev [Wed, 25 Nov 2020 04:46:22 +0000 (11:46 +0700)]
[IndVars] Use more precise context when eliminating narrowing

When deciding to widen narrow use, we may need to prove some facts
about it. For proof, the context is used. Currently we take the instruction
being widened as the context.

However, we may be more precise here if we take as context the point that
dominates all users of instruction being widened.

Differential Revision: https://reviews.llvm.org/D90456
Reviewed By: skatkov

3 years ago[DAG][PowerPC] Fix dropped `nsw` flag in `SimplifySetCC` by adding `doesNodeExist...
Kai Luo [Wed, 25 Nov 2020 03:28:48 +0000 (03:28 +0000)]
[DAG][PowerPC] Fix dropped `nsw` flag in `SimplifySetCC` by adding `doesNodeExist` helper

`SimplifySetCC` invokes `getNodeIfExists` without passing `Flags` argument and `getNodeIfExists` uses a default `SDNodeFlags` to intersect the original flags, as a consequence, flags like `nsw` is dropped. Added a new helper function `doesNodeExist` to check if a node exists without modifying its flags.

Reviewed By: #powerpc, nemanjai

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

3 years ago[PPC][AIX] Add vector callee saved registers for AIX extended vector ABI
Zarko Todorovski [Wed, 25 Nov 2020 03:37:03 +0000 (22:37 -0500)]
[PPC][AIX] Add vector callee saved registers for AIX extended vector ABI

This patch is the initial patch for support of the AIX extended vector ABI.  The extended ABI treats vector registers V20-V31 as non-volatile and we add them as callee saved registers in this patch.

Reviewed By: sfertile

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

3 years agoTry to fix tests after e16c0a9a68971 with CLANG_DEFAULT_LINKER=lld
Nico Weber [Wed, 25 Nov 2020 03:34:10 +0000 (22:34 -0500)]
Try to fix tests after e16c0a9a68971 with CLANG_DEFAULT_LINKER=lld

Tests that pass -mlinker-version=old version and that then don't
expect new flags to be passed need to explicitly request the system
linker now.

3 years ago[NFC][Test] Format the test for IEEE Long double
QingShan Zhang [Wed, 25 Nov 2020 03:00:24 +0000 (03:00 +0000)]
[NFC][Test] Format the test for IEEE Long double

3 years agoDon't assume the clang binary name contains the string "clang".
Richard Smith [Wed, 25 Nov 2020 02:51:08 +0000 (18:51 -0800)]
Don't assume the clang binary name contains the string "clang".

Also ensure the -cc1 argument is actually part of the clang -cc1 command
line rather than some unrelated command line.

3 years ago[SCEV] Use isa<> pattern for testing for CouldNotCompute [NFC]
Philip Reames [Wed, 25 Nov 2020 02:45:37 +0000 (18:45 -0800)]
[SCEV] Use isa<> pattern for testing for CouldNotCompute [NFC]

Some older code - and code copied from older code - still directly tested against the singelton result of SE::getCouldNotCompute.  Using the isa<SCEVCouldNotCompute> form is both shorter, and more readable.

3 years agoMake CallInst::updateProfWeight emit i32 weights instead of i64
Arthur Eubanks [Sat, 31 Oct 2020 19:38:03 +0000 (12:38 -0700)]
Make CallInst::updateProfWeight emit i32 weights instead of i64

Typically branch_weights are i32, not i64.
This fixes entry_counts_cold.ll under NPM.

Reviewed By: asbirlea

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

3 years agoDebugInfo: Remove llc_dwarf usage from tests already relying on a target triple in...
David Blaikie [Wed, 25 Nov 2020 01:45:47 +0000 (17:45 -0800)]
DebugInfo: Remove llc_dwarf usage from tests already relying on a target triple in the IR

3 years ago[PowerPC][FP128] Fix the incorrect calling convention for IEEE long double on Power8
QingShan Zhang [Wed, 25 Nov 2020 01:38:57 +0000 (01:38 +0000)]
[PowerPC][FP128] Fix the incorrect calling convention for IEEE long double on Power8

For now, we are using the GPR to pass the arguments/return value for fp128 on Power8,
which is incorrect. It should be VSR. The reason why we do it this way is that,
we are setting the fp128 as illegal which make LLVM try to emulate it with i128 on
Power8. So, we need to correct it as legal.

Reviewed By: Nemanjai

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

3 years agoDebugInfo: Add some missing explicit target triples.
David Blaikie [Wed, 25 Nov 2020 01:32:34 +0000 (17:32 -0800)]
DebugInfo: Add some missing explicit target triples.

Based on D91043 by Luís Marques. Thanks Luís!

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

3 years agoFix compilation issue reported by MSVC user on cfe-dev
Reid Kleckner [Wed, 25 Nov 2020 01:26:11 +0000 (17:26 -0800)]
Fix compilation issue reported by MSVC user on cfe-dev

MSVC seems to think this `friend class TrailingObjects;` declaration is
declaring a TrailingObjects class instead of naming the injected base
class. Remove `class` so it does the right thing.

3 years ago[clang-tidy] Support IgnoredRegexp configuration to selectively suppress identifier...
smhc [Wed, 25 Nov 2020 01:18:38 +0000 (01:18 +0000)]
[clang-tidy] Support IgnoredRegexp configuration to selectively suppress identifier naming checks

The idea of suppressing naming checks for variables is to support code bases that allow short variables named e.g 'x' and 'i' without prefix/suffixes or casing styles. This was originally proposed as a 'ShortSizeThreshold' however has been made more generic with a regex to suppress identifier naming checks for those that match.

Reviewed By: njames93, aaron.ballman

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

3 years ago[mlir][sparse] add parallelization strategies to sparse compiler
Aart Bik [Tue, 24 Nov 2020 23:36:10 +0000 (15:36 -0800)]
[mlir][sparse] add parallelization strategies to sparse compiler

This CL adds the ability to request different parallelization strategies
for the generate code. Every "parallel" loop is a candidate, and converted
to a parallel op if it is an actual for-loop (not a while) and the strategy
allows dense/sparse outer/inner parallelization.

This will connect directly with the work of @ezhulenev on parallel loops.

Still TBD: vectorization strategy

Reviewed By: penpornk

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

3 years agoTreat a placeholder type for class template argument deduction as
Richard Smith [Wed, 25 Nov 2020 00:53:58 +0000 (16:53 -0800)]
Treat a placeholder type for class template argument deduction as
substitutable for the deduced template.

As agreed in https://github.com/itanium-cxx-abi/cxx-abi/issues/109.

3 years ago[lld] Add --no-lto-whole-program-visibility
Teresa Johnson [Tue, 24 Nov 2020 22:53:02 +0000 (14:53 -0800)]
[lld] Add --no-lto-whole-program-visibility

Enables overriding earlier --lto-whole-program-visibility.

Variant of D91583 while discussing alternate ways to identify and
handle the --export-dynamic case.

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

3 years agoFix mangling of substitutions for template-prefixes.
Richard Smith [Tue, 24 Nov 2020 23:20:06 +0000 (15:20 -0800)]
Fix mangling of substitutions for template-prefixes.

Previously we only considered using a substitution for a template-name
after already having mangled its prefix, so we'd produce nonsense
manglings like NS3_S4_IiEE where we should simply produce NS4_IiEE.

This is not ABI-compatible with previous Clang versions, and the old
behavior is restored by -fclang-abi-compat=11.0 or earlier.

3 years ago[Sanitizer][RISCV] Fix redefinition of REG_SP
Luís Marques [Wed, 25 Nov 2020 00:03:34 +0000 (00:03 +0000)]
[Sanitizer][RISCV] Fix redefinition of REG_SP

The include header sys/ucontext.h already defines REG_SP as 2, causing
redefinition warnings during compilation. This patch fixes that issue.
(We also can't just use the numerical definition provided by the header,
as REG_SP is used in this file this refers to a struct field.)

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

3 years ago[LAA] Minor code style tweaks [NFC]
Philip Reames [Tue, 24 Nov 2020 23:49:16 +0000 (15:49 -0800)]
[LAA] Minor code style tweaks [NFC]

3 years ago[SelectionDAG] Add PseudoProbeSDNode to LargestSDNode to fix 32-bt build break.
Hongtao Yu [Tue, 24 Nov 2020 20:35:12 +0000 (12:35 -0800)]
[SelectionDAG] Add PseudoProbeSDNode to LargestSDNode to fix 32-bt build break.

3 years ago[AIX] Add mabi=vec-extabi options to enable the AIX extended and default vector ABIs.
Zarko Todorovski [Tue, 24 Nov 2020 23:11:46 +0000 (18:11 -0500)]
[AIX] Add mabi=vec-extabi options to enable the AIX extended and default vector ABIs.

Added support for the options mabi=vec-extabi and mabi=vec-default which are analogous to qvecnvol and qnovecnvol when using XL on AIX.
The extended Altivec ABI on AIX is enabled using mabi=vec-extabi in clang and vec-extabi in llc.

Reviewed By: Xiangling_L, DiggerLin

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

3 years ago[mlir] use STATUS instead of CHECK_* in MLIRDetectPythonEnv.cmake
Alex Zinenko [Mon, 23 Nov 2020 12:58:03 +0000 (13:58 +0100)]
[mlir] use STATUS instead of CHECK_* in MLIRDetectPythonEnv.cmake

CHECK_* directives for message() where added in Cmake 3.17, LLVM
requires 3.14 as minimum so they may not be intepreted correctly and
just print "CHECK_*" into the message stream. Replace them with STATUS.

Reviewed By: stellaraccident

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

3 years ago[MC/AsmParser] Fix use of Arm calling convention in target-agnostic test
Luís Marques [Tue, 24 Nov 2020 22:54:24 +0000 (22:54 +0000)]
[MC/AsmParser] Fix use of Arm calling convention in target-agnostic test

Remove target-specific calling convention specifier in target-agnostic test.

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

3 years ago[RISCV] Set __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x defines
Luís Marques [Tue, 24 Nov 2020 22:46:38 +0000 (22:46 +0000)]
[RISCV] Set __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x defines

The RISCV target did not set the GCC atomic compare and swap defines,
unlike other targets. This broke builds for things like glib on RISCV.

Patch by Kristof Provost (kprovost)

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

3 years ago[ASTImporter] Make the Import() return value consistent with the map of imported...
Raphael Isemann [Tue, 24 Nov 2020 22:08:57 +0000 (23:08 +0100)]
[ASTImporter] Make the Import() return value consistent with the map of imported decls when merging ClassTemplateSpecializationDecls

When importing a `ClassTemplateSpecializationDecl` definition into a TU with a matching
`ClassTemplateSpecializationDecl` definition and a more recent forward decl, the ASTImporter
currently will call `MapImported()` for the definitions, but will return the forward declaration
from the `ASTImporter::Import()` call.

This is triggering some assertions in LLDB when we try to fully import some DeclContexts
before we delete the 'From' AST. The returned 'To' Decl before this patch is just the most recent
forward decl but that's not the Decl with the definition to which the ASTImporter will import
the child declarations.

This patch just changes that the ASTImporter returns the definition that the imported Decl was
merged with instead of the found forward declaration.

Reviewed By: martong

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

3 years ago[RISCV] Add GHC calling convention
Luís Marques [Tue, 24 Nov 2020 22:29:56 +0000 (22:29 +0000)]
[RISCV] Add GHC calling convention

This is a special calling convention to be used by the GHC compiler.

Patch by Andreas Schwab (schwab)

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

3 years agoRevert "[RISCV] Add GHC calling convention"
Luís Marques [Tue, 24 Nov 2020 22:34:20 +0000 (22:34 +0000)]
Revert "[RISCV] Add GHC calling convention"

This reverts commit f8317bb256be2cd8ed81ebc567f0fa626b645f63 due to lack of
proper attribution.

3 years ago[gn build] Port 8d06a678a5c
LLVM GN Syncbot [Tue, 24 Nov 2020 22:27:19 +0000 (22:27 +0000)]
[gn build] Port 8d06a678a5c

3 years ago[SelectionDAG] Avoid aliasing analysis if the object size is unknown.
Hsiangkai Wang [Fri, 20 Nov 2020 00:52:03 +0000 (08:52 +0800)]
[SelectionDAG] Avoid aliasing analysis if the object size is unknown.

If the size of memory access is unknown, do not use it to analysis. One
example of unknown size memory access is to load/store scalable vector
objects on the stack.

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

3 years ago[OpenMP50][DOCS] Mark target data non-contiguous as done, NFC.
cchen [Tue, 24 Nov 2020 22:07:39 +0000 (16:07 -0600)]
[OpenMP50][DOCS] Mark target data non-contiguous as done, NFC.

3 years ago[clangd] Addusing tweak: find insertion point after definition
Adam Czachorowski [Mon, 23 Nov 2020 13:48:57 +0000 (14:48 +0100)]
[clangd] Addusing tweak: find insertion point after definition

When type/function is defined in the middle of the file, previuosly we
would sometimes insert a "using" line before that definition, leading to
a compilation error. With this fix, we pick a point after such
definition in translation unit.

This is not a perfect solution. For example, it still doesn't handle
"using namespace" directives. It is, however, a significant improvement.

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

3 years ago[RISCV] Add GHC calling convention
Luís Marques [Tue, 24 Nov 2020 21:55:06 +0000 (21:55 +0000)]
[RISCV] Add GHC calling convention

This is a special calling convention to be used by the GHC compiler.

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

3 years ago[mlir] Remove SameOperandsAndResultShape when redundant with ElementwiseMappable
Sean Silva [Fri, 13 Nov 2020 01:08:56 +0000 (17:08 -0800)]
[mlir] Remove SameOperandsAndResultShape when redundant with ElementwiseMappable

SameOperandsAndResultShape and ElementwiseMappable have similar
verification, but in general neither is strictly redundant with the
other.

Examples:
- SameOperandsAndResultShape allows
  `"foo"(%0) : tensor<2xf32> -> tensor<?xf32> but ElementwiseMappable
  does not.
- ElementwiseMappable allows
  `select %scalar_pred, %true_tensor, %false_tensor` but
  SameOperandsAndResultShape does not.

SameOperandsAndResultShape is redundant with ElementwiseMappable when
we can prove that the mixed scalar/non-scalar case cannot happen. In
those situations, `ElementwiseMappable & SameOperandsAndResultShape ==
ElementwiseMappable`:
- Ops with 1 operand: the case of mixed scalar and non-scalar operands
  cannot happen since there is only one operand.
- When SameTypeOperands is also present, the mixed scalar/non-scalar
  operand case cannot happen.

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

3 years ago[mlir][sparse] generalize invariant expression handling in sparse compiler
Aart Bik [Mon, 23 Nov 2020 19:01:39 +0000 (11:01 -0800)]
[mlir][sparse] generalize invariant expression handling in sparse compiler

Generalizes invariant handling to anything defined outside the Linalg op
(parameters and SSA computations). Fixes bug that was using parameter number
as tensor number.

Reviewed By: penpornk

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

3 years ago[PowerPC] Don't reuse an illegal typed load for int_to_fp conversion.
Sean Fertile [Tue, 24 Nov 2020 15:07:41 +0000 (10:07 -0500)]
[PowerPC] Don't reuse an illegal typed load for int_to_fp conversion.

When the operand to an (s/u)int_to_fp node is an illegally typed load we
cannot reuse the load address since we can not build a proper dependancy
chain. The legalized loads will use a different chain output then the
illegal load. If we reuse the load address then we will build a
conversion node that uses the chain of the illegal load and operations
which modify the memory address in the other dependancy chain can be
scheduled before the floating point load which feeds the conversion.

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

3 years ago[mlir] Add conversion from SCF parallel loops to OpenMP
Alex Zinenko [Mon, 23 Nov 2020 19:29:27 +0000 (20:29 +0100)]
[mlir] Add conversion from SCF parallel loops to OpenMP

Introduce a conversion pass from SCF parallel loops to OpenMP dialect
constructs - parallel region and workshare loop. Loops with reductions are not
supported because the OpenMP dialect cannot model them yet.

The conversion currently targets only one level of parallelism, i.e. only
one top-level `omp.parallel` operation is produced even if there are nested
`scf.parallel` operations that could be mapped to `omp.wsloop`. Nested
parallelism support is left for future work.

Reviewed By: kiranchandramohan

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

3 years ago[libc++] [P0482] [C++20] Implement missing bits for atomic
Marek Kurdej [Tue, 24 Nov 2020 20:07:06 +0000 (21:07 +0100)]
[libc++] [P0482] [C++20] Implement missing bits for atomic

Added: ATOMIC_CHAR8_T_LOCK_FREE, atomic<char8_t>, atomic_char8_t.
http://wg21.link/P0482

Reviewed By: ldionne, #libc

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

3 years agoAvoid redundant work when computing vtable vcall visibility
Teresa Johnson [Tue, 17 Nov 2020 22:44:25 +0000 (14:44 -0800)]
Avoid redundant work when computing vtable vcall visibility

Add a Visited set to avoid repeatedly processing the same base classes
in complex class hierarchies. This cut down the compile time of one
source file from >12min to ~1min.

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

3 years ago[mlir] NFC - Refactor and expose a helper printOffsetSizesAndStrides helper function.
Nicolas Vasilache [Tue, 24 Nov 2020 19:52:24 +0000 (19:52 +0000)]
[mlir] NFC - Refactor and expose a helper printOffsetSizesAndStrides helper function.

Print part of an op of the form:
```
  <optional-offset-prefix>`[` offset-list `]`
  <optional-size-prefix>`[` size-list `]`
  <optional-stride-prefix>[` stride-list `]`
```

Also address some leftover nits.

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

3 years ago[test] Clean up ppc-features.cpp and improve tests
Fangrui Song [Tue, 24 Nov 2020 19:59:15 +0000 (11:59 -0800)]
[test] Clean up ppc-features.cpp and improve tests

And add ppc-cpus.cpp for -mcpu= specific tests.

3 years ago[mlir] NFC - Refactor and expose a parsing helper for OffsetSizeAndStrideInterface
Nicolas Vasilache [Tue, 24 Nov 2020 14:54:06 +0000 (14:54 +0000)]
[mlir] NFC - Refactor and expose a parsing helper for OffsetSizeAndStrideInterface

Parse trailing part of an op of the form:
```
  <optional-offset-prefix>`[` offset-list `]`
  <optional-size-prefix>`[` size-list `]`
  <optional-stride-prefix>[` stride-list `]`
```
Each entry in the offset, size and stride list either resolves to an integer
constant or an operand of index type.
Constants are added to the `result` as named integer array attributes with
name `OffsetSizeAndStrideOpInterface::getStaticOffsetsAttrName()` (resp.
`getStaticSizesAttrName()`, `getStaticStridesAttrName()`).

Append the number of offset, size and stride operands to `segmentSizes`
before adding it to `result` as the named attribute:
`OpTrait::AttrSizedOperandSegments<void>::getOperandSegmentSizeAttr()`.
Offset, size and stride operands resolution occurs after `preResolutionFn`
to give a chance to leading operands to resolve first, after parsing the
types.
```
ParseResult parseOffsetsSizesAndStrides(
    OpAsmParser &parser, OperationState &result, ArrayRef<int> segmentSizes,
    llvm::function_ref<ParseResult(OpAsmParser &, OperationState &)>
        preResolutionFn = nullptr,
    llvm::function_ref<ParseResult(OpAsmParser &)> parseOptionalOffsetPrefix =
        nullptr,
    llvm::function_ref<ParseResult(OpAsmParser &)> parseOptionalSizePrefix =
        nullptr,
    llvm::function_ref<ParseResult(OpAsmParser &)> parseOptionalStridePrefix =
        nullptr);
```

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

3 years ago[mlir][Python] Sync Python bindings with C API MlirStringRef modification.
zhanghb97 [Tue, 24 Nov 2020 18:35:22 +0000 (18:35 +0000)]
[mlir][Python] Sync Python bindings with C API MlirStringRef modification.

MLIR C API use the `MlirStringRef` instead of `const char *` for the string type now. This patch sync the Python bindings with the C API modification.

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

3 years ago[clangd] Add more trace spans for rename, NFC.
Haojian Wu [Tue, 24 Nov 2020 18:44:42 +0000 (19:44 +0100)]
[clangd] Add more trace spans for rename, NFC.

3 years ago[InstCombine] try difference-of-shifts factorization before negator
Sanjay Patel [Tue, 24 Nov 2020 18:33:12 +0000 (13:33 -0500)]
[InstCombine] try difference-of-shifts factorization before negator

We need to preserve wrapping flags to allow better folds.
The cases with geps may be non-intuitive, but that appears to agree with Alive2:
https://alive2.llvm.org/ce/z/JQcqw7
We create 'nsw' ops independent from the original wrapping on the sub.

3 years ago[InstCombine] add tests for sub of muls; NFC
Sanjay Patel [Tue, 24 Nov 2020 18:22:06 +0000 (13:22 -0500)]
[InstCombine] add tests for sub of muls; NFC

3 years ago[InstCombine] add tests for gep math; NFC
Sanjay Patel [Tue, 24 Nov 2020 18:14:42 +0000 (13:14 -0500)]
[InstCombine] add tests for gep math; NFC

3 years ago[LoopVec] Add a minor clarifying comment
Philip Reames [Tue, 24 Nov 2020 18:44:55 +0000 (10:44 -0800)]
[LoopVec] Add a minor clarifying comment

3 years ago[test] Pin parallel_deletion_cg_update.ll to legacy PM
Arthur Eubanks [Tue, 24 Nov 2020 18:16:22 +0000 (10:16 -0800)]
[test] Pin parallel_deletion_cg_update.ll to legacy PM

This tests legacy PM-specific code.

3 years ago[DSE] Precommit test case for PR48279.
Florian Hahn [Tue, 24 Nov 2020 18:09:26 +0000 (18:09 +0000)]
[DSE] Precommit test case for PR48279.

3 years ago[test] Fix rtf_type_checking.ll under NPM
Arthur Eubanks [Tue, 24 Nov 2020 18:02:12 +0000 (10:02 -0800)]
[test] Fix rtf_type_checking.ll under NPM

3 years ago[HardwareLoops] Change order of SCEV expression construction for InitLoopCount.
Janek van Oirschot [Tue, 24 Nov 2020 16:54:34 +0000 (16:54 +0000)]
[HardwareLoops] Change order of SCEV expression construction for InitLoopCount.

Putting the +1 before the zero-extend will allow scalar evolution to fold the expression in some cases such as the one shown in PowerPC's `shrink-wrap.ll` test.

Reviewed By: samparker

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

3 years ago[clangd] AddUsing: Used spelled text instead of type name.
Adam Czachorowski [Wed, 18 Nov 2020 16:43:19 +0000 (17:43 +0100)]
[clangd] AddUsing: Used spelled text instead of type name.

This improves the behavior related to type aliases, as well as cases of
typo correction.

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

3 years ago[mlir][Python] Fix the last remaining instance of PYTHON_EXECUTABLE.
Stella Laurenzo [Tue, 24 Nov 2020 17:50:18 +0000 (17:50 +0000)]
[mlir][Python] Fix the last remaining instance of PYTHON_EXECUTABLE.

* Was causing auto-detect of pybind11 to fail on clean configure.

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

3 years ago[Driver] Default Generic_GCC aarch64 to -fasynchronous-unwind-tables
Fangrui Song [Tue, 24 Nov 2020 17:51:32 +0000 (09:51 -0800)]
[Driver] Default Generic_GCC aarch64 to -fasynchronous-unwind-tables

In GCC, `aarch64-*-linux` and `aarch64-*-freebsd` made the switch in 2018
(https://gcc.gnu.org/pipermail/gcc-patches/2018-March/495549.html).
In Clang, FreeBSD/Fuchsia/NetBSD/MinGW aarch64 default to -fasynchronous-unwind-tables.

This patch defaults Generic_GCC aarch64 (which affects Linux) to use -fasynchronous-unwind-tables.

Reviewed By: nickdesaulniers

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

3 years ago[AMDGPU] Add a TRANS bit to TSFlags. NFC.
Jay Foad [Mon, 23 Nov 2020 14:13:53 +0000 (14:13 +0000)]
[AMDGPU] Add a TRANS bit to TSFlags. NFC.

This is used to mark transcendental instructions that execute on a
separate pipeline from the normal VALU pipeline.

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

3 years agoFix CalibratedQuantizedType's print function to match parser
Tei Jeong [Tue, 24 Nov 2020 17:34:52 +0000 (09:34 -0800)]
Fix CalibratedQuantizedType's print function to match parser

Reviewed By: liufengdb

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

3 years ago[ThinLTO/WPD] Enable -wholeprogramdevirt-skip in ThinLTO backends
Teresa Johnson [Thu, 19 Nov 2020 19:10:47 +0000 (11:10 -0800)]
[ThinLTO/WPD] Enable -wholeprogramdevirt-skip in ThinLTO backends

Previously this option could be used to skip devirtualizations of the
given functions in regular LTO and in the ThinLTO indexing step. This
change allows them to be skipped in the backend as well, which is useful
when debugging WPD in a distributed ThinLTO backend.

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

3 years ago[PowerPC][PCRelative] Add new pseudo instructions for PCRel TLS to fix R2 clobber...
Victor Huang [Tue, 24 Nov 2020 16:48:11 +0000 (10:48 -0600)]
[PowerPC][PCRelative] Add new pseudo instructions for PCRel TLS to fix R2 clobber issue

New pseudo instructions GETtlsADDRPCREL and GETtlsldADDRPCREL are added for properly
setting REGMASK for tls_get_addr function when using PCRelative address.

Differential Revisien: https://reviews.llvm.org/D91420
Reviewed by: bsaleil

3 years ago[mlir] Add Tosa dialect const folder for tosa.const.
Stella Laurenzo [Tue, 24 Nov 2020 16:58:26 +0000 (16:58 +0000)]
[mlir] Add Tosa dialect const folder for tosa.const.

* Was missed in the initial submission and is required for a ConstantLike op.
* Also adds a materializeConstant hook to preserve it.
* Tightens up the argument constraint on tosa.const to match what is actually legal.

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

3 years ago[libc++] NFC: Fix confusing indentation in <numeric>
Louis Dionne [Tue, 24 Nov 2020 17:26:05 +0000 (12:26 -0500)]
[libc++] NFC: Fix confusing indentation in <numeric>

3 years ago[NFC][tests] Replace non-portable grep with FileCheck
Hubert Tong [Tue, 24 Nov 2020 17:14:03 +0000 (12:14 -0500)]
[NFC][tests] Replace non-portable grep with FileCheck

After commit 2482648a795afbe12774168bbbf70dc14c031267, a GNU grep option
is just passed unconditionally to `grep` in general. This patch fixes
the test for platforms where `grep` is not GNU grep.

3 years agoClear NewGEPBases after finish using them in CodeGenPrep pass
Yichao Yu [Tue, 24 Nov 2020 00:11:17 +0000 (19:11 -0500)]
Clear NewGEPBases after finish using them in CodeGenPrep pass

AFAICT all other set/map are correctly cleared in `runOnFunction`.

With assertion enabled this causes a crash when the module is freed and potentially if a later pass delete the instruction (not observed in real world though). Without assertion this can potentially cause confusing result when running on a new Function/Module.

Reviewed By: loladiro

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

3 years ago[test] Merge parallel_region_merging{,_legacy_pm}.ll
Arthur Eubanks [Tue, 24 Nov 2020 16:56:00 +0000 (08:56 -0800)]
[test] Merge parallel_region_merging{,_legacy_pm}.ll

These are identical except for the RUN lines.
Also pin legacy RUN line to legacy PM.

3 years agoAdd support for STRICT_FSETCC promotion
Thomas Preud'homme [Thu, 19 Nov 2020 23:33:23 +0000 (23:33 +0000)]
Add support for STRICT_FSETCC promotion

Add missing handling of STRICT_FSETCC promotion. This prevents assert
failure in llvm::TargetLoweringBase::getTypeToPromoteTo().

Reviewed By: uweigand

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

3 years ago[libcxx] Implement P1956 rename low-level bit functions
Mark de Wever [Tue, 24 Nov 2020 13:50:49 +0000 (14:50 +0100)]
[libcxx] Implement P1956 rename low-level bit functions

Implements P1956: On the names of low-level bit manipulation functions.

Users may use older versions of libc++ or other standard libraries with the old names. In order to keep compatibility the old functions are kept, but marked as deprecated.

The patch also adds a new config macro `_LIBCPP_DEPRECATED_MSG`. Do you prefer a this is a separate patch?

Reviewed By: ldionne, #libc

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

3 years ago[lld/mac] Implement basic typo correction for flags
Nico Weber [Mon, 23 Nov 2020 15:51:56 +0000 (10:51 -0500)]
[lld/mac] Implement basic typo correction for flags

Also use "unknown flag 'flag'" instead of "unknown flag: flag" for
consistency with the other ports.

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

3 years ago[PowerPC] dyn_cast should be dyn_cast_or_null in MASSV pass
Masoud Ataei [Tue, 24 Nov 2020 16:21:12 +0000 (16:21 +0000)]
[PowerPC] dyn_cast should be dyn_cast_or_null in MASSV pass

It is possible that we have different constants in different slots
of second vector double (float) of pow function. So, in this case
Exp->getSplatValue() will return nullptr. Here, I handle it properly.

Reviewed By: steven.zhang, PowerPC

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

3 years agoclang: Pass -platform-version to new MachO LLD
Nico Weber [Tue, 24 Nov 2020 15:59:57 +0000 (10:59 -0500)]
clang: Pass -platform-version to new MachO LLD

New MachO LLD doesn't implement the old -macos_version_min (etc)
flags, but it understands the modern platform_version flag.
So make the clang driver pass that when using new MachO LLD.

Also, while here, don't pass -lto_library to LLD, since it
links in LTO libraries statically (which it can because it's
versioned alongside clang).

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

3 years ago[clang-offload-bundler] use std::forward_list for storing temp file names [NFC]
Sergey Dmitriev [Tue, 24 Nov 2020 15:52:46 +0000 (07:52 -0800)]
[clang-offload-bundler] use std::forward_list for storing temp file names [NFC]

Use a different container that preserves existing elements on modification
for storing temporary file names. Current container can make StringRefs
returned earlier invalid on reallocation.

Reviewed By: ABataev

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

3 years agolld: Fix darwinnew symlink name added in e16c0a9a68971
Nico Weber [Tue, 24 Nov 2020 16:06:51 +0000 (11:06 -0500)]
lld: Fix darwinnew symlink name added in e16c0a9a68971

3 years ago[libc++] Remove _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED.
Arthur O'Dwyer [Mon, 23 Nov 2020 17:44:41 +0000 (12:44 -0500)]
[libc++] Remove _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED.

Zoe Carver says: "We decided that libc++ only supports C++20 constexpr algorithms
when `is_constant_evaluated` is also supported. Here's a link to the discussion."
https://reviews.llvm.org/D65721#inline-735682

Remove _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED from tests, too.
See Louis's 5911e6a8857f146fb5a8f23af1d768aba25e7c3e if needed to fix bots.
I've applied `UNSUPPORTED: clang-8` preemptively to the altered tests;
I don't know for sure that this was needed, because no clang-8 buildbots
are triggered on pull requests.

3 years ago[clangd] Mention when CXXThis is implicit in exposed AST.
Sam McCall [Fri, 20 Nov 2020 14:47:55 +0000 (15:47 +0100)]
[clangd] Mention when CXXThis is implicit in exposed AST.

Seeing an implicit this in the AST is pretty confusing I think.
While here, also mention when `this` is const.

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

3 years agoFix driver test from e16c0a9a689719
Nico Weber [Tue, 24 Nov 2020 14:43:22 +0000 (09:43 -0500)]
Fix driver test from e16c0a9a689719

The test failed silently if lld wasn't built alongside clang.
But the test uses -###, so the "invalid linker name in -fuse-ld=lld"
diag didn't make clang fail, and something else happened to match
"-demangle", so the test passed.

To fix, pass -B to a directory with two empty +x files (which works
on non-Windows), and look for `"-demangle"` instead of just `-demangle`.
Also force linker_version to 0 and pass a darwin triple.

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

3 years ago[llvm-mca] Fix processing thumb instruction set
Evgeny Leviant [Tue, 24 Nov 2020 15:27:59 +0000 (18:27 +0300)]
[llvm-mca] Fix processing thumb instruction set

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

3 years ago[NFC][AIX][XCOFF] change function name from getNumofGPRsSaved to getNumOfGPRsSaved
diggerlin [Tue, 24 Nov 2020 15:23:57 +0000 (10:23 -0500)]
[NFC][AIX][XCOFF] change function name from getNumofGPRsSaved to getNumOfGPRsSaved

change function name from getNumofGPRsSaved to getNumOfGPRsSaved for class XCOFFTracebackTable

Reviewers: Jason Liu
Differential Revision: https://reviews.llvm.org/D91882

3 years ago[MC][ARM] Fix number of operands of tMOVSr
Evgeny Leviant [Tue, 24 Nov 2020 15:13:10 +0000 (18:13 +0300)]
[MC][ARM] Fix number of operands of tMOVSr

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

3 years ago[mlir] NFC - Expose an OffsetSizeAndStrideOpInterface
Nicolas Vasilache [Tue, 24 Nov 2020 14:23:57 +0000 (14:23 +0000)]
[mlir] NFC - Expose an OffsetSizeAndStrideOpInterface

This revision will make it easier to create new ops base on the strided memref abstraction outside of the std dialect.

OffsetSizeAndStrideOpInterface is an interface for ops that allow specifying mixed dynamic and static offsets, sizes and strides variadic operands.
    Ops that implement this interface need to expose the following methods:
      1. `getArrayAttrRanks` to specify the length of static integer
          attributes.
      2. `offsets`, `sizes` and `strides` variadic operands.
      3. `static_offsets`, resp. `static_sizes` and `static_strides` integer
          array attributes.

    The invariants of this interface are:
      1. `static_offsets`, `static_sizes` and `static_strides` have length
          exactly `getArrayAttrRanks()`[0] (resp. [1], [2]).
      2. `offsets`, `sizes` and `strides` have each length at most
         `getArrayAttrRanks()`[0] (resp. [1], [2]).
      3. if an entry of `static_offsets` (resp. `static_sizes`,
         `static_strides`) is equal to a special sentinel value, namely
         `ShapedType::kDynamicStrideOrOffset` (resp. `ShapedType::kDynamicSize`,
         `ShapedType::kDynamicStrideOrOffset`), then the corresponding entry is
         a dynamic offset (resp. size, stride).
      4. a variadic `offset` (resp. `sizes`, `strides`) operand  must be present
         for each dynamic offset (resp. size, stride).

    This interface is useful to factor out common behavior and provide support
    for carrying or injecting static behavior through the use of the static
    attributes.

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

3 years agoclang+lld: Improve clang+ld.darwinnew.lld interaction, pass -demangle
Nico Weber [Fri, 20 Nov 2020 18:57:44 +0000 (13:57 -0500)]
clang+lld: Improve clang+ld.darwinnew.lld interaction, pass -demangle

This patch:
- adds an ld64.lld.darwinnew symlink for lld, to go with f2710d4b576,
  so that `clang -fuse-ld=lld.darwinnew` can be used to test new
  Mach-O lld while it's in bring-up. (The expectation is that we'll
  remove this again once new Mach-O lld is the defauld and only Mach-O
  lld.)
- lets the clang driver know if the linker is lld (currently
  only triggered if `-fuse-ld=lld` or `-fuse-ld=lld.darwinnew` is
  passed). Currently only used for the next point, but could be used
  to implement other features that need close coordination between
  compiler and linker, e.g. having a diag for calling `clang++` instead
  of `clang` when link errors are caused by a missing C++ stdlib.
- lets the clang driver pass `-demangle` to Mach-O lld (both old and
  new), in addition to ld64
- implements -demangle for new Mach-O lld
- changes demangleItanium() to accept _Z, __Z, ___Z, ____Z prefixes
  (and updates one test added in D68014). Mach-O has an extra
  underscore for symbols, and the three (or, on Mach-O, four)
  underscores are used for block names.

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

3 years ago[LV] Keep Primary Induction alive when folding tail by masking
Ayal Zaks [Tue, 24 Nov 2020 10:15:18 +0000 (12:15 +0200)]
[LV] Keep Primary Induction alive when folding tail by masking

Fix PR47390.

The primary induction should be considered alive when folding tail by masking,
because it will be used by said masking; even when it may otherwise appear
useless: feeding only its own 'bump', which is correctly considered dead, and
as the 'bump' of another induction variable, which may wrongfully want to
consider its bump = the primary induction, dead.

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

3 years ago[HIP] Fix regressions due to fp contract change
Yaxun (Sam) Liu [Fri, 23 Oct 2020 20:24:48 +0000 (16:24 -0400)]
[HIP] Fix regressions due to fp contract change

Recently HIP toolchain made a change to use clang instead of opt/llc to do compilation
(https://reviews.llvm.org/D81861). The intention is to make HIP toolchain canonical like
other toolchains.

However, this change introduced an unintentional change regarding backend fp fuse
option, which caused regressions in some HIP applications.

Basically before the change, HIP toolchain used clang to generate bitcode, then use
opt/llc to optimize bitcode and generate ISA. As such, the amdgpu backend takes
the default fp fuse mode which is 'Standard'. This mode respect contract flag of
fmul/fadd instructions and do not fuse fmul/fadd instructions without contract flag.

However, after the change, HIP toolchain now use clang to generate IR, do optimization,
and generate ISA as one process. Now amdgpu backend fp fuse option is determined
by -ffp-contract option, which is 'fast' by default. And this -ffp-contract=fast language option
is translated to 'Fast' fp fuse option in backend. Suddenly backend starts to fuse fmul/fadd
instructions without contract flag.

This causes wrong result for some device library functions, e.g. tan(-1e20), which should
return 0.8446, now returns -0.933. What is worse is that since backend with 'Fast' fp fuse
option does not respect contract flag, there is no way to use #pragma clang fp contract
directive to enforce fp contract requirements.

This patch fixes the regression by introducing a new value 'fast-honor-pragmas' for -ffp-contract
and use it for HIP by default. 'fast-honor-pragmas' is equivalent to 'fast' in frontend but
let the backend to use 'Standard' fp fuse option. 'fast-honor-pragmas' is useful since 'Fast'
fp fuse option in backend does not honor contract flag, it is of little use to HIP
applications since all code with #pragma STDC FP_CONTRACT or any IR from a
source compiled with -ffp-contract=on is broken.

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

3 years ago[docs] Try to make this bullet list in ThinLTO.rst actually be a bullet list
Hans Wennborg [Tue, 24 Nov 2020 13:08:42 +0000 (14:08 +0100)]
[docs] Try to make this bullet list in ThinLTO.rst actually be a bullet list

3 years ago[MLIR] Fix TableGen generator for attribute interfaces.
Ulysse Beaugnon [Tue, 24 Nov 2020 12:57:18 +0000 (13:57 +0100)]
[MLIR] Fix TableGen generator for attribute interfaces.

Use the correct interface base type name when generating attribute interfaces
with TabeGen.

Reviewed By: ftynse

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

3 years ago[RISCV] Combine GREVI sequences
Fraser Cormack [Fri, 20 Nov 2020 17:10:24 +0000 (17:10 +0000)]
[RISCV] Combine GREVI sequences

This combine step performs the following type of transformation:

    rev.p a0, a0   # grevi a0, a0, 0b01
    rev2.n a0, a0  # grevi a0, a0, 0b10
    -->
    rev.n a0, a0   # grevi a0, a0, 0b11

Reviewed By: craig.topper

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

3 years ago[clangd] Fix shared-lib builds
Kadir Cetinkaya [Fri, 20 Nov 2020 12:02:18 +0000 (13:02 +0100)]
[clangd] Fix shared-lib builds

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

3 years ago[IR] Constant::getAggregateElement - early-out for ScalableVectorType
Simon Pilgrim [Tue, 24 Nov 2020 11:38:30 +0000 (11:38 +0000)]
[IR] Constant::getAggregateElement - early-out for ScalableVectorType

We can't call getNumElements() for ScalableVectorType types - just bail for now, although ConstantAggregateZero/UndefValue could return a reasonable value.

Fixes crash shown in OSS-Fuzz #25272 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25272

3 years ago[mlir] AsyncRuntime: fix concurrency bugs + fix exports in methods definitions
Eugene Zhulenev [Tue, 24 Nov 2020 11:17:33 +0000 (03:17 -0800)]
[mlir] AsyncRuntime: fix concurrency bugs + fix exports in methods definitions

1. Move ThreadPool ownership to the runtime, and wait for the async tasks completion in the destructor.
2. Remove MLIR_ASYNCRUNTIME_EXPORT from method definitions because they are unnecessary in .cpp files, as only function declarations need to be exported, not their definitions.
3. Fix concurrency bugs in group emplace and potential use-after-free in token emplace.

Tested internally 10k runs in `async.mlir` and `async-group.mlir`.

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

Reviewed By: mehdi_amini

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

3 years agoRevert "[NFC][SCEV] Generalize monotonicity check for full and limited iteration...
Max Kazantsev [Tue, 24 Nov 2020 10:56:59 +0000 (17:56 +0700)]
Revert "[NFC][SCEV] Generalize monotonicity check for full and limited iteration space"

This reverts commit 2734a9ebf4a31df0131acdfc739395a5e692c342.

This patch appeared to not be a NFC. It introduced an execution path where
monotonicity check on limited space started relying in existing nsw/nuw
flags, which is illegal. The motivating test will follow-up.

3 years ago[SchedModels] Improve diagnostics. NFC
Evgeny Leviant [Tue, 24 Nov 2020 10:52:32 +0000 (13:52 +0300)]
[SchedModels] Improve diagnostics. NFC

3 years ago[mlir][linalg] Add bufferization pattern for `linalg.indexed_generic`.
Alexander Belyaev [Tue, 24 Nov 2020 10:09:33 +0000 (11:09 +0100)]
[mlir][linalg] Add bufferization pattern for `linalg.indexed_generic`.

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

3 years ago[OpenMP] fix asm code for for arm64 (AARCH64) for Darwin/macOS
AndreyChurbanov [Tue, 24 Nov 2020 10:08:24 +0000 (13:08 +0300)]
[OpenMP] fix asm code for for arm64 (AARCH64) for Darwin/macOS

Adjusted external reference for Darwin/AARCH64 link compatibility.
Made size directive conditional only if __ELF__ defined.

Patch by Michael_Pique <mpique@icloud.com>

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

3 years ago[libc++] [www] Fix HTML. NFC.
Marek Kurdej [Tue, 24 Nov 2020 10:06:08 +0000 (11:06 +0100)]
[libc++] [www] Fix HTML. NFC.

Needed for a future automatic update to RST.

3 years ago[SchedModels] Limit set of predicates seen by mutuallyExclusive
Evgeny Leviant [Tue, 24 Nov 2020 09:44:10 +0000 (12:44 +0300)]
[SchedModels] Limit set of predicates seen by mutuallyExclusive

Patch limits set of predicates seen by mutuallyExclusive to ones which belong
to current processor model. This needs to be done, because same predicate can
be used by multiple processor models which can make mutuallyExclusive over
optimistic.

3 years ago[DAGCombine][PowerPC] Convert negated abs to trivial arithmetic ops
Kai Luo [Tue, 24 Nov 2020 08:17:46 +0000 (08:17 +0000)]
[DAGCombine][PowerPC] Convert negated abs to trivial arithmetic ops

This patch converts `0 - abs(x)` to `Y = sra (X, size(X)-1); sub (Y, xor (X, Y))` for better codegen.

Reviewed By: RKSimon

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

3 years ago[llvm-readelf/obj] - Refine the implementation of `printGNUVersionSectionProlog`
Georgii Rymar [Mon, 23 Nov 2020 13:18:00 +0000 (16:18 +0300)]
[llvm-readelf/obj] - Refine the implementation of `printGNUVersionSectionProlog`

This:
1) Changes its signature.
2) Refines the name of local variable (`SymTabName`->`LinkedSecName`,
   because SHT_GNU_verneed/SHT_GNU_verdef are linked with the string table, not with the symbol table).
3) Stops using the `unwrapOrError` inside.

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

3 years ago[llvm-readelf/obj] - Improve the error reporting in printStackSize().
Georgii Rymar [Tue, 17 Nov 2020 13:15:45 +0000 (16:15 +0300)]
[llvm-readelf/obj] - Improve the error reporting in printStackSize().

This stops using `RelocationRef` API in the `printStackSize` method
and starts using the "regular" API that is used in almost all other places
in ELFDumper.cpp.

This is not only makes the code to be more consistent, but helps to diagnose
issues better, because the `ELFObjectFile` API, which is used
currently to implement stack sized dumping sometimes has a behavior
that just doesn't work well for broken inputs.

E.g see how it gets the `symbol_end` iterator. It will just not work
well for a case when the `sh_size` is broken.

```
template <class ELFT>
basic_symbol_iterator ELFObjectFile<ELFT>::symbol_end() const {
...
  DataRefImpl Sym = toDRI(SymTab, SymTab->sh_size / sizeof(Elf_Sym));
  return basic_symbol_iterator(SymbolRef(Sym, this));
}
```

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

3 years agoAdd support for branch forms of ALU instructions to Cortex-A57 model
Evgeny Leviant [Tue, 24 Nov 2020 08:43:51 +0000 (11:43 +0300)]
Add support for branch forms of ALU instructions to Cortex-A57 model

Patch fixes scheduling of ALU instructions which modify pc register. Patch
also fixes computation of mutually exclusive predicates for sequences of
variants to be properly expanded

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