OSDN Git Service

android-x86/external-llvm.git
6 years ago[ScheduleDAGInstrs] fix behavior of getUnderlyingObjectsForCodeGen when no identifiab...
Hiroshi Inoue [Thu, 12 Oct 2017 06:26:04 +0000 (06:26 +0000)]
[ScheduleDAGInstrs] fix behavior of getUnderlyingObjectsForCodeGen when no identifiable object found

This patch fixes the bug introduced in https://reviews.llvm.org/D35907; the bug is reported by http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20171002/491452.html.

Before D35907, when GetUnderlyingObjects fails to find an identifiable object, allMMOsOkay lambda in getUnderlyingObjectsForInstr returns false and Objects vector is cleared. This behavior is unintentionally changed by D35907.

This patch makes the behavior for such case same as the previous behavior.
Since D35907 introduced a wrapper function getUnderlyingObjectsForCodeGen around GetUnderlyingObjects, getUnderlyingObjectsForCodeGen is modified to return a boolean value to ask the caller to clear the Objects vector.

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

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

6 years ago[RegisterCoalescer] Don't set read-undef in pruneValues, only clear
Mikael Holmen [Thu, 12 Oct 2017 06:21:28 +0000 (06:21 +0000)]
[RegisterCoalescer] Don't set read-undef in pruneValues, only clear

Summary:
The comments in the code said

 // Remove <def,read-undef> flags. This def is now a partial redef.

but the code didn't just remove read-undef, it could introduce new ones which
could cause errors.

E.g. if we have something like

%vreg1<def> = IMPLICIT_DEF
%vreg2:subreg1<def, read-undef> = op %vreg3, %vreg4
%vreg2:subreg2<def> = op %vreg6, %vreg7

and we merge %vreg1 and %vreg2 then we should not set undef on the second subreg
def, which the old code did.

Now we solve this by actually do what the code comment says. We remove
read-undef flags rather than remove or introduce them.

Reviewers: qcolombet, MatzeB

Reviewed By: MatzeB

Subscribers: llvm-commits

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

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

6 years agoRe-commit "llvm-isel-fuzzer: Handle a subset of backend flags in the exec name"
Justin Bogner [Thu, 12 Oct 2017 04:35:32 +0000 (04:35 +0000)]
Re-commit "llvm-isel-fuzzer: Handle a subset of backend flags in the exec name"

Here we add a secondary option parser to llvm-isel-fuzzer (and provide
it for use with other fuzzers). With this, you can copy the fuzzer to
a name like llvm-isel-fuzzer=aarch64-gisel for a fuzzer that fuzzer
AArch64 with GlobalISel enabled, or fuzzer=x86_64 to fuzz x86, with no
flags required. This should be useful for running these in OSS-Fuzz.

Note that this handrolls a subset of cl::opts to recognize, rather
than embedding a complete command parser for argv[0]. If we find we
really need the flexibility of handling arbitrary options at some
point we can rethink this.

This re-applies 315545 using "=" instead of ":" as a separator for
arguments.

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

6 years ago[cfi-verify] Fix unittest failures w/o x86 target
Vlad Tsyrklevich [Thu, 12 Oct 2017 04:17:33 +0000 (04:17 +0000)]
[cfi-verify] Fix unittest failures w/o x86 target

The llvm-cfi-verify unit tests fail if LLVM is built without the X86
target, disable the unit tests from being built unless X86 is enabled
for now.

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

6 years agoRevert r315545 "llvm-isel-fuzzer: Handle a subset of backend flags in the executable...
Hans Wennborg [Thu, 12 Oct 2017 03:32:09 +0000 (03:32 +0000)]
Revert r315545 "llvm-isel-fuzzer: Handle a subset of backend flags in the executable name"

It broke some tests on Windows:

Failing Tests (4):
    LLVM :: tools/llvm-isel-fuzzer/execname-options.ll
    LLVM :: tools/llvm-isel-fuzzer/missing-triple.ll
    LLVM :: tools/llvm-isel-fuzzer/x86-empty-bc.ll
    LLVM :: tools/llvm-isel-fuzzer/x86-empty.ll

> llvm-isel-fuzzer: Handle a subset of backend flags in the executable name
>
> Here we add a secondary option parser to llvm-isel-fuzzer (and provide
> it for use with other fuzzers). With this, you can copy the fuzzer to
> a name like llvm-isel-fuzzer:aarch64-gisel for a fuzzer that fuzzer
> AArch64 with GlobalISel enabled, or fuzzer:x86_64 to fuzz x86, with no
> flags required. This should be useful for running these in OSS-Fuzz.
>
> Note that this handrolls a subset of cl::opts to recognize, rather
> than embedding a complete command parser for argv[0]. If we find we
> really need the flexibility of handling arbitrary options at some
> point we can rethink this.

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

6 years ago[SimplifyIndVar] Replace IVUsers with loop invariant whenever possible
Hongbin Zheng [Thu, 12 Oct 2017 02:54:11 +0000 (02:54 +0000)]
[SimplifyIndVar] Replace IVUsers with loop invariant whenever possible

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

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

6 years agodocs: Add some links to OSS Fuzz
Justin Bogner [Thu, 12 Oct 2017 02:28:26 +0000 (02:28 +0000)]
docs: Add some links to OSS Fuzz

I'd left a couple of stray links here in a previous commit rather than
writing a paragraph.

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

6 years agodocs: Try to fix sphinx build
Justin Bogner [Thu, 12 Oct 2017 02:04:39 +0000 (02:04 +0000)]
docs: Try to fix sphinx build

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

6 years agollvm-isel-fuzzer: Handle a subset of backend flags in the executable name
Justin Bogner [Thu, 12 Oct 2017 01:57:49 +0000 (01:57 +0000)]
llvm-isel-fuzzer: Handle a subset of backend flags in the executable name

Here we add a secondary option parser to llvm-isel-fuzzer (and provide
it for use with other fuzzers). With this, you can copy the fuzzer to
a name like llvm-isel-fuzzer:aarch64-gisel for a fuzzer that fuzzer
AArch64 with GlobalISel enabled, or fuzzer:x86_64 to fuzz x86, with no
flags required. This should be useful for running these in OSS-Fuzz.

Note that this handrolls a subset of cl::opts to recognize, rather
than embedding a complete command parser for argv[0]. If we find we
really need the flexibility of handling arbitrary options at some
point we can rethink this.

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

6 years agodocs: Add some information about Fuzzing LLVM itself
Justin Bogner [Thu, 12 Oct 2017 01:44:24 +0000 (01:44 +0000)]
docs: Add some information about Fuzzing LLVM itself

This splits some content out of the libFuzzer docs and adds a fair
amount of detail about the fuzzers in LLVM.

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

6 years agoSpeculative build fix 2
Reid Kleckner [Thu, 12 Oct 2017 00:28:28 +0000 (00:28 +0000)]
Speculative build fix 2

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

6 years agoRevert r307036 because of PR34919.
Wei Mi [Thu, 12 Oct 2017 00:24:52 +0000 (00:24 +0000)]
Revert r307036 because of PR34919.

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

6 years agoSpeculative build fix, apparently I built llc without my patch applied to test it
Reid Kleckner [Thu, 12 Oct 2017 00:20:50 +0000 (00:20 +0000)]
Speculative build fix, apparently I built llc without my patch applied to test it

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

6 years ago[codeview] Disable FPO in functions using EH funclets
Reid Kleckner [Thu, 12 Oct 2017 00:06:57 +0000 (00:06 +0000)]
[codeview] Disable FPO in functions using EH funclets

Funclets are emitted by WinException which doesn't have access to
X86TargetStreamer so it's hard to make a quick fix for this.

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

6 years agoRevert "[ADT] Make Twine's copy constructor private."
Zachary Turner [Wed, 11 Oct 2017 23:54:34 +0000 (23:54 +0000)]
Revert "[ADT] Make Twine's copy constructor private."

This reverts commit 4e4ee1c507e2707bb3c208e1e1b6551c3015cbf5.

This is failing due to some code that isn't built on MSVC
so I didn't catch.  Not immediately obvious how to fix this
at first glance, so I'm reverting for now.

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

6 years agoFix AMDGPU build issue
Reid Kleckner [Wed, 11 Oct 2017 23:53:36 +0000 (23:53 +0000)]
Fix AMDGPU build issue

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

6 years ago[X86] Sink X86AsmPrinter ctor into .cpp file, NFC
Reid Kleckner [Wed, 11 Oct 2017 23:53:12 +0000 (23:53 +0000)]
[X86] Sink X86AsmPrinter ctor into .cpp file, NFC

I keep adding and removing code here, so let's sink it.

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

6 years ago[MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.
Lang Hames [Wed, 11 Oct 2017 23:34:47 +0000 (23:34 +0000)]
[MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.

MCObjectStreamer owns its MCCodeEmitter -- this fixes the types to reflect that,
and allows us to remove the last instance of MCObjectStreamer's weird "holding
ownership via someone else's reference" trick.

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

6 years ago[ADT] Make Twine's copy constructor private.
Zachary Turner [Wed, 11 Oct 2017 23:33:06 +0000 (23:33 +0000)]
[ADT] Make Twine's copy constructor private.

There's a lot of misuse of Twine scattered around LLVM.  This
ranges in severity from benign (returning a Twine from a function
by value that is just a string literal) to pretty sketchy (storing
a Twine by value in a class).  While there are some uses for
copying Twines, most of the very compelling ones are confined
to the Twine class implementation itself, and other uses are
either dubious or easily worked around.

This patch makes Twine's copy constructor private, and fixes up
all callsites.

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

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

6 years agoMC Helpers for llvm-cfi-verify.
Vlad Tsyrklevich [Wed, 11 Oct 2017 23:17:29 +0000 (23:17 +0000)]
MC Helpers for llvm-cfi-verify.

Add instruction analysis and machinecode traversal helpers in
preparation for control flow graph generation implementation.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: mgorny, llvm-commits, pcc, kcc

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

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

6 years agoMachineOptimizationRemarkEmitter.h: Appease g++-4.8.2. See also rL313715.
NAKAMURA Takumi [Wed, 11 Oct 2017 23:03:05 +0000 (23:03 +0000)]
MachineOptimizationRemarkEmitter.h: Appease g++-4.8.2. See also rL313715.

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

6 years agoAMDGPU/NFC: Minor clean ups in HSA metadata
Konstantin Zhuravlyov [Wed, 11 Oct 2017 22:59:35 +0000 (22:59 +0000)]
AMDGPU/NFC: Minor clean ups in HSA metadata

  - Use HSA metadata streamer directly from AMDGPUAsmPrinter
  - Make naming consistent with PAL metadata

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

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

6 years agoAMDGPU/NFC: Minor clean ups in PAL metadata
Konstantin Zhuravlyov [Wed, 11 Oct 2017 22:41:09 +0000 (22:41 +0000)]
AMDGPU/NFC: Minor clean ups in PAL metadata

  - Move PAL metadata definitions to AMDGPUMetadata
  - Make naming consistent with HSA metadata

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

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

6 years agoAMDGPU/NFC: Rename code object metadata as HSA metadata
Konstantin Zhuravlyov [Wed, 11 Oct 2017 22:18:53 +0000 (22:18 +0000)]
AMDGPU/NFC: Rename code object metadata as HSA metadata

  - Rename AMDGPUCodeObjectMetadata to AMDGPUMetadata (PAL metadata will be included in this file in the follow up change)
  - Rename AMDGPUCodeObjectMetadataStreamer to AMDGPUHSAMetadataStreamer
  - Introduce HSAMD namespace
  - Other minor name changes in function and test names

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

6 years agoSupport: Work around missing SetFileInformationByHandle on Wine
Hans Wennborg [Wed, 11 Oct 2017 22:04:14 +0000 (22:04 +0000)]
Support: Work around missing SetFileInformationByHandle on Wine

In r315079, fs::rename was reimplemented in terms of CreateFile and
SetFileInformationByHandle. Unfortunately, the latter isn't supported by
Wine. This adds a fallback to MoveFileEx for that case.

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

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

6 years ago[Transforms] Revert r315516 changes in PredicateInfo to fix Windows build bots ...
Eugene Zelenko [Wed, 11 Oct 2017 21:56:44 +0000 (21:56 +0000)]
[Transforms] Revert  r315516 changes in PredicateInfo to fix Windows build bots (NFC).

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

6 years ago[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Wed, 11 Oct 2017 21:41:43 +0000 (21:41 +0000)]
[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoReally fix llvm-rc include-paths.test
Reid Kleckner [Wed, 11 Oct 2017 21:27:54 +0000 (21:27 +0000)]
Really fix llvm-rc include-paths.test

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

6 years agoAttempt to fix failing llvm-rc include-paths.text
Reid Kleckner [Wed, 11 Oct 2017 21:25:03 +0000 (21:25 +0000)]
Attempt to fix failing llvm-rc include-paths.text

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

6 years ago[codeview] Implement FPO data assembler directives
Reid Kleckner [Wed, 11 Oct 2017 21:24:33 +0000 (21:24 +0000)]
[codeview] Implement FPO data assembler directives

Summary:
This adds a set of new directives that describe 32-bit x86 prologues.
The directives are limited and do not expose the full complexity of
codeview FPO data. They are merely a convenience for the compiler to
generate more readable assembly so we don't need to generate tons of
labels in CodeGen. If our prologue emission changes in the future, we
can change the set of available directives to suit our needs. These are
modelled after the .seh_ directives, which use a different format that
interacts with exception handling.

The directives are:
  .cv_fpo_proc _foo
  .cv_fpo_pushreg ebp/ebx/etc
  .cv_fpo_setframe ebp/esi/etc
  .cv_fpo_stackalloc 200
  .cv_fpo_endprologue
  .cv_fpo_endproc
  .cv_fpo_data _foo

I tried to follow the implementation of ARM EHABI CFI directives by
sinking most directives out of MCStreamer and into X86TargetStreamer.
This helps avoid polluting non-X86 code with WinCOFF specific logic.

I used cdb to confirm that this can show locals in parent CSRs in a few
cases, most importantly the one where we use ESI as a frame pointer,
i.e. the one in http://crbug.com/756153#c28

Once we have cdb integration in debuginfo-tests, we can add integration
tests there.

Reviewers: majnemer, hans

Subscribers: aemerson, mgorny, kristof.beyls, llvm-commits, hiraditya

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

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

6 years ago[Hexagon] Make sure that new-value jump is packetized with producer
Krzysztof Parzyszek [Wed, 11 Oct 2017 21:20:43 +0000 (21:20 +0000)]
[Hexagon] Make sure that new-value jump is packetized with producer

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

6 years agoReland 'Classify llvm-cfi-verify.'
Vlad Tsyrklevich [Wed, 11 Oct 2017 20:35:01 +0000 (20:35 +0000)]
Reland 'Classify llvm-cfi-verify.'

Summary: Move llvm-cfi-verify into a class in preparation for CFI analysis to come.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: mgorny, llvm-commits, pcc, kcc

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

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

6 years ago[MachineCombiner] Fix initialisation of LastUpdate for incremental update.
Florian Hahn [Wed, 11 Oct 2017 20:25:58 +0000 (20:25 +0000)]
[MachineCombiner] Fix initialisation of LastUpdate for incremental update.

Summary:
Fixes a bogus iterator resulting from the removal of a block's first instruction at the point that incremental update is enabled.

Patch by Paul Walker.

Reviewers: fhahn, Gerolf, efriedma, MatzeB

Reviewed By: fhahn

Subscribers: aemerson, javed.absar, llvm-commits

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

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

6 years agoFix incorrect integer literal suffix.
Zachary Turner [Wed, 11 Oct 2017 20:23:38 +0000 (20:23 +0000)]
Fix incorrect integer literal suffix.

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

6 years ago[PowerPC] Utilize DQ-Form instructions for spill/restore and fix FrameIndex eliminati...
Lei Huang [Wed, 11 Oct 2017 20:20:58 +0000 (20:20 +0000)]
[PowerPC] Utilize DQ-Form instructions for spill/restore and fix FrameIndex elimination to only use `lis/addi` if necessary.

Currently we produce a bunch of unnecessary code when emitting the
prologue/epilogue for spills/restores.  Namely, if the load from stack
slot/store to stack slot instruction is an X-Form instruction, we will
always produce an LIS/ORI sequence for the stack offset.

Furthermore, we have not exploited the P9 vector D-Form loads/stores for this
purpose.

This patch address both issues.

Specifying the D-Form load as the instruction to use for stack spills/reloads
should be safe because:

1. The stack should be aligned according to the ABI
2. If the stack isn't aligned, PPCRegisterInfo::eliminateFrameIndex() will
   check for the offset being a multiple of 16 and will convert it to an
   X-Form instruction if it isn't.

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

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

6 years ago[llvm-rc] Use proper search algorithm for finding resources.
Zachary Turner [Wed, 11 Oct 2017 20:12:09 +0000 (20:12 +0000)]
[llvm-rc] Use proper search algorithm for finding resources.

Previously we would only look in the current directory for a
resource, which might not be the same as the directory of the
rc file.  Furthermore, MSVC rc supports a /I option, and can
also look in the system environment.  This patch adds support
for this search algorithm.

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

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

6 years ago[SCEV] Properly handle the case of a non-constant start with a zero accum in ScalarEv...
Daniel Neilson [Wed, 11 Oct 2017 19:05:14 +0000 (19:05 +0000)]
[SCEV] Properly handle the case of a non-constant start with a zero accum in ScalarEvolution::createAddRecFromPHIWithCastsImpl

Summary:
 This patch fixes an error in the patch to ScalarEvolution::createAddRecFromPHIWithCastsImpl
made in D37265. In that patch we handle the cases where the either the start or accum values can be
zero after truncation. But, we assume that the start value must be a constant if the accum is
zero. This is clearly an erroneous assumption. This change removes that assumption.

Reviewers: sanjoy, dorit, mkazantsev

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

6 years ago[x86] avoid infinite loop from SoftenFloatOperand (PR34866)
Sanjay Patel [Wed, 11 Oct 2017 18:24:21 +0000 (18:24 +0000)]
[x86] avoid infinite loop from SoftenFloatOperand (PR34866)

Legalization of fp128 assumes things that we should have asserts for,
so that's another potential improvement.

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

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

6 years agoReland "[llvm-objcopy] Add support for --strip-sections to remove all section headers...
Jake Ehrlich [Wed, 11 Oct 2017 18:09:18 +0000 (18:09 +0000)]
Reland "[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data"

ubsan caught an issue I made where I was converting a null pointer to a
reference.

elf utils implements a particularly extreme form of stripping that I'd
like to support. eu-strip has an option called "strip-sections" that
removes all section headers and leaves only program headers and the
segment data. I have implemented this option partly as a test but mainly
because in Fuchsia we would like to use this option to minimize the size
of our executables. The other strip options that are on my list include
--strip-all and --strip-debug. This is a preliminary implementation that
I'd like to start using in Fuchsia builds if possible. This change
implements such a stripping option for llvm-objcopy

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

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

6 years agoConvert the last uses of ErrorOr in include/llvm/Object.
Rafael Espindola [Wed, 11 Oct 2017 18:07:18 +0000 (18:07 +0000)]
Convert the last uses of ErrorOr in include/llvm/Object.

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

6 years ago[NFC] update test case so checks are not order dependent when not needed
Lei Huang [Wed, 11 Oct 2017 18:04:41 +0000 (18:04 +0000)]
[NFC] update test case so checks are not order dependent when not needed

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

6 years agoRemove unused include.
Rafael Espindola [Wed, 11 Oct 2017 17:35:48 +0000 (17:35 +0000)]
Remove unused include.

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

6 years agoConvert the last uses of ErrorOr in COFF.h.
Rafael Espindola [Wed, 11 Oct 2017 17:33:11 +0000 (17:33 +0000)]
Convert the last uses of ErrorOr in COFF.h.

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

6 years agoConvert a few ErrorOr to Expected.
Rafael Espindola [Wed, 11 Oct 2017 17:23:15 +0000 (17:23 +0000)]
Convert a few ErrorOr to Expected.

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

6 years ago[NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure
Vivek Pandya [Wed, 11 Oct 2017 17:12:59 +0000 (17:12 +0000)]
[NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure
parameterized emit() calls

Summary: This is not functional change to adopt new emit() API added in r313691.

Reviewed By: anemet

Subscribers: llvm-commits

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

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

6 years agoConvert a couple of ErrorOr to Expected. NFC.
Rafael Espindola [Wed, 11 Oct 2017 17:05:24 +0000 (17:05 +0000)]
Convert a couple of ErrorOr to Expected. NFC.

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

6 years agoRemove an unused include.
Rafael Espindola [Wed, 11 Oct 2017 16:58:32 +0000 (16:58 +0000)]
Remove an unused include.

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

6 years agoConvert an ErrorOr to Expected.
Rafael Espindola [Wed, 11 Oct 2017 16:56:33 +0000 (16:56 +0000)]
Convert an ErrorOr to Expected.

getRelocationAddend should never be called on non SHT_RELA sections,
but changing that requires changing RelocVisitor.h.

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

6 years ago[Hexagon] Handle non-immediate operands to A2_addi in getIncrementValue
Krzysztof Parzyszek [Wed, 11 Oct 2017 16:15:31 +0000 (16:15 +0000)]
[Hexagon] Handle non-immediate operands to A2_addi in getIncrementValue

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

6 years agoSpelling mistake in comment. NFCI.
Simon Pilgrim [Wed, 11 Oct 2017 16:10:05 +0000 (16:10 +0000)]
Spelling mistake in comment. NFCI.

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

6 years ago[X86] Remove MVT::i1 handling code from LowerTRUNCATE
Craig Topper [Wed, 11 Oct 2017 16:05:05 +0000 (16:05 +0000)]
[X86] Remove MVT::i1 handling code from LowerTRUNCATE

Summary: I don't think this is necessary with i1 being illegal now.

Reviewers: RKSimon, zvi, guyblank

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[Pipeliner] Fix offset value for instrs dependent on post-inc load/stores
Krzysztof Parzyszek [Wed, 11 Oct 2017 15:59:51 +0000 (15:59 +0000)]
[Pipeliner] Fix offset value for instrs dependent on post-inc load/stores

The software pipeliner and the packetizer try to break dependence
between the post-increment instruction and the dependent memory
instructions by changing the base register and the offset value.
However, in some cases, the existing logic didn't work properly
and created incorrect offset value.

Patch by Jyotsna Verma.

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

6 years ago[Pipeliner] Improve serialization order for post-increments
Krzysztof Parzyszek [Wed, 11 Oct 2017 15:51:44 +0000 (15:51 +0000)]
[Pipeliner] Improve serialization order for post-increments

The pipeliner is generating a serial sequence that causes poor
register allocation when a post-increment instruction appears
prior to the use of the post-increment register. This occurs when
there is a circular set of dependences involved with a sequence
of instructions in the same cycle. In this case, there is no
serialization of the parallel semantics that will not cause an
additional register to be allocated.

This patch fixes the problem by changing the instructions so that
the post-increment instruction is used by the subsequent
instruction, which enables the register allocator to make a
better decision and not require another register.

Patch by Brendon Cahoon.

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

6 years ago[InstCombine] add baseline tests for D38531; NFC
Sanjay Patel [Wed, 11 Oct 2017 14:29:17 +0000 (14:29 +0000)]
[InstCombine] add baseline tests for D38531; NFC

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

6 years ago[DAGCombiner] convert insertelement of bitcasted vector into shuffle
Sanjay Patel [Wed, 11 Oct 2017 14:12:16 +0000 (14:12 +0000)]
[DAGCombiner] convert insertelement of bitcasted vector into shuffle

Eg:
insert v4i32 V, (v2i16 X), 2 --> shuffle v8i16 V', X', {0,1,2,3,8,9,6,7}

This is a generalization of the IR fold in D38316 to handle insertion into a non-undef vector.
We may want to abandon that one if we can't find value in squashing the more specific pattern sooner.

We're using the existing legal shuffle target hook to avoid AVX512 horror with vXi1 shuffles.

There may be room for improvement in the shuffle lowering here, but that would be follow-up work.

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

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

6 years agoRevert "[dsymutil] Timestmap verification for __swift_ast"
Jonas Devlieghere [Wed, 11 Oct 2017 13:51:30 +0000 (13:51 +0000)]
Revert "[dsymutil] Timestmap verification for __swift_ast"

This reverts commit r315456.

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

6 years ago[TargetLowering] Correctly track NumFixedArgs field of CallLoweringInfo
Alex Bradbury [Wed, 11 Oct 2017 13:48:45 +0000 (13:48 +0000)]
[TargetLowering] Correctly track NumFixedArgs field of CallLoweringInfo

The NumFixedArgs field of CallLoweringInfo is used by
TargetLowering::LowerCallTo to determine whether a given argument is passed
using the vararg calling convention or not (specifically, to set IsFixed for
each ISD::OutputArg).

Firstly, CallLoweringInfo::setLibCallee and CallLoweringInfo::setCallee both
incorrectly set NumFixedArgs based on the _previous_ args list. Secondly,
TargetLowering::LowerCallTo failed to increment NumFixedArgs when modifying
the argument list so a pointer is passed for the return value.

If your backend uses the IsFixed property or directly accesses NumFixedArgs,
it is _possible_ this change could result in codegen changes (although the
previous behaviour would have been incorrect). No such cases have been
identified during code review for any in-tree architecture.

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

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

6 years ago[dsymutil] Timestmap verification for __swift_ast
Jonas Devlieghere [Wed, 11 Oct 2017 13:34:52 +0000 (13:34 +0000)]
[dsymutil] Timestmap verification for __swift_ast

This patch adds timestamp verification for swiftmodule files.

 - A new flag is provided to allows us to continue testing of the code
   for embedding the__swift_ast. (git doesn't maintain timestamps)
 - Adds a new test for fat (arm) binaries.

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

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

6 years ago[RISCV] Fix build after r315327
Alex Bradbury [Wed, 11 Oct 2017 12:09:06 +0000 (12:09 +0000)]
[RISCV] Fix build after r315327

Differential Revision: https://reviews.llvm.org/D38779
Patch by Chih-Mao Chen.

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

6 years ago[mips] Add missing tests from rL315451
Simon Dardis [Wed, 11 Oct 2017 11:45:06 +0000 (11:45 +0000)]
[mips] Add missing tests from rL315451

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

6 years ago[mips] Add support for parsing target specific flags for MIR
Simon Dardis [Wed, 11 Oct 2017 11:11:35 +0000 (11:11 +0000)]
[mips] Add support for parsing target specific flags for MIR

Reviewers: atanasyan

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

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

6 years agollvm/module.modulemap: Create LLVM_MC_TableGen. It is used by llvm-tblgen.
NAKAMURA Takumi [Wed, 11 Oct 2017 11:08:52 +0000 (11:08 +0000)]
llvm/module.modulemap: Create LLVM_MC_TableGen. It is used by llvm-tblgen.

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

6 years agollvm/module.modulemap: Move Support_TargetRegistry to let LLVMSupport free from MC.
NAKAMURA Takumi [Wed, 11 Oct 2017 11:08:50 +0000 (11:08 +0000)]
llvm/module.modulemap: Move Support_TargetRegistry to let LLVMSupport free from MC.

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

6 years ago[NFC] Fix variables used only for assert in GVN
Max Kazantsev [Wed, 11 Oct 2017 10:31:49 +0000 (10:31 +0000)]
[NFC] Fix variables used only for assert in GVN

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

6 years ago[llvm-rc] Fix spelling in message
Simon Dardis [Wed, 11 Oct 2017 10:14:22 +0000 (10:14 +0000)]
[llvm-rc] Fix spelling in message

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

6 years ago[TableGen] Tidy up CodeGenSchedule.cpp
Javed Absar [Wed, 11 Oct 2017 09:33:23 +0000 (09:33 +0000)]
[TableGen] Tidy up CodeGenSchedule.cpp

Use range_loop where it simplifies.

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

6 years ago[Asm] Add debug tracing in table-generated assembly matcher
Oliver Stannard [Wed, 11 Oct 2017 09:17:43 +0000 (09:17 +0000)]
[Asm] Add debug tracing in table-generated assembly matcher

This adds debug tracing to the table-generated assembly instruction matcher,
enabled by the -debug-only=asm-matcher option.

The changes in the target AsmParsers are to add an MCInstrInfo reference under
a consistent name, so that we can use it from table-generated code. This was
already being used this way for targets that use deprecation warnings, but 5
targets did not have it, and Hexagon had it under a different name to the other
backends.

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

6 years ago[X86] Added tests for TESTM and TESTNM (NFC)
Uriel Korach [Wed, 11 Oct 2017 08:39:25 +0000 (08:39 +0000)]
[X86] Added tests for TESTM and TESTNM (NFC)

Adding this test files now so after another commit that will add a new pattern for
TESTM and TESTNM instructions will show the improvemnts that have been done.

Change-Id: If3908b7f91897d764053312365a2bc1de78b291d

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

6 years ago[GVN] Prevent LoadPRE from hoisting across instructions that don't pass control flow...
Max Kazantsev [Wed, 11 Oct 2017 08:10:43 +0000 (08:10 +0000)]
[GVN] Prevent LoadPRE from hoisting across instructions that don't pass control flow to successors

This patch fixes the miscompile that happens when PRE hoists loads across guards and
other instructions that don't always pass control flow to their successors. PRE is now prohibited
to hoist across such instructions because there is no guarantee that the load standing after such
instruction is still valid before such instruction. For example, a load from under a guard may be
invalid before the guard in the following case:
  int array[LEN];
  ...
  guard(0 <= index && index < LEN);
  use(array[index]);

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

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

6 years ago[LICM] Disallow sinking of unordered atomic loads into loops
Max Kazantsev [Wed, 11 Oct 2017 07:26:45 +0000 (07:26 +0000)]
[LICM] Disallow sinking of unordered atomic loads into loops

Sinking of unordered atomic load into loop must be disallowed because it turns
a single load into multiple loads. The relevant section of the documentation
is: http://llvm.org/docs/Atomics.html#unordered, specifically the Notes for
Optimizers section. Here is the full text of this section:

> Notes for optimizers
> In terms of the optimizer, this **prohibits any transformation that
> transforms a single load into multiple loads**, transforms a store into
> multiple stores, narrows a store, or stores a value which would not be
> stored otherwise. Some examples of unsafe optimizations are narrowing
> an assignment into a bitfield, rematerializing a load, and turning loads
> and stores into a memcpy call. Reordering unordered operations is safe,
> though, and optimizers should take advantage of that because unordered
> operations are common in languages that need them.

Patch by Daniil Suchkov!

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

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

6 years ago[IRCE] Do not process empty safe ranges
Max Kazantsev [Wed, 11 Oct 2017 06:53:07 +0000 (06:53 +0000)]
[IRCE] Do not process empty safe ranges

IRCE should not apply when the safe iteration range is proved to be empty.
In this case we do unneeded job creating pre/post loops and then never
go to the main loop.

This patch makes IRCE not apply to empty safe ranges, adds test for this
situation and also modifies one of existing tests where it used to happen
slightly.

Reviewed By: anna
Differential Revision: https://reviews.llvm.org/D38577

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

6 years ago[GVN] Don't replace constants with constants.
Davide Italiano [Wed, 11 Oct 2017 04:21:51 +0000 (04:21 +0000)]
[GVN] Don't replace constants with constants.

This fixes PR34908. Patch by Alex Crichton!

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

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

6 years agoRevert "[llvm-objcopy] Add support for --strip-sections to remove all section headers...
Jake Ehrlich [Wed, 11 Oct 2017 02:42:29 +0000 (02:42 +0000)]
Revert "[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data"

This reverts commit rL315412

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

6 years agoWIN32_FIND_DATA -> WIN32_FIND_DATAW.
Peter Collingbourne [Wed, 11 Oct 2017 02:09:06 +0000 (02:09 +0000)]
WIN32_FIND_DATA -> WIN32_FIND_DATAW.

Should fix mingw bot.

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

6 years ago[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving...
Jake Ehrlich [Wed, 11 Oct 2017 01:59:06 +0000 (01:59 +0000)]
[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data

elf utils implements a particularly extreme form of stripping that I'd
like to support. eu-strip has an option called "strip-sections" that
removes all section headers and leaves only program headers and the
segment data. I have implemented this option partly as a test but mainly
because in Fuchsia we would like to use this option to minimize the size
of our executables. The other strip options that are on my list include
--strip-all and --strip-debug. This is a preliminary implementation that
I'd like to start using in Fuchsia builds if possible. This change
implements such a stripping option for llvm-objcopy

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

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

6 years ago[MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.
Lang Hames [Wed, 11 Oct 2017 01:57:21 +0000 (01:57 +0000)]
[MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.

MCObjectStreamer owns its MCAsmBackend -- this fixes the types to reflect that,
and allows us to remove another instance of MCObjectStreamer's weird "holding
ownership via someone else's reference" trick.

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

6 years agoSilence MSVC warnings about unsigned wrapping without UB
Reid Kleckner [Wed, 11 Oct 2017 01:40:38 +0000 (01:40 +0000)]
Silence MSVC warnings about unsigned wrapping without UB

Of course, casting an unsigned value too large for 'int' is UB. So,
write out the ternary. LLVM folds it to ADD anyway.

Fixes the warning from r303693 a different way.

Thanks to Erich Keane for pointing this out!

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

6 years ago[X86] Remove temporary std::string creation from shuffle comment printing. We can...
Craig Topper [Wed, 11 Oct 2017 00:46:09 +0000 (00:46 +0000)]
[X86] Remove temporary std::string creation from shuffle comment printing. We can just write directly to the raw_ostream.

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

6 years ago[X86] Add 128-bit version of vbroadcasti32x2 to shuffle comment decoding.
Craig Topper [Wed, 11 Oct 2017 00:11:53 +0000 (00:11 +0000)]
[X86] Add 128-bit version of vbroadcasti32x2 to shuffle comment decoding.

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

6 years agoCodeGen: Minor cleanups to use MachineInstr::getMF. NFC
Justin Bogner [Tue, 10 Oct 2017 23:50:49 +0000 (23:50 +0000)]
CodeGen: Minor cleanups to use MachineInstr::getMF. NFC

Since r315388 we have a shorter way to say this, so we'll replace
MI->getParent()->getParent() with MI->getMF() in a few places.

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

6 years agoCodeGen: Add MachineInstr::getMF(). NFC
Justin Bogner [Tue, 10 Oct 2017 23:34:01 +0000 (23:34 +0000)]
CodeGen: Add MachineInstr::getMF(). NFC

Similarly to how Instruction has getFunction, this adds a less verbose
way to write MI->getParent()->getParent(). I'll follow up shortly with
a change that changes a bunch of the uses.

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

6 years ago[llvm-objcopy] Add ability to remove multiple sections by name
Jake Ehrlich [Tue, 10 Oct 2017 23:02:43 +0000 (23:02 +0000)]
[llvm-objcopy] Add ability to remove multiple sections by name

This change adds the ability to use the "-R"/"-remove-section" option
multiple times.

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

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

6 years ago[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Tue, 10 Oct 2017 22:49:55 +0000 (22:49 +0000)]
[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[X86] Add broadcast patterns that allow a scalar_to_vector between the broadcast...
Craig Topper [Tue, 10 Oct 2017 22:40:31 +0000 (22:40 +0000)]
[X86] Add broadcast patterns that allow a scalar_to_vector between the broadcast and the load.

We already have these patterns for AVX512VL, but not AVX1 or 2.

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

6 years ago[CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Tue, 10 Oct 2017 22:33:29 +0000 (22:33 +0000)]
[CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoSupport: Have directory_iterator::status() return FindFirstFileEx/FindNextFile result...
Peter Collingbourne [Tue, 10 Oct 2017 22:19:46 +0000 (22:19 +0000)]
Support: Have directory_iterator::status() return FindFirstFileEx/FindNextFile results on Windows.

This allows clients to avoid an unnecessary fs::status() call on each
directory entry. Because the information returned by FindFirstFileEx
is a subset of the information returned by a regular status() call,
I needed to extract a base class from file_status that contains only
that information.

On my machine, this reduces the time required to enumerate a ThinLTO
cache directory containing 520k files from almost 4 minutes to less
than 2 seconds.

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

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

6 years agoMake the ELFFile constructor private.
Rafael Espindola [Tue, 10 Oct 2017 22:17:49 +0000 (22:17 +0000)]
Make the ELFFile constructor private.

With this all clients have to use the new create method which returns
an Expected.

Fixes a crash on invalid input.

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

6 years ago[SparsePropagation] Let the Instruction work list hold Values.
Matthew Simpson [Tue, 10 Oct 2017 22:14:12 +0000 (22:14 +0000)]
[SparsePropagation] Let the Instruction work list hold Values.

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

6 years ago[SparsePropagation] Use SmallVector for work lists
Matthew Simpson [Tue, 10 Oct 2017 21:33:48 +0000 (21:33 +0000)]
[SparsePropagation] Use SmallVector for work lists

This patch changes the work lists from std::vector to SmallVector, which
matches the SCCP implementation. This patch also updates some related comments.

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

6 years ago[llvm-objcopy] Fix latent bug that allowed some Sections to be improperly cast to...
Jake Ehrlich [Tue, 10 Oct 2017 21:28:22 +0000 (21:28 +0000)]
[llvm-objcopy] Fix latent bug that allowed some Sections to be improperly cast to StringTableSections

If a Section had Type SHT_STRTAB (which could happen if you had a
.dynstr section) it was possible to cast Section to StringTableSection
and get away with any operation that was supported by SectionBase
without it being noticed. This change makes this bug easier to notice
and fixes it where it occurred. It also made me realize that there was
some duplication of efforts in the loop that calls ::initialize. These
issues are all fixed by this change.

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

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

6 years agoMake the ELFObjectFile constructor private.
Rafael Espindola [Tue, 10 Oct 2017 21:21:16 +0000 (21:21 +0000)]
Make the ELFObjectFile constructor private.

This forces every user to use the new create method that returns an
Expected. This in turn propagates better error messages.

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

6 years agoRevert "Classify llvm-cfi-verify."
Vlad Tsyrklevich [Tue, 10 Oct 2017 21:21:13 +0000 (21:21 +0000)]
Revert "Classify llvm-cfi-verify."

This reverts commit r315363. It has a simple build failure, but more
importantly I want to confirm that unit tests run in check-all to make
sure that they don't silently break in the future.

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

6 years agoUse the first instruction's count to estimate the funciton's entry frequency.
Dehao Chen [Tue, 10 Oct 2017 21:13:50 +0000 (21:13 +0000)]
Use the first instruction's count to estimate the funciton's entry frequency.

Summary: In the current implementation, we only have accurate profile count for standalone symbols. For inlined functions, we do not have entry count data because it's not available in LBR. In this patch, we use the first instruction's frequency to estimiate the function's entry count, especially for inlined functions. This may be inaccurate due to debug info in optimized code. However, this is a better estimate than the static 80/20 estimation we have in the current implementation.

Reviewers: tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits, aprantl

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

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

6 years ago[x86] fix prefix typos for CHECK lines; NFC
Sanjay Patel [Tue, 10 Oct 2017 21:12:47 +0000 (21:12 +0000)]
[x86] fix prefix typos for CHECK lines; NFC

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

6 years ago[X86] Fix some patterns that select VLX instructions, but were incorrectly also check...
Craig Topper [Tue, 10 Oct 2017 21:07:14 +0000 (21:07 +0000)]
[X86] Fix some patterns that select VLX instructions, but were incorrectly also checking presence of BWI instructions.

The EVEX->VEX pass probably obscures this.

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

6 years agoSimplify. NFC.
Rafael Espindola [Tue, 10 Oct 2017 21:03:46 +0000 (21:03 +0000)]
Simplify. NFC.

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

6 years agoClassify llvm-cfi-verify.
Vlad Tsyrklevich [Tue, 10 Oct 2017 20:59:08 +0000 (20:59 +0000)]
Classify llvm-cfi-verify.

Summary: Move llvm-cfi-verify into a class in preparation for CFI analysis to come.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: mgorny, llvm-commits, pcc, kcc

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

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

6 years ago[mips] Correct the instruction predicates for microMIPSr3
Simon Dardis [Tue, 10 Oct 2017 20:52:53 +0000 (20:52 +0000)]
[mips] Correct the instruction predicates for microMIPSr3

Rather than using the AdditionalPredicates mechanism to guard
the microMIPS instructions, use the existing predicates to properly
guard those instructions.

This also resolves a case where an instruction pattern was incorrectly
available for microMIPS32R6, which caused a register allocation failure
as the registers specified in the pattern were not available.

Reviewers: nitesh.jain, atanasyan

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

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

6 years agoAMDGPU: Fix missing skipFunction calls
Matt Arsenault [Tue, 10 Oct 2017 20:48:36 +0000 (20:48 +0000)]
AMDGPU: Fix missing skipFunction calls

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

6 years agoAMDGPU: Fix failure to select branch with optnone
Matt Arsenault [Tue, 10 Oct 2017 20:34:49 +0000 (20:34 +0000)]
AMDGPU: Fix failure to select branch with optnone

opt-bisect/optnone disable the AMDGPUUniformAnnotateValues pass.
The heuristic in the custom selector for brcond deferred the
branch uniformity check to the pattern, which would fail.

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