Commit Graph

353039 Commits

Author SHA1 Message Date
Sander de Smalen c57720125f [SveEmitter] Add builtins for bitcount operations
This patch adds builtins for svcls, svclz and svcnt.

For merging (_m), zeroing (_z) and don't-care (_x) predication.
2020-04-28 13:53:54 +01:00
Dmitri Gribenko ef06016d73 Revert "[MLIR] Introduce op trait PolyhedralScope"
This reverts commit dd2c639c3c. It broke a
few things -- the explanation will be posted to the review thread.
2020-04-28 14:50:57 +02:00
Sander de Smalen 6f588c6ef3 [SveEmitter] Add builtins for permutations and selection
This patch adds builtins for:
- svlasta and svlastb
- svclasta and svclastb
- svunpkhi and svunpklo
- svuzp1 and svuzp2
- svzip1 and svzip2
- svrev
- svsel
- svcompact
- svsplice
- svtbl
2020-04-28 13:43:11 +01:00
David Zarzycki 8f24c4b72f Revert: [libc++] Create a small DSL for defining Lit features and parameters
This reverts commit 6d58030c8c due to lack
of Python 3 support. As a reminder, the Python community ended their
support for 2.x at the start of 2020.
2020-04-28 08:12:19 -04:00
Igor Kudrin 9f65f5acca [LLD][ELF] Eliminate symbols of merged .ARM.exidx sections.
GNU tools generate mapping symbols "$d" for .ARM.exidx sections. The
symbols are added to the symbol table much earlier than the merging
takes place, and after that, they become dangling. Before the patch,
LLD output those symbols as SHN_ABS with the value of 0. The patch
removes such symbols from the symbol table.

Differential Revision: https://reviews.llvm.org/D78820
2020-04-28 18:58:40 +07:00
Anastasia Stulova fe667e8522 [OpenCL] Fixed test for the cast operators.
The test had unused variable because it missed to cover
case with __constant address space. This change now
completes the testing fully.
2020-04-28 12:46:36 +01:00
Pavel Labath f07f2cee9b [lldb/unittest] Adjust CheckIPSupport function to avoid double-consume of llvm::Error
The problem caught by clang-tidy and reported by Tobias Bosch.
2020-04-28 13:35:07 +02:00
Pavel Labath 5cee8ddcc7 [lldb-vscode] A couple of small style fixes
to make the code conform to llvm style better:
- avoid use of auto where the type is not obivous
- avoid StringRef::data where it is not needed

No functional change intended.
2020-04-28 13:35:07 +02:00
Rainer Orth 3119bdb5d6 [Flang][CMake] Add explicit libFortranCommon dependency for f18 etc.
When I tried Solaris builds with `-DBUILD_SHARED_LIBS=ON`, some commands failed
to link:

  [ 94%] Linking CXX executable ../../../../bin/f18
  Undefined                       first referenced
   symbol                             in file
  Fortran::common::IntrinsicTypeDefaultKinds::set_sizeIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::IntrinsicTypeDefaultKinds::set_subscriptIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::EnumIndexToString[abi:cxx11](int, char const*) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::IntrinsicTypeDefaultKinds::set_defaultIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::IntrinsicTypeDefaultKinds::IntrinsicTypeDefaultKinds() CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::IntrinsicTypeDefaultKinds::set_defaultRealKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  ld: fatal: symbol referencing errors

This patch fixes this by adding explicit dependencies on `libFortranCommon`
to the affected commands.

Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86-64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D78761
2020-04-28 13:28:41 +02:00
KAWASHIMA Takahiro 89f6a2376e [gcov][test] Work around PR45673 - NFC
Work around PR45673 until the test code is fixed.
2020-04-28 20:19:19 +09:00
Sander de Smalen e1932ffbd9 [SveEmitter] Add builtins for ternary ops (fmla, fmad, etc)
This patch adds builtins for:
- svmad, svmla, svmls, svmsb
  svnmad, svnmla, svnmls, svnmsb
  svmla_lane, svmls_lane

These builtins come in several flavours:
- Merge into first source vector (`_m`)
- False lanes are undef (`_x`)
- False lanes are zeroed (`_z`)

And can also have `_n` to indicate the last operand is a scalar.

For example:

  svint32_t svmla[_n_s32]_z(svbool_t pg, svint32_t op1, svint32_t op2, int32_t op3)

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D78960
2020-04-28 10:59:38 +01:00
Chen Zheng 22fdbd01a3 [Powerpc] add triple for new added qpx test case - NFC 2020-04-28 05:32:10 -04:00
Ng Zhi An 500b4ad5f4 [PowerPC] Fix downcast from nullptr for target streamer
getTargetStreamer() might return null (e.g. when running inlined-strings.ll test),
downcasting to a reference will be wrong. This is detectable with -fsanitize=null.

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D78686
2020-04-28 09:20:10 +00:00
Chen Zheng 949018cc27 [PowerPC] add test case for reorder operands of qpx fma instr - nfc. 2020-04-28 04:43:32 -04:00
Alex Zinenko bb1d976feb [mlir][flang] use OpBuilder& instead of Builder* in <Op>::build methods
As we start defining more complex Ops, we increasingly see the need for
Ops-with-regions to be able to construct Ops within their regions in
their ::build methods. However, these methods only have access to
Builder, and not OpBuilder. Creating a local instance of OpBuilder
inside ::build and using it fails to trigger the operation creation
hooks in derived builders (e.g., ConversionPatternRewriter). In this
case, we risk breaking the logic of the derived builder. At the same
time, OpBuilder::create, which is by far the largest user of ::build
already passes "this" as the first argument, so an OpBuilder instance is
already available.

Update all ::build methods in all Ops in MLIR and Flang to take
"OpBuilder &" instead of "Builder *". Note the change from pointer and
to reference to comply with the common style in MLIR, this also ensures
all other users must change their ::build methods.

Differential Revision: https://reviews.llvm.org/D78713
2020-04-28 10:42:08 +02:00
Ehsan Toosi 5c352e69e7 Providing buffer assignment for MLIR
We have provided a generic buffer assignment transformation ported from
TensorFlow. This generic transformation pass automatically analyzes the values
and their aliases (also in other blocks) and returns the valid positions for
Alloc and Dealloc operations. To find these positions, the algorithm uses the
block Dominator and Post-Dominator analyses. In our proposed algorithm, we have
considered aliasing, liveness, nested regions, branches, conditional branches,
critical edges, and independency to custom block terminators. This
implementation doesn't support block loops. However, we have considered this in
our design. For this purpose, it is only required to have a loop analysis to
insert Alloc and Dealloc operations outside of these loops in some special
cases.

Differential Revision: https://reviews.llvm.org/D78484
2020-04-28 10:17:59 +02:00
Hans Wennborg f03b505ee7 Revert f8990feb12 "[libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON"
This broke builds configured with

$ cmake -GNinja -DCMAKE_BUILD_TYPE=Release '-DLLVM_ENABLE_PROJECTS=clang' '-DLLVM_TARGETS_TO_BUILD=X86' -DLLVM_ENABLE_PIC=OFF ../llvm

CMake Error at
/b/s/w/ir/cache/builder/src/third_party/llvm/clang/tools/libclang/CMakeLists.txt:123
(target_compile_definitions):
    target_compile_definitions called with non-compilable target type

This reverts commit f8990feb12.
2020-04-28 10:10:33 +02:00
Gabor Marton 62e747f617 [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls
Summary:
Currently we map function summaries to names (i.e. strings). We can
associate more summaries with different signatures to one name, this way
we support overloading. During a call event we check whether the
signature of the summary matches the signature of the callee and we
apply the summary only in that case.

In this patch we change this mapping to associate a summary to a
FunctionDecl. We do lookup operations when the summary map is
initialized. We lookup the given name and we match the signature of the
given summary against the lookup results. If the summary matches the
FunctionDecl (got from the lookup result) then we add that to the
summary map. During a call event we compare FunctionDecl pointers.
Advantages of this new refactor:
- Cleaner mapping and structure for the checker.
- Possibly way more efficient handling of call events.
- A summary is added only if that is relevant for the given TU.
- We can get the concrete FunctionDecl by the time when we create the
  summary, this opens up possibilities of further sanity checks
  regarding the summary cases and argument constraints.
- Opens up to future work when we'd like to store summaries from IR to a
  FunctionDecl (or from the Attributor results of the given
  FunctionDecl).

Note, we cannot support old C functions without prototypes.

Reviewers: NoQ, Szelethus, balazske, jdoerfert, sstefan1, uenoku

Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, steakhal, uenoku, ASDenysPetrov, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77641
2020-04-28 10:00:50 +02:00
Sam Parker e9c9329aa4 [TTI] Add TargetCostKind argument to getUserCost
There are several different types of cost that TTI tries to provide
explicit information for: throughput, latency, code size along with
a vague 'intersection of code-size cost and execution cost'.

The vectorizer is a keen user of RecipThroughput and there's at least
'getInstructionThroughput' and 'getArithmeticInstrCost' designed to
help with this cost. The latency cost has a single use and a single
implementation. The intersection cost appears to cover most of the
rest of the API.

getUserCost is explicitly called from within TTI when the user has
been explicit in wanting the code size (also only one use) as well
as a few passes which are concerned with a mixture of size and/or
a relative cost. In many cases these costs are closely related, such
as when multiple instructions are required, but one evident diverging
cost in this function is for div/rem.

This patch adds an argument so that the cost required is explicit,
so that we can make the important distinction when necessary.

Differential Revision: https://reviews.llvm.org/D78635
2020-04-28 08:57:45 +01:00
serge-sans-paille e849e7a700 Use components instead of libraries in Polly linkage step
As a side effect, this tests (and fix a bug) in the compiler extension handling
of components.

Differential Revision: https://reviews.llvm.org/D78358
2020-04-28 09:44:10 +02:00
Jonas Paulsson c84461ba8d [SystemZ] Fix test case.
Remove bad kill flags fom load-and-test.mir as discovered by
https://reviews.llvm.org/D78586: "[MachineVerifier] Add more checks for
registers in live-in lists".

Review: Ulrich Weigand
2020-04-28 09:43:03 +02:00
Kazushi (Jam) Marukawa 3c80478d73 [VE] Update branch instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all branch instructions.  This also change
to use %s10 register consistently.

Differential Revision: https://reviews.llvm.org/D78889
2020-04-28 09:41:01 +02:00
Kazushi (Jam) Marukawa 0314e8980f [VE] Support floating point immediate values
Summary:
Add simm7fp/mimmfp to represent floating point immediate values.
Also clean multiclasses to define floating point arithmetic instructions
to handle simm7fp/mimmfp operands.  Also add several regression tests
for new operands.

Differential Revision: https://reviews.llvm.org/D78887
2020-04-28 09:36:10 +02:00
Chen Zheng 45d92806ea [PowerPC] use inst-level fast-math-flags to drive MachineCombiner
Currently, on PowerPC target, it uses function scope UnsafeFPMath
option to drive Machine Combiner pass.

This is not accurate in two ways:
1: the scope is not accurate. Machine Combiner pass only requires
   instruction-level flags instead of the function scope.
2: the float point flag is not accurate. Machine Combiner pass
   only requires float point flags reassoc and nsz.

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D78183
2020-04-28 03:31:12 -04:00
Haojian Wu b73290be9f Fix the -Wunused-variable warning. 2020-04-28 08:44:15 +02:00
Craig Topper e13c141a91 [SelectionDAGBuilder] Use CallBase::isInlineAsm in a couple places. NFC
These lines were just changed from using CallBase::getCalledValue
to getCallledOperand. Go aheand change them to isInlineAsm.
2020-04-27 23:00:44 -07:00
Craig Topper a58b62b4a2 [IR] Replace all uses of CallBase::getCalledValue() with getCalledOperand().
This method has been commented as deprecated for a while. Remove
it and replace all uses with the equivalent getCalledOperand().

I also made a few cleanups in here. For example, to removes use
of getElementType on a pointer when we could just use getFunctionType
from the call.

Differential Revision: https://reviews.llvm.org/D78882
2020-04-27 22:17:03 -07:00
Tony 756ba3548c [AMDGPU] DWARF proposal review feedback
- Rename DW_OP_LLVM_offset_constu to DW_OP_LLVM_offset_uconst to
  matches DW_OP_plus_uconst.
- Correct DW_OP_LLVM_call_ref to be DW_OP_call_ref.
- Move proposed changes to a separate section to clarify that the
  introduction section is not part of the changes.
- Fix formatting typos and add missing reference.
- Clarify why DW_OP_LLVM_offset et al do not wrap on overflow.
- Correct syntax of augmentation string.

Differential Revision: https://reviews.llvm.org/D70523
2020-04-28 00:56:25 -04:00
Uday Bondhugula dd2c639c3c [MLIR] Introduce op trait PolyhedralScope
Introduce op trait `PolyhedralScope` for ops to define a new scope for
polyhedral optimization / affine dialect purposes, thus generalizing
such scopes beyond FuncOp. Ops to which this trait is attached will
define a new scope for the consideration of SSA values as valid symbols
for the purposes of polyhedral analysis and optimization. Update methods
that check for dim/symbol validity to work based on this trait.

Differential Revision: https://reviews.llvm.org/D78863
2020-04-28 09:55:31 +05:30
Mircea Trofin 011a07c075 Fix missing namespace in API implementation. 2020-04-27 21:05:33 -07:00
Mircea Trofin cb56e9b923 [llvm][NFC] Use CallBase instead of Instruction in ProfileSummaryInfo
Summary:
getProfileCount requires the parameter be a valid CallBase, and its uses
reflect that.

Reviewers: dblaikie, craig.topper, wmi

Subscribers: eraman, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78940
2020-04-27 20:47:52 -07:00
Nico Weber cbb61831f5 Revert "[gn build] (manually) merge cd84bfb8142bc7ff3a0"
This reverts commit 825f583c86.
This reverts commit 45417ecbc1.

cd84bfb814 was reverted in be884b7935
2020-04-27 23:31:46 -04:00
Kang Zhang 4bb0a1cb70 [PowerPC] Fix the liveins for ppc-expand-isel pass
Summary:
In the ppc-expand-isel pass, we use stepForward() to update the
liveins, this function is not recommended, because it needs the
accurate kill info.

This patch uses the function computeAndAddLiveIns() to update the
liveins, it's the recommended method and can fix the liveins bug for
ppc-expand-isel pass..

Reviewed By: efriedma, lkail

Differential Revision: https://reviews.llvm.org/D78657
2020-04-28 03:22:48 +00:00
Saleem Abdulrasool be884b7935 Revert "build: use `find_package(Python3)` if available"
This reverts commit cd84bfb814.  Although
this passed the CI in phabricator, some of the bots are missing python3
packages, revert it temporarily.
2020-04-27 20:03:32 -07:00
Nico Weber 825f583c86 [gn build] (manually) merge cd84bfb814 more precisely 2020-04-27 21:55:02 -04:00
Nico Weber 45417ecbc1 [gn build] (manually) merge cd84bfb814 2020-04-27 21:45:58 -04:00
Mehdi Amini f65a3f7c83 Make MLIR Pass Timing output configurable through injection
This makes it possible for the client to control where the pass timings will
be printed.

Differential Revision: https://reviews.llvm.org/D78891
2020-04-28 01:39:25 +00:00
Saleem Abdulrasool cd84bfb814 build: use `find_package(Python3)` if available
This is primarily motivated by the desire to move from Python2 to
Python3.  `PYTHON_EXECUTABLE` is ambiguous.  This explicitly identifies
the python interpreter in use.  Since the LLVM build seems to be able to
completed successfully with python3, use that across the build.  The old
path aliases `PYTHON_EXECUTABLE` to be treated as Python3.
2020-04-28 01:33:10 +00:00
Alexander Shaposhnikov 29c6f5c7fd [llvm-objcopy][MachO] Fix build
Some compilers are confused when the same name is used in different contexts.
Rename the field Section to unbreak the build.
(Caught by the buildbot http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/22374)
2020-04-27 18:20:01 -07:00
Alexander Shaposhnikov 0db3a5a93e [llvm-objcopy][MachO] Handle relocation entries where r_extern is zero
Fix handling of relocations with r_extern == 0.
If r_extern == 0 then r_symbolnum is an index of a section rather than a symbol index.

Patch by Seiya Nuta and Alexander Shaposhnikov.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D78946
2020-04-27 17:59:07 -07:00
Eric Schweitz bc0342383d [flang] Upstream recent work on FIR to llvm-project.
Summary:

Reviewers: DavidTruby, sscalpone, jeanPerier

Subscribers: mgorny, aartbik, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78835
2020-04-27 17:48:57 -07:00
Nick Desaulniers bc7f3240e6 [X86] remove derived method w/ same impl as base
Summary:
While looking into issues with IfConverter, I noticed that
X86InstrInfo::isUnpredicatedTerminator matched its overriden
implementation in TargetInstrInfo::isUnpredicatedTerminator.

Reviewers: craig.topper, hfinkel, MaskRay, echristo

Reviewed By: MaskRay, echristo

Subscribers: hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62749
2020-04-27 17:41:00 -07:00
River Riddle 6fab33b20a [mlir][LLVMDebugTranslation] Only insert the location mapping after translation
This fixes an iteration invalidation bug when the map grows beyond capacity and the iterator for the location to translate becomes invalid.
2020-04-27 16:49:18 -07:00
Jonas Devlieghere a4ccfd9565 [llvm/DebugInfo] Fix typo in DWARFTypeUnit ctor call
We were passing the AppleObjCSection instead of the AddrSection. Maybe
the API changed and this remained unnoticed because the types are the
same, or maybe it's just a typo.
2020-04-27 16:45:17 -07:00
Jonas Devlieghere bbaa639ba9 [llvm/DebugInfo] Print DW_AT_ranges offset as part of verifier error.
Print the DW_AT_ranges offset as part of the verifier error, like we do
for the DW_AT_stmt_list offset.
2020-04-27 16:45:17 -07:00
Christopher Tetreault da8918f27e [SVE][NFC] Use ScalableVectorType in CGBuiltin
Summary: * Upgrade some usages of VectorType to use ScalableVectorType

Reviewers: efriedma, david-arm, fpetrogalli, kmclaughlin

Reviewed By: efriedma

Subscribers: tschuett, rkruppe, psnobl, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78842
2020-04-27 16:29:45 -07:00
Arthur Eubanks 3b0450acec Add IR constructs for preallocated (inalloca replacement)
Add llvm.call.preallocated.{setup,arg} instrinsics.
Add "preallocated" operand bundle which takes a token produced by llvm.call.preallocated.setup.
Add "preallocated" parameter attribute, which is like byval but without the copy.

Verifier changes for these IR constructs.

See https://github.com/rnk/llvm-project/blob/call-setup-docs/llvm/docs/CallSetup.md

Subscribers: hiraditya, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74651
2020-04-27 16:15:50 -07:00
Craig Topper 9ea5cc8a25 [X86][CostModel] Add vXiY->vXi1 truncate tests to min-legal-vector-width.ll. NFC 2020-04-27 15:48:11 -07:00
Christopher Tetreault d52ca3d7e6 [SVE] Add specialized overloads of VectorType::get
Summary:
Add overloads of get to FixedVectorType and ScalableVectorType that
mirror VectorType::get(Type *Ty, VectorType *VTy) that take and return
derived vector types

Reviewers: efriedma, c-rhodes, david-arm, fpetrogalli

Reviewed By: david-arm

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78841
2020-04-27 15:45:57 -07:00
Phoenix Meadowlark 622aac6a0a Add a folder for division by one.
- Adds a folder for integer division by one with the `divi_signed` and `divi_unsigned` ops.
- Creates tests for scalar and tensor versions of these ops.
- Modifies the test in `parallel-loop-collapsing.mlir` so that it doesn't assume division by one will be in the output.

Differential Revision: https://reviews.llvm.org/D78518
2020-04-27 22:35:10 +00:00