OSDN Git Service

android-x86/external-llvm.git
5 years ago[InstCombine] Add splat vector constant support to foldICmpAddOpConst.
Craig Topper [Mon, 20 Aug 2018 23:04:25 +0000 (23:04 +0000)]
[InstCombine] Add splat vector constant support to foldICmpAddOpConst.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340231 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Remove an unused argument from writeSPToMemory (NFC)
Heejin Ahn [Mon, 20 Aug 2018 23:02:15 +0000 (23:02 +0000)]
[WebAssembly] Remove an unused argument from writeSPToMemory (NFC)

Reviewers: dschuff

Subscribers: dschuff, sbc100, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340230 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-strip] Allow only one input
Fangrui Song [Mon, 20 Aug 2018 23:01:57 +0000 (23:01 +0000)]
[llvm-strip] Allow only one input

Summary: Before, llvm-strip accepted a second argument but it would just be ignored.

Reviewers: alexshap, jhenderson, paulsemel

Reviewed By: alexshap

Subscribers: jakehehrlich, rupprecht, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340229 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-mca] Remove unused formal parameter. NFC.
Matt Davis [Mon, 20 Aug 2018 22:41:27 +0000 (22:41 +0000)]
[llvm-mca] Remove unused formal parameter. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340227 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoextend binop folds for selects to include true and false binops flag intersection
Michael Berg [Mon, 20 Aug 2018 22:26:58 +0000 (22:26 +0000)]
extend binop folds for selects to include true and false binops flag intersection

Summary: This change address bug 38641

Reviewers: spatel, wristow

Reviewed By: spatel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340222 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objdump] Add ability to demangle COFF symbols.
Zachary Turner [Mon, 20 Aug 2018 22:18:21 +0000 (22:18 +0000)]
[llvm-objdump] Add ability to demangle COFF symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340221 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add test command line to expose PR38649.
Craig Topper [Mon, 20 Aug 2018 21:51:35 +0000 (21:51 +0000)]
[X86] Add test command line to expose PR38649.

Bypass slow division and constant hoisting are conspiring to break div+rem of large constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340217 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Prevent lowerVectorShuffleByMerging128BitLanes from creating cycles
Craig Topper [Mon, 20 Aug 2018 21:08:35 +0000 (21:08 +0000)]
[X86] Prevent lowerVectorShuffleByMerging128BitLanes from creating cycles

Due to some splat handling code in getVectorShuffle, its possible for NewV1/NewV2 to have their mask modified from what is requested. This can lead to cycles being created in the DAG.

This patch examines the returned mask and makes sure its different. Long term we may need to look closer at that splat code in getVectorShuffle, or add more splat awareness to getVectorShuffle.

Fixes PR38639

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340214 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Teach combineTruncatedArithmetic to handle some cases of ISD::SUB
Craig Topper [Mon, 20 Aug 2018 20:57:35 +0000 (20:57 +0000)]
[X86] Teach combineTruncatedArithmetic to handle some cases of ISD::SUB

We can safely avoid interfering with the subus combine if both inputs are freely truncatable. Either both extends, or an extend and a constant vector.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340212 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Pre-commit test cases for D50878.
Craig Topper [Mon, 20 Aug 2018 20:57:32 +0000 (20:57 +0000)]
[X86] Pre-commit test cases for D50878.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340211 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LegacyPassManager] Remove analysis P from AnUsageMap before deleting it in schedulePass.
Craig Topper [Mon, 20 Aug 2018 20:57:30 +0000 (20:57 +0000)]
[LegacyPassManager] Remove analysis P from AnUsageMap before deleting it in schedulePass.

If we deem the analysis pass useless and delete it, we need to make sure we remove it from AnUsageMap. Otherwise we might allocate another pass in the freed memory. This will cause us to reuse the AnalysisUsage from the original pass instead of the new one.

Fixes PR38511

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340210 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoConsistently use MemoryLocation::UnknownSize to indicate unknown access size
Krzysztof Parzyszek [Mon, 20 Aug 2018 20:37:57 +0000 (20:37 +0000)]
Consistently use MemoryLocation::UnknownSize to indicate unknown access size

1. Change the software pipeliner to use unknown size instead of dropping
   memory operands. It used to do it before, but MachineInstr::mayAlias
   did not handle it correctly.
2. Recognize UnknownSize in MachineInstr::mayAlias.
3. Print and parse UnknownSize in MIR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340208 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd missing include (<functional> for std::ref)
David Blaikie [Mon, 20 Aug 2018 20:02:29 +0000 (20:02 +0000)]
Add missing include (<functional> for std::ref)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340205 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMove Itanium demangler implementation into a header file and add visitation support.
Richard Smith [Mon, 20 Aug 2018 19:44:01 +0000 (19:44 +0000)]
Move Itanium demangler implementation into a header file and add visitation support.

Summary:
This transforms the Itanium demangler into a generic reusable library that can
be used to build, traverse, and transform Itanium mangled name trees.

This is in preparation for adding a canonicalizing demangler, which
cannot live in the Demangle library for layering reasons. In order to
keep the diffs simpler, this patch moves more code to the new header
than is strictly necessary: in particular, all of the printLeft /
printRight implementations can be moved to the implementation file.
(And indeed we could make them non-virtual now if we wished, and remove
the vptr from Node.)

All nodes are now included in the Kind enumeration, rather than omitting
some of the Expr nodes, and the three different floating-point literal
node types now have distinct Kind values.

As a proof of concept for the visitation / matching mechanism, this
patch implements a Node dumping facility on top of it, replacing the
prior mechanism that produced the pretty-printed output rather than a
tree dump. Sample dump output:

FunctionEncoding(
  NameType("int"),
  NameWithTemplateArgs(
    NestedName(
      NameWithTemplateArgs(
        NameType("A"),
        TemplateArgs(
          {NameType("B")})),
      NameType("f")),
    TemplateArgs(
      {NameType("int")})),
  {},
  <null>,
  QualConst, FunctionRefQual::FrefQualLValue)

As a next step, it would make sense to move the LLVM high-level interface to
the demangler (the itaniumDemangler function and ItaniumPartialDemangler class)
into the Support library, and implement them in terms of the Demangle library.
This would allow the libc++abi demangler implementation to be an identical copy
of the llvm Demangle library, and would allow the LLVM implementation to reuse
LLVM components such as llvm::BumpPtrAllocator, but we'll need to decide how to
coordinate that with the MS ABI demangler, so I'm not doing that in this patch.

No functionality change intended other than the behavior of dump().

Reviewers: erik.pilkington, zturner, chandlerc, dlj

Subscribers: aheejin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340203 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space"
Vitaly Buka [Mon, 20 Aug 2018 19:31:03 +0000 (19:31 +0000)]
Revert "AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space"

As it introduces out of bound access.

This reverts commit r340172 and r340171

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340202 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FPEnv] Support constrained FREM intrinsic
Cameron McInally [Mon, 20 Aug 2018 19:28:56 +0000 (19:28 +0000)]
[FPEnv] Support constrained FREM intrinsic

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340201 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PSV] Update API to be able to use TargetCustom without UB.
Marcello Maggioni [Mon, 20 Aug 2018 19:23:45 +0000 (19:23 +0000)]
[PSV] Update API to be able to use TargetCustom without UB.

getTargetCustom() requires values for "Kind" in the constructor
that are not in the PSVKind enum. Passing a value that is not inside
an enum as an argument to a constructor of the type of the enum is
UB. Changing to the underlying type of the enum would solve the UB

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340200 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MS Demangler] Demangle member pointer template parameters.
Zachary Turner [Mon, 20 Aug 2018 19:15:35 +0000 (19:15 +0000)]
[MS Demangler] Demangle member pointer template parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340199 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Revert r339977: [GISel]: Add Opcodes for a few LLVM Intrinsics"
Aditya Nandakumar [Mon, 20 Aug 2018 18:43:19 +0000 (18:43 +0000)]
Revert "Revert r339977: [GISel]: Add Opcodes for a few LLVM Intrinsics"

This reverts commit 7debc334e6421bb5251ef8f18e97166dfc7dd787.

I missed updating legalizer-info-validation.mir as I had assertions
turned off in my build and that specific test requires asserts. Fixed it
now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340197 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TargetLowering] Disable BuildSDiv division by one or negone.
Simon Pilgrim [Mon, 20 Aug 2018 18:23:54 +0000 (18:23 +0000)]
[TargetLowering] Disable BuildSDiv division by one or negone.

Fuzz tests have detected an issue, currently working on a fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340195 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ConstantFolding] improve folding of binops with vector undef operand
Sanjay Patel [Mon, 20 Aug 2018 18:19:02 +0000 (18:19 +0000)]
[ConstantFolding] improve folding of binops with vector undef operand

A non-undef operand may still have undef constant elements,
so we should always propagate the vector results per-lane.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340194 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Update comment to better describe cfg change (NFC).
Alina Sbirlea [Mon, 20 Aug 2018 18:15:02 +0000 (18:15 +0000)]
[MemorySSA] Update comment to better describe cfg change (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340192 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ConstantFolding] add tests for binops on vectors with undef elements; NFC
Sanjay Patel [Mon, 20 Aug 2018 17:31:34 +0000 (17:31 +0000)]
[ConstantFolding] add tests for binops on vectors with undef elements; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340190 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoValueTracking: Handle more instructions in isKnownNeverNaN
Matt Arsenault [Mon, 20 Aug 2018 16:51:00 +0000 (16:51 +0000)]
ValueTracking: Handle more instructions in isKnownNeverNaN

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340187 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert rr340111 "[GISel]: Add Legalization/lowering code for bit counting operations"
Reid Kleckner [Mon, 20 Aug 2018 16:50:19 +0000 (16:50 +0000)]
Revert rr340111 "[GISel]: Add Legalization/lowering code for bit counting operations"

It causes LegalizerHelperTest.LowerBitCountingCTTZ1 to fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340186 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd cmake option to disable minidumps, default it to off
Reid Kleckner [Mon, 20 Aug 2018 16:49:54 +0000 (16:49 +0000)]
Add cmake option to disable minidumps, default it to off

Since crash dumping landed in r268519, May 2016, I have not once seen
anyone use an uploaded minidump to debug a compiler crash. Therefore,
I'm turning this off by default. The dumps clutter up user and buildbot
temp directories. Each file is only about 56KB, but it adds up.

In the context of clang, the extra line about the minidump confuses
users, when what we really want from them is the pre-processed source
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340185 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] add tests for insertelement+binop; NFC
Sanjay Patel [Mon, 20 Aug 2018 16:49:08 +0000 (16:49 +0000)]
[InstCombine] add tests for insertelement+binop; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340184 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-mca] Make the LSUnit a HardwareUnit, and allow derived classes to implement...
Andrea Di Biagio [Mon, 20 Aug 2018 14:41:36 +0000 (14:41 +0000)]
[llvm-mca] Make the LSUnit a HardwareUnit, and allow derived classes to implement a different memory consistency model.

The LSUnit is now a HardwareUnit, and it is owned by the mca::Context.
Derived classes can now implement a different consistency model by overriding
method `LSUnit::isReady()`.

This patch also slightly refactors the Scheduler interface in the attempt to
simplifying the interaction between ExecuteStage and the underlying Scheduler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340176 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Reuse the Op's VT. NFCI.
Simon Pilgrim [Mon, 20 Aug 2018 13:44:03 +0000 (13:44 +0000)]
[SelectionDAG] Reuse the Op's VT. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340173 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: fix compilation errors since r340171
Samuel Pitoiset [Mon, 20 Aug 2018 13:31:41 +0000 (13:31 +0000)]
AMDGPU: fix compilation errors since r340171

Some buildbot slaves reports compilation errors, but it
compiled fine on my side, sorry for the breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340172 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space
Samuel Pitoiset [Mon, 20 Aug 2018 13:18:59 +0000 (13:18 +0000)]
AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space

32-bit constant address space is declared as 6, so the
maximum number of address spaces is 6, not 5.

Fixes "LLVM ERROR: Pointer address space out of range".

v3: use static_assert()
v2: add a very simple test for 32-bit addr space

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106630
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340171 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix an undefined behavior when storing an empty StringRef.
Haojian Wu [Mon, 20 Aug 2018 13:12:54 +0000 (13:12 +0000)]
Fix an undefined behavior when storing an empty StringRef.

Summary: Passing a nullptr to memcpy is UB.

Reviewers: ioeric

Subscribers: llvm-commits, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340170 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Add partial sign-bit support to ComputeNumSignBits for BITCAST nodes
Simon Pilgrim [Mon, 20 Aug 2018 13:05:48 +0000 (13:05 +0000)]
[SelectionDAG] Add partial sign-bit support to ComputeNumSignBits for BITCAST nodes

Only adds support to the existing 'large element' scalar/vector to 'small element' vector bitcasts.

Handle the case where the sign bit extends to only part of the small elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340169 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Fix PACKSS bitcast test from rL340166
Simon Pilgrim [Mon, 20 Aug 2018 11:47:15 +0000 (11:47 +0000)]
[X86][SSE] Fix PACKSS bitcast test from rL340166

We need the signbits to extends to lower 16-bits of the even elements

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340167 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Add PACKSS test showing ComputeNumSignBits failure to handle a partial...
Simon Pilgrim [Mon, 20 Aug 2018 11:10:12 +0000 (11:10 +0000)]
[X86][SSE] Add PACKSS test showing ComputeNumSignBits failure to handle a partial sign bits extension through a bitcast

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340166 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Drop unnecessary exact qualifier from packss test
Simon Pilgrim [Mon, 20 Aug 2018 11:01:51 +0000 (11:01 +0000)]
[X86] Drop unnecessary exact qualifier from packss test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340165 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DWARF] Refactor DWARF classes to use unified error reporting. NFC.
Victor Leschuk [Mon, 20 Aug 2018 09:59:08 +0000 (09:59 +0000)]
[DWARF] Refactor DWARF classes to use unified error reporting. NFC.

DWARF-related classes in lib/DebugInfo/DWARF contained
duplicating code for creating StringError instances, like:

template <typename... Ts>
static Error createError(char const *Fmt, const Ts &... Vals) {
  std::string Buffer;
  raw_string_ostream Stream(Buffer);
  Stream << format(Fmt, Vals...);
  return make_error<StringError>(Stream.str(), inconvertibleErrorCode());
}

Similar function was placed in Support lib in https://reviews.llvm.org/D49824

This revision makes DWARF classes use this function
instead of their local implementation of it.

Reviewers: aprantl, dblaikie, probinson, wolfgangp, JDevlieghere, jhenderson

Reviewed By: JDevlieghere, jhenderson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340163 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse LLVM_BUILTIN_TRAP not __builtin_trap to appease windows builds. NFCI.
Simon Pilgrim [Mon, 20 Aug 2018 09:49:20 +0000 (09:49 +0000)]
Use LLVM_BUILTIN_TRAP not __builtin_trap to appease windows builds. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340162 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][SVE] Asm: Add SVE System registers
Sander de Smalen [Mon, 20 Aug 2018 09:16:59 +0000 (09:16 +0000)]
[AArch64][SVE] Asm: Add SVE System registers

This patch adds system registers for controlling aspects of SVE:
- ZCR_EL1  (r/w)   visible at EL1 and EL0.
- ZCR_EL2  (r/w)   visible at EL2 and Non-secure EL1 and EL0.
- ZCR_EL3  (r/w)   visible at all exception levels.

and a system register identifying SVE:
- ID_AA64ZFR0_EL1  (r)  SVE Feature identifier.

Reviewers: SjoerdMeijer, samparker, pbarrio, fhahn, javed.absar

Reviewed By: SjoerdMeijer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340158 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm] Make YAML serialization up to 2.5 times faster
Kirill Bobyrev [Mon, 20 Aug 2018 07:00:36 +0000 (07:00 +0000)]
[llvm] Make YAML serialization up to 2.5 times faster

This patch significantly improves performance of the YAML serializer by
optimizing `YAML::isNumeric` function. This function is called on the
most strings and is highly inefficient for two reasons:

* It uses `Regex`, which is parsed and compiled each time this
  function is called
* It uses multiple passes which are not necessary

This patch introduces stateful ad hoc YAML number parser which does not
rely on `Regex`. It also fixes YAML number format inconsistency: current
implementation supports C-stile octal number format (`01234567`) which
was present in YAML 1.0 specialization (http://yaml.org/spec/1.0/),
[Section 2.4. Tags, Example 2.19] but was deprecated and is no longer
present in latest YAML 1.2 specification
(http://yaml.org/spec/1.2/spec.html), see [Section 10.3.2. Tag
Resolution]. Since the rest of the rest of the implementation does not
support other deprecated YAML 1.0 numeric features such as sexagecimal
numbers, commas as delimiters it is treated as inconsistency and not
longer supported. This patch also adds unit tests to ensure the validity
of proposed implementation.

This performance bottleneck was identified while profiling Clangd's
global-symbol-builder tool with my colleague @ilya-biryukov. The
substantial part of the runtime was spent during a single-thread Reduce
phase, which concludes with YAML serialization of collected symbol
collection. Regex matching was accountable for approximately 45% of the
whole runtime (which involves sharded Map phase), now it is reduced to
18% (which is spent in `clang::clangd::CanonicalIncludes` and can be
also optimized because all used regexes are in fact either suffix
matches or exact matches).

`llvm-yaml-numeric-parser-fuzzer` was used to ensure the validity of the
proposed regex replacement. Fuzzing for ~60 hours using 10 threads did
not expose any bugs.

Benchmarking `global-symbol-builder` (using `hyperfine --warmup 2
--min-runs 5 'command 1' 'command 2'`) tool by processing a reasonable
amount of code (26 source files matched by
`clang-tools-extra/clangd/*.cpp` with all transitive includes) confirmed
our understanding of the performance bottleneck nature as it speeds up
the command by the factor of 1.6x:

| Command | Mean [s] | Min…Max [s] |
| this patch (D50839) | 84.7 Â± 0.6 | 83.3…84.7 |
| master (rL339849) | 133.1 Â± 0.8 | 132.4…134.6 |

Using smaller samples (e.g. by collecting symbols from
`clang-tools-extra/clangd/AST.cpp` only) yields even better performance
improvement, which is expected because Map phase takes less time
compared to Reduce and is 2.05x faster and therefore would significantly
improve the performance of standalone YAML serializations.

| Command | Mean [ms] | Min…Max [ms] |
| this patch (D50839) | 3702.2 Â± 48.7 | 3635.1…3752.3 |
| master (rL339849) | 7607.6 Â± 109.5 | 7533.3…7796.4 |

Reviewed by: zturner, ilya-biryukov

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340154 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyCFG] Replace some uses of bitwise or with logical or
Justin Bogner [Mon, 20 Aug 2018 06:37:11 +0000 (06:37 +0000)]
[SimplifyCFG] Replace some uses of bitwise or with logical or

It's clearer to use logical or for boolean values. Thanks to Steven
Zhang for noticing!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340153 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Move some variable declarations into a more appropriate scope. NFC
Craig Topper [Mon, 20 Aug 2018 05:35:12 +0000 (05:35 +0000)]
[InstCombine] Move some variable declarations into a more appropriate scope. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340150 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] Add a peephole post RA to transform the inst that fed by add
QingShan Zhang [Mon, 20 Aug 2018 02:52:55 +0000 (02:52 +0000)]
[PowerPC] Add a peephole post RA to transform the inst that fed by add

If the arch is P8, we will select XFLOAD to load the floating point, and then, expand it to vsx and non-vsx X-form instruction post RA. This patch is trying to convert the X-form to D-form if it meets the requirement that one operand of the x-form inst is the special Zero register, and another operand fed by add inst. i.e.
y = add imm, reg
LFDX. 0, y
-->
LFD imm(reg)

Reviewers: Nemanjai
Differential Revision: https://reviews.llvm.org/D49007

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340149 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[bindings/go] Add coroutine passes
whitequark [Sun, 19 Aug 2018 23:40:05 +0000 (23:40 +0000)]
[bindings/go] Add coroutine passes

Add Go bindings for CoroEarly, CoroSplit, CoroElide and CoroCleanup.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340148 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LLVM-C] Add coroutine passes
whitequark [Sun, 19 Aug 2018 23:39:57 +0000 (23:39 +0000)]
[LLVM-C] Add coroutine passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340147 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[C-API][DIBuilder] Added DIFlags in LLVMDIBuilderCreateBasicType
whitequark [Sun, 19 Aug 2018 23:39:47 +0000 (23:39 +0000)]
[C-API][DIBuilder] Added DIFlags in LLVMDIBuilderCreateBasicType

Added DIFlags in LLVMDIBuilderCreateBasicType to add optional DWARF
attributes, such as DW_AT_endianity.

Patch by Chirag Patel.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340146 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Add test cases for an icmp combine that is missing support for splat...
Craig Topper [Sun, 19 Aug 2018 18:03:34 +0000 (18:03 +0000)]
[InstCombine] Add test cases for an icmp combine that is missing support for splat vector constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340144 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Add basic demanded elements support to ComputeNumSignBits for BITCAST...
Simon Pilgrim [Sun, 19 Aug 2018 17:47:50 +0000 (17:47 +0000)]
[SelectionDAG] Add basic demanded elements support to ComputeNumSignBits for BITCAST nodes

Only adds support to the existing 'large element' scalar/vector to 'small element' vector bitcasts.

The next step would be to support cases where the large elements aren't all sign bits, and determine the small element equivalent based on the demanded elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340143 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Add PACKSS test showing ComputeNumSignBits failure to handle demanded...
Simon Pilgrim [Sun, 19 Aug 2018 16:01:47 +0000 (16:01 +0000)]
[X86][SSE] Add PACKSS test showing ComputeNumSignBits failure to handle demanded elts through a bitcast

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340139 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Fix an issue in the matching for ADDUS.
Craig Topper [Sun, 19 Aug 2018 04:26:31 +0000 (04:26 +0000)]
[X86] Fix an issue in the matching for ADDUS.

We were basically assuming only one operand of the compare could be an ADD node and using that to swap operands. But we can have a normal add followed by a saturing add.

This rewrites the canonicalization to just be based on the condition code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340134 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add a test case showing an issue in our addusw pattern matching.
Craig Topper [Sun, 19 Aug 2018 04:26:29 +0000 (04:26 +0000)]
[X86] Add a test case showing an issue in our addusw pattern matching.

We are unable to handle a normal add followed by a saturing add with certain operand orders on the icmp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340133 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUpdating MergeFunctions.rst
Aditya Kumar [Sat, 18 Aug 2018 20:17:19 +0000 (20:17 +0000)]
Updating MergeFunctions.rst

Improving readability, removing redundant contents.

Reviewers: hiraditya
Differential Revision: https://reviews.llvm.org/D50686

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340131 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Use SDValue::operator== instead of DAG.isEqualTo in strictly integer matching.
Craig Topper [Sat, 18 Aug 2018 19:16:56 +0000 (19:16 +0000)]
[X86] Use SDValue::operator== instead of DAG.isEqualTo in strictly integer matching.

isEqualTo is more useful for floating point. operator== is sufficient for integer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340130 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Simplify the PADDUS legality check in combineSelect to match PSUBUS. NFC
Craig Topper [Sat, 18 Aug 2018 18:51:04 +0000 (18:51 +0000)]
[X86] Simplify the PADDUS legality check in combineSelect to match PSUBUS. NFC

While there remove some trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340129 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add support for using 512-bit PSUBUS to combineSelect.
Craig Topper [Sat, 18 Aug 2018 18:51:03 +0000 (18:51 +0000)]
[X86] Add support for using 512-bit PSUBUS to combineSelect.

The code already support 128 and 256 and even knows to split 256 for AVX1. So we really just needed to stop looking for specific VTs and subtarget features and just look for legal VTs with i8/i16 elements.

While there, add some curly braces around outer if statement bodies that contain only another if. It makes all the closing curly braces look more regular.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340128 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add test cases to show missed opportunities to use 512-bit PSUBUS.
Craig Topper [Sat, 18 Aug 2018 18:50:59 +0000 (18:50 +0000)]
[X86] Add test cases to show missed opportunities to use 512-bit PSUBUS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340127 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MS Demangler] Resolve backreferences eagerly, not lazily.
Zachary Turner [Sat, 18 Aug 2018 18:49:48 +0000 (18:49 +0000)]
[MS Demangler] Resolve backreferences eagerly, not lazily.

A while back I submitted a patch to resolve backreferences
lazily, thinking this that it was not always possible to know
in advance what type you were looking at until you had completed
a full pass over the input, and therefore it would be impossible
to resolve backreferences eagerly.

This was mistaken though, and turned out to be an unrelated
problem.  In fact, the reverse is true.  You *must* resolve
backreferences eagerly.  This is because certain types of nested
mangled symbols do not share a backreference context with their
parent symbol, and as such, if you try to resolve them lazily
their backreference context will have been lost by the time you
finish demangling the entire input.  On the other hand, resolving
them eagerly appears to always work, and enables us to port
many more tests over.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340126 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RuntimeDyld] Fix a bug in RuntimeDyld::loadObjectImpl that was over-allocating
Lang Hames [Sat, 18 Aug 2018 18:38:37 +0000 (18:38 +0000)]
[RuntimeDyld] Fix a bug in RuntimeDyld::loadObjectImpl that was over-allocating
space for common symbols.

Patch by Dmitry Sidorov. Thanks Dmitry!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340125 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Replace all single match schedule class instregexs with instrs entries
Simon Pilgrim [Sat, 18 Aug 2018 18:04:29 +0000 (18:04 +0000)]
[X86] Replace all single match schedule class instregexs with instrs entries

Helps reduce cost of instrw collection

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340124 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Merge shift/rotate schedule class instregexs
Simon Pilgrim [Sat, 18 Aug 2018 15:58:19 +0000 (15:58 +0000)]
[X86] Merge shift/rotate schedule class instregexs

Helps reduce cost of instrw collection

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340123 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] In FastISel, convert llvm.dbg.label to DBG_LABEL MI.
Hsiangkai Wang [Sat, 18 Aug 2018 14:55:34 +0000 (14:55 +0000)]
[DebugInfo] In FastISel, convert llvm.dbg.label to DBG_LABEL MI.

Convert llvm.dbg.label(!label_metadata) to DBG_LABEL !label_metadata.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340122 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add a signed test case for PR38622. Use nounwind to reduce the output on the...
Craig Topper [Sat, 18 Aug 2018 06:00:16 +0000 (06:00 +0000)]
[X86] Add a signed test case for PR38622. Use nounwind to reduce the output on the unsigned test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340121 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Allow divide by constant optimization on opaque constants.
Craig Topper [Sat, 18 Aug 2018 05:52:42 +0000 (05:52 +0000)]
[DAGCombiner] Allow divide by constant optimization on opaque constants.

Summary:
I believe this restores the behavior we had before r339147.

Fixes PR38622.

Reviewers: RKSimon, chandlerc, spatel

Reviewed By: chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340120 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd the extended XMM registers mappings for AVX-512.
Zachary Turner [Sat, 18 Aug 2018 03:54:16 +0000 (03:54 +0000)]
Add the extended XMM registers mappings for AVX-512.

After this we should have the entire AVX-512 register set
mapping in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340118 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Fix some parameter names. NFC.
Lang Hames [Sat, 18 Aug 2018 02:48:02 +0000 (02:48 +0000)]
[ORC] Fix some parameter names. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340116 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Rename 'finalize' to 'emit' to avoid potential confusion.
Lang Hames [Sat, 18 Aug 2018 02:06:18 +0000 (02:06 +0000)]
[ORC] Rename 'finalize' to 'emit' to avoid potential confusion.

An emitted symbol has had its contents written and its memory protections
applied, but it is not automatically ready to execute.

Prior to ORC supporting concurrent compilation, the term "finalized" could be
interpreted two different (but effectively equivalent) ways: (1) The finalized
symbol's contents have been written and its memory protections applied, and (2)
the symbol is ready to run. Now that ORC supports concurrent compilation, sense
(1) no longer implies sense (2). We have already introduced a new term, 'ready',
to capture sense (2), so rename sense (1) to 'emitted' to avoid any lingering
confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340115 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMC: Remove dead code from WinCOFFObjectWriter.cpp. NFCI.
Peter Collingbourne [Sat, 18 Aug 2018 00:54:46 +0000 (00:54 +0000)]
MC: Remove dead code from WinCOFFObjectWriter.cpp. NFCI.

Remove code for writing auxiliary symbols of type function definition
and begin function. These types of symbols are associated with
pre-CodeView debug info and we never emit them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340113 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GISel]: Add Legalization/lowering code for bit counting operations
Aditya Nandakumar [Sat, 18 Aug 2018 00:01:54 +0000 (00:01 +0000)]
[GISel]: Add Legalization/lowering code for bit counting operations

https://reviews.llvm.org/D48847#inline-448257

Ported legalization expansions for CTLZ/CTTZ from DAG to GISel.

Reviewed by rtereshin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340111 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AST] Clarify printing of unknown size locations [NFC]
Philip Reames [Fri, 17 Aug 2018 23:17:31 +0000 (23:17 +0000)]
[AST] Clarify printing of unknown size locations [NFC]

Printing "unknown" is much more clear than an arbitrary large integer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340108 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Implement -G/--keep-global-symbol(s).
Jordan Rupprecht [Fri, 17 Aug 2018 22:34:48 +0000 (22:34 +0000)]
[llvm-objcopy] Implement -G/--keep-global-symbol(s).

Summary:
Port GNU Objcopy -G/--keep-global-symbol(s).

This is slightly different than the already-implemented --globalize-symbol, which marks a symbol as global when copying. When --keep-global-symbol (alias -G) is used, *only* those symbols marked will stay global, and all other globals are demoted to local. (Also note that it doesn't *promote* a symbol to global). Additionally, there is a pluralized version of the flag --keep-global-symbols, which effectively applies --keep-global-symbol for every non-comment in a file.

Reviewers: jakehehrlich, jhenderson, alexshap

Reviewed By: jhenderson

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340105 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugCounters] don't do redundant map lookups; NFC
George Burgess IV [Fri, 17 Aug 2018 22:34:04 +0000 (22:34 +0000)]
[DebugCounters] don't do redundant map lookups; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340104 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AST][Tests] Clarify what each test is doing
Philip Reames [Fri, 17 Aug 2018 21:58:26 +0000 (21:58 +0000)]
[AST][Tests] Clarify what each test is doing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340100 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AST[Tests] Shorten tests using noalias params
Philip Reames [Fri, 17 Aug 2018 21:45:57 +0000 (21:45 +0000)]
[AST[Tests] Shorten tests using noalias params

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340099 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AST] Add tests for argmemonly calls [NFC]
Philip Reames [Fri, 17 Aug 2018 21:42:18 +0000 (21:42 +0000)]
[AST] Add tests for argmemonly calls [NFC]

First step towards building a test set to rebase D50730 on top of.  Starting with clone of memtransfer tests, more to come.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340095 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoValueTracking: Add tests for isKnownNeverNaN
Matt Arsenault [Fri, 17 Aug 2018 21:39:52 +0000 (21:39 +0000)]
ValueTracking: Add tests for isKnownNeverNaN

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340090 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MC] Improve error message when a codeview register is unknown
Reid Kleckner [Fri, 17 Aug 2018 21:35:14 +0000 (21:35 +0000)]
[MC] Improve error message when a codeview register is unknown

This is in MCRegisterInfo, we can print the actual register name easily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340089 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MS Demangler] Properly print all thunk types.
Zachary Turner [Fri, 17 Aug 2018 21:32:07 +0000 (21:32 +0000)]
[MS Demangler] Properly print all thunk types.

We were only printing the vtordisp thunk before as the previous
patch was more aimed at getting special operators working, one
of which was a thunk.  This patch gets all thunk types to print
properly, and adds a test for each one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340088 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove detectAddSubSatPattern.
Craig Topper [Fri, 17 Aug 2018 21:19:28 +0000 (21:19 +0000)]
[X86] Remove detectAddSubSatPattern.

This was added very recently in r339650, but appears to be completely untested and has at least one bug in it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340086 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDAG: Fix isKnownNeverNaN for basic non-sNaN cases
Matt Arsenault [Fri, 17 Aug 2018 21:19:22 +0000 (21:19 +0000)]
DAG: Fix isKnownNeverNaN for basic non-sNaN cases

fadd/fsub/fmul need to worry about infinities as well
as fdiv.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340085 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Rename VSO to JITDylib.
Lang Hames [Fri, 17 Aug 2018 21:18:18 +0000 (21:18 +0000)]
[ORC] Rename VSO to JITDylib.

VSO was a little close to VDSO (an acronym on Linux for Virtual Dynamic Shared
Object) for comfort. It also risks giving the impression that instances of this
class could be shared between ExecutionSessions, which they can not.

JITDylib seems moderately less confusing, while still hinting at how this
class is intended to be used, i.e. as a JIT-compiled stand-in for a dynamic
library (code that would have been a dynamic library if you had wanted to
compile it ahead of time).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340084 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MS Demangler] Demangle all remaining types of operators.
Zachary Turner [Fri, 17 Aug 2018 21:18:05 +0000 (21:18 +0000)]
[MS Demangler] Demangle all remaining types of operators.

This demangles all remaining special operators including thunks,
RTTI Descriptors, and local static guard variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340083 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Hexagon] Remove unused functions from HexagonInstPrinter, NFC
Krzysztof Parzyszek [Fri, 17 Aug 2018 21:12:37 +0000 (21:12 +0000)]
[Hexagon] Remove unused functions from HexagonInstPrinter, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340081 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AST] Adapt Polly to AnalysisSetTracker changes. NFC.
Michael Kruse [Fri, 17 Aug 2018 19:31:41 +0000 (19:31 +0000)]
[AST] Adapt Polly to AnalysisSetTracker changes. NFC.

The method AliasSetTracker::getAliasSetForPointer was removed and replaced by AliasSetTracker::getAliasSetFor for the restructuring in r339930.

Since Polly uses AliasSetTracker::getAliasSetForPointer, a temporary fix has been committed in r339937 with a comment:

     Can someone from polly please migrate usage and then delete the wrapper?

This commit is doing exactly that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340072 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix windows buildbots by removing : from filenames
Jordan Rupprecht [Fri, 17 Aug 2018 19:18:20 +0000 (19:18 +0000)]
Fix windows buildbots by removing : from filenames

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340071 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Add support for -I binary -B <arch>.
Jordan Rupprecht [Fri, 17 Aug 2018 18:51:11 +0000 (18:51 +0000)]
[llvm-objcopy] Add support for -I binary -B <arch>.

Summary:
The -I (--input-target) and -B (--binary-architecture) flags exist but are currently silently ignored. This adds support for -I binary for architectures i386, x86-64 (and alias i386:x86-64), arm, aarch64, sparc, and ppc (powerpc:common64). This is largely based on D41687.

This is done by implementing an additional subclass of Reader, BinaryReader, which works by interpreting the input file as contents for .data field, sets up a synthetic header, and adds additional sections/symbols (e.g. _binary__tmp_data_txt_start).

Reviewers: jakehehrlich, alexshap, jhenderson, javed.absar

Reviewed By: jhenderson

Subscribers: jyknight, nemanjai, kbarton, fedor.sergeev, jrtc27, kristof.beyls, paulsemel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340070 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTest commit
Jun Lim [Fri, 17 Aug 2018 18:40:41 +0000 (18:40 +0000)]
Test commit

I just removed a blank space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340069 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove a hardcoded address in test/DebugInfo/X86/vla-multi.ll
Vedant Kumar [Fri, 17 Aug 2018 18:39:19 +0000 (18:39 +0000)]
Remove a hardcoded address in test/DebugInfo/X86/vla-multi.ll

This relaxes a test to make it less brittle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340068 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IDF] Make GD const.
Alina Sbirlea [Fri, 17 Aug 2018 18:37:15 +0000 (18:37 +0000)]
[IDF] Make GD const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340067 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-mca] Reformat a few lines (fix spacing). NFC.
Matt Davis [Fri, 17 Aug 2018 18:06:01 +0000 (18:06 +0000)]
[llvm-mca] Reformat a few lines (fix spacing).  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340065 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] NFC: Fix docstring in FileSystem.h.
Reka Kovacs [Fri, 17 Aug 2018 18:05:38 +0000 (18:05 +0000)]
[Support] NFC: Fix docstring in FileSystem.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340063 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Lower constant vXi8 ISD::SRL/ISD::SRA using PMULLW
Simon Pilgrim [Fri, 17 Aug 2018 18:03:11 +0000 (18:03 +0000)]
[X86][SSE] Lower constant vXi8 ISD::SRL/ISD::SRA using PMULLW

Extending the concept introduced in D49562, this patch lowers constant vXi8 ISD::SRL/ISD::SRA by zero/sign extending to vXi16 and using PMULLW and then truncating the high 8 bits of the result.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340062 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Refactor the simplification of pow() (NFC)
Evandro Menezes [Fri, 17 Aug 2018 17:59:53 +0000 (17:59 +0000)]
[InstCombine] Refactor the simplification of pow() (NFC)

Refactor all cases dealing with `exp{,2,10}()` into one function in
preparation for D49273.  Otherwise, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340061 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Expand test cases for simplifying pow()
Evandro Menezes [Fri, 17 Aug 2018 17:59:38 +0000 (17:59 +0000)]
[NFC] Expand test cases for simplifying pow()

In prepatration for the improvements that D49273 enables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340060 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Use hasOneUse instead of isOnlyUserOf. NFCI
Craig Topper [Fri, 17 Aug 2018 17:57:25 +0000 (17:57 +0000)]
[X86] Use hasOneUse instead of isOnlyUserOf. NFCI

isOnlyUserOf is a little heavier because it allows the node to be used multiple times by the other node. In this case we are looking at a truncate which only has one operand so we know it can only use it once. Thus hasOneUse is better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340059 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TableGen] Don't separately search for DefaultMode when we're going to iterate the...
Simon Pilgrim [Fri, 17 Aug 2018 17:45:15 +0000 (17:45 +0000)]
[TableGen] Don't separately search for DefaultMode when we're going to iterate the set anyway. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340055 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IDF] Teach Iterated Dominance Frontier to use a snapshot CFG based on a GraphDiff.
Alina Sbirlea [Fri, 17 Aug 2018 17:39:15 +0000 (17:39 +0000)]
[IDF] Teach Iterated Dominance Frontier to use a snapshot CFG based on a GraphDiff.

Summary:
Create the ability to compute IDF using a CFG View.
For this, we'll need a new DT created using a list of Updates (to be refactored later to a GraphDiff), and the GraphTraits based on the same GraphDiff.

Reviewers: kuhar, george.burgess.iv, mzolotukhin

Subscribers: sanjoy, jlebar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340052 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ThinLTO] Add option for printing import failure reasons
Teresa Johnson [Fri, 17 Aug 2018 16:53:47 +0000 (16:53 +0000)]
[ThinLTO] Add option for printing import failure reasons

Summary:
Adds the option for the printing of summary information about functions
considered but rejected for importing during the thin link.

Reviewers: davidxl

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340047 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MS Demangler] Rework the way operators are demangled.
Zachary Turner [Fri, 17 Aug 2018 16:14:05 +0000 (16:14 +0000)]
[MS Demangler] Rework the way operators are demangled.

Previously, some of the code for actually parsing mangled
operator names was more like formatting code in nature,
and was interspersed with the demangling code which builds
the AST.  This means that by the time we got to the printing
code, we had lost all information about what type of operator
we had, and all we were left with was a string that we just
had to print.  However, not all operators are actually even
operators.  it's basically just a catch-all mangling for
"special names", and for some of the other types it helps
to know when we're actually doing the printing what it is.

This patch changes the way things work by introducing an
OperatorInfo structure and corresponding enumeration.  When
we demangle we store the enumeration value and demangled
components separately.  This gives more flexibility during
printing.

In doing so, some demanglings of special names which we didn't
previously support come out of this for free, so we now demangle
those.

A few are more complex and are better left for a followup patch
though.

An exhaustive test of every possible operator code is included,
with the ones that don't yet work commented out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340046 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TableGen] TypeInfer - Cache the legal types as TypeSetByHwMode
Simon Pilgrim [Fri, 17 Aug 2018 15:54:07 +0000 (15:54 +0000)]
[TableGen] TypeInfer - Cache the legal types as TypeSetByHwMode

We were just caching the MVT set of legal types, then every call creating a new TypeSetByHwMode with it and passing it back on the stack. There's no need to do this - we can create and cache the whole TypeSetByHwMode once and return a const reference to it each time.

Additionally, TypeInfer::expandOverloads wasn't making use of the fact that the cache just contains a default mode containing all the types.

Saves up to 30secs in debug builds of x86 -gen-dag-isel.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340042 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Generate DWARF debug information for labels. (Fix leak problems)
Hsiangkai Wang [Fri, 17 Aug 2018 15:22:04 +0000 (15:22 +0000)]
[DebugInfo] Generate DWARF debug information for labels. (Fix leak problems)

There are two forms for label debug information in DWARF format.

1. Labels in a non-inlined function:

DW_TAG_label
  DW_AT_name
  DW_AT_decl_file
  DW_AT_decl_line
  DW_AT_low_pc

2. Labels in an inlined function:

DW_TAG_label
  DW_AT_abstract_origin
  DW_AT_low_pc

We will collect label information from DBG_LABEL. Before every DBG_LABEL,
we will generate a temporary symbol to denote the location of the label.
The symbol could be used to get DW_AT_low_pc afterwards. So, we create a
mapping between 'inlined label' and DBG_LABEL MachineInstr in DebugHandlerBase.
The DBG_LABEL in the mapping is used to query the symbol before it.

The AbstractLabels in DwarfCompileUnit is used to process labels in inlined
functions.

We also keep a mapping between scope and labels in DwarfFile to help to
generate correct tree structure of DIEs.

It also generates label debug information under global isel.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340039 91177308-0d34-0410-b5e6-96231b3b80d8