OSDN Git Service

android-x86/external-llvm.git
6 years agoSpeed up iteration of CodeView record streams.
Zachary Turner [Thu, 18 Jan 2018 18:35:01 +0000 (18:35 +0000)]
Speed up iteration of CodeView record streams.

There's some abstraction overhead in the underlying
mechanisms that were being used, and it was leading to an
abundance of small but not-free copies being made.  This
showed up on a profile.  Eliminating this and going back to
a low-level byte-based implementation speeds up lld with
/DEBUG between 10 and 15%.

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

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

6 years ago[CodeGen][NFC] Rename IsVerbose to IsStandalone in Machine*::print
Francis Visoiu Mistrih [Thu, 18 Jan 2018 18:05:15 +0000 (18:05 +0000)]
[CodeGen][NFC] Rename IsVerbose to IsStandalone in Machine*::print

Committed r322867 too soon.

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

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

6 years ago[CodeGen] Print RegClasses on MI in verbose mode
Francis Visoiu Mistrih [Thu, 18 Jan 2018 17:59:06 +0000 (17:59 +0000)]
[CodeGen] Print RegClasses on MI in verbose mode

r322086 removed the trailing information describing reg classes for each
register.

This patch adds printing reg classes next to every register when
individual operands/instructions/basic blocks are printed. In the case
of dumping MIR or printing a full function, by default don't print it.

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

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

6 years ago[SLP] Fix test checks, NFC.
Alexey Bataev [Thu, 18 Jan 2018 17:34:27 +0000 (17:34 +0000)]
[SLP] Fix test checks, NFC.

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

6 years ago[ADT] Just give up on GCC, I can't fix this.
Benjamin Kramer [Thu, 18 Jan 2018 16:23:40 +0000 (16:23 +0000)]
[ADT] Just give up on GCC, I can't fix this.

While the memmove workaround fixed it for GCC 6.3. GCC 4.8 and GCC 7.1
are still broken. I have no clue what's going on, just blacklist GCC for
now.

Needless to say this code is ubsan, asan and msan-clean.

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

6 years ago[ADT] Add a workaround for GCC miscompiling the trivially copyable Optional
Benjamin Kramer [Thu, 18 Jan 2018 15:47:59 +0000 (15:47 +0000)]
[ADT] Add a workaround for GCC miscompiling the trivially copyable Optional

I've seen random crashes with GCC 4.8, GCC 6.3 and GCC 7.3, triggered by
my Optional change. All of them affect a different set of targets. This
change fixes the instance of the problem I'm seeing on my local machine,
let's hope it's good enough for the other instances too.

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

6 years ago[TargetLowering] add punctuation for readability; NFC
Sanjay Patel [Thu, 18 Jan 2018 15:25:32 +0000 (15:25 +0000)]
[TargetLowering] add punctuation for readability; NFC

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

6 years ago[MachineOutliner] Fix r322788 - don't write to working directory
Sam McCall [Thu, 18 Jan 2018 15:02:28 +0000 (15:02 +0000)]
[MachineOutliner] Fix r322788 - don't write to working directory

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

6 years ago[docs] Make ReleaseProcess.rst 80 column. NFCI
Joel Jones [Thu, 18 Jan 2018 14:57:55 +0000 (14:57 +0000)]
[docs] Make ReleaseProcess.rst 80 column. NFCI

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

6 years ago[CodeGen][NFC] Refactor MachineInstr::print
Francis Visoiu Mistrih [Thu, 18 Jan 2018 14:52:14 +0000 (14:52 +0000)]
[CodeGen][NFC] Refactor MachineInstr::print

* Handle more cases where the MI is not attached yet
* Add similar asserts like in MIRPrinter::print

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

6 years ago[HWAsan] Fix uninitialized variable.
Benjamin Kramer [Thu, 18 Jan 2018 14:19:04 +0000 (14:19 +0000)]
[HWAsan] Fix uninitialized variable.

Found by msan.

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

6 years ago[X86] Add PR35918 test case
Simon Pilgrim [Thu, 18 Jan 2018 13:42:02 +0000 (13:42 +0000)]
[X86] Add PR35918 test case

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

6 years agotest commit
Klaus Kretzschmar [Thu, 18 Jan 2018 12:58:50 +0000 (12:58 +0000)]
test commit

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

6 years ago[RISCV] Codegen support for the standard RV32M instruction set extension
Alex Bradbury [Thu, 18 Jan 2018 12:36:38 +0000 (12:36 +0000)]
[RISCV] Codegen support for the standard RV32M instruction set extension

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

6 years ago[RISCV] Implement frame pointer elimination
Alex Bradbury [Thu, 18 Jan 2018 11:34:02 +0000 (11:34 +0000)]
[RISCV] Implement frame pointer elimination

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

6 years ago[ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
Benjamin Kramer [Thu, 18 Jan 2018 11:26:24 +0000 (11:26 +0000)]
[ADT] Split optional to only include copy mechanics and dtor for non-trivial types.

This makes uses of Optional more transparent to the compiler (and
clang-tidy) and generates slightly smaller code.

This is a re-land of r317019, which had issues with GCC 4.8 back then.
Those issues don't reproduce anymore, but I'll watch the buildbots
closely in case anything goes wrong.

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

6 years agoA new test to demostrate the current SHLD/SHRD code generation.
Andrew V. Tischenko [Thu, 18 Jan 2018 10:40:48 +0000 (10:40 +0000)]
A new test to demostrate the current SHLD/SHRD code generation.

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

6 years ago[RISCV][NFC] Add nounwind to functions in div.ll and mul.ll
Alex Bradbury [Thu, 18 Jan 2018 09:41:14 +0000 (09:41 +0000)]
[RISCV][NFC] Add nounwind to functions in div.ll and mul.ll

Committing this separately to minimise irrelevant changes for an upcoming
patch.

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

6 years ago[SelectionDAG] Convert assert to condtion
Sam Parker [Thu, 18 Jan 2018 09:22:24 +0000 (09:22 +0000)]
[SelectionDAG] Convert assert to condtion

Follow-up to r322120 which can cause assertions for AArch64 because
v1f64 and v1i64 are legal types.

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

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

6 years ago[X86] Use vmovdqu64/vmovdqa64 for unmasked integer vector stores for consistency...
Craig Topper [Thu, 18 Jan 2018 07:44:09 +0000 (07:44 +0000)]
[X86] Use vmovdqu64/vmovdqa64 for unmasked integer vector stores for consistency with loads.

Previously we used 64 for vXi64 stores and 32 for everything else. This change uses 64 for everything just like do for loads.

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

6 years ago[X86] Remove isel patterns for using unmasked vmovdqa32/vmovdqu32 for integer vector...
Craig Topper [Thu, 18 Jan 2018 07:44:06 +0000 (07:44 +0000)]
[X86] Remove isel patterns for using unmasked vmovdqa32/vmovdqu32 for integer vector loads.

These patterns were just looking for a vXi64 bitcasted to vXi32, but there is no advantage to using vmovdqa32 over vmovdqa64.

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

6 years agoRevert "Add a value_type to ArrayRef."
Clement Courbet [Thu, 18 Jan 2018 07:26:34 +0000 (07:26 +0000)]
Revert "Add a value_type to ArrayRef."

clang OOMs on arm.

This reverts commit a272b2f2ef63f7f602c9ef4d9e10dc4eb9f00aa1.

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

6 years ago[X86] Remove windows line endings from a test file. NFC
Craig Topper [Thu, 18 Jan 2018 06:47:09 +0000 (06:47 +0000)]
[X86] Remove windows line endings from a test file. NFC

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

6 years agoDon't drop dso_local in LTO.
Rafael Espindola [Thu, 18 Jan 2018 05:38:43 +0000 (05:38 +0000)]
Don't drop dso_local in LTO.

LTO sets dso_local as an optimization, so don't clear it.

This avoid clearing it from undefined hidden symbols, which would then
fail the verifier.

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

6 years ago[DAGCombiner] Add a DAG combine to turn a splat build_vector where the splat elemnt...
Craig Topper [Thu, 18 Jan 2018 04:17:06 +0000 (04:17 +0000)]
[DAGCombiner] Add a DAG combine to turn a splat build_vector where the splat elemnt is a bitcast from a vector type into a concat_vector

For example, a build_vector of i64 bitcasted from v2i32 can be turned into a concat_vectors of the v2i32 vectors with a bitcast to a vXi64 type

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

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

6 years agoMake GlobalValues with non-default visibilility dso_local.
Rafael Espindola [Thu, 18 Jan 2018 02:08:23 +0000 (02:08 +0000)]
Make GlobalValues with non-default visibilility dso_local.

This is similar to r322317, but for visibility. It is not as neat
because we have to special case extern_weak.

The idea is the same as the previous change, make the transition to
explicit dso_local easier for the frontends. With this they only have
to add dso_local to symbols where we need some external information to
decide if it is dso_local (like it being part of an ELF executable).

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

6 years agoGlobalISel: Make MachineCSE runnable in the middle of the GlobalISel
Justin Bogner [Thu, 18 Jan 2018 02:06:56 +0000 (02:06 +0000)]
GlobalISel: Make MachineCSE runnable in the middle of the GlobalISel

Right now, it is not possible to run MachineCSE in the middle of the
GlobalISel pipeline. Being able to run generic optimizations between the
core passes of GlobalISel was one of the goals of the new ISel framework.
This is the first attempt to do it.

The problem is that MachineCSE pass assumes all register operands have a
register class, which, in GlobalISel context, won't be true until after the
InstructionSelect pass. The reason for this behaviour is that before
replacing one virtual register with another, MachineCSE pass (and most of
the other optimization machine passes) must check if the virtual registers'
constraints have a (sufficiently large) intersection, and constrain the
resulting register appropriately if such intersection exists.

GlobalISel extends the representation of such constraints from just a
register class to a triple (low-level type, register bank, register
class).

This commit adds MachineRegisterInfo::constrainRegAttrs method that extends
MachineRegisterInfo::constrainRegClass to such a triple.

The idea is that going forward we should use:

- RegisterBankInfo::constrainGenericRegister within GlobalISel's
  InstructionSelect pass
- MachineRegisterInfo::constrainRegClass within SelectionDAG ISel
- MachineRegisterInfo::constrainRegAttrs everywhere else regardless
  the target and instruction selector it uses.

Patch by Roman Tereshin. Thanks!

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

6 years ago[WebAssembly] Remove duplicated RTLIB names
Derek Schuff [Thu, 18 Jan 2018 01:15:45 +0000 (01:15 +0000)]
[WebAssembly] Remove duplicated RTLIB names

Remove the tight coupling between llvm/CodeGenRuntimeLibcalls.def and
the table of supported singatures for wasm. This will allow adding new libcalls
without changing wasm's signature table.

Also, some cleanup:
Use ManagedStatics instead of const tables to avoid memory/binary bloat.
Use a StringMap instead of a linear search for name lookup.

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

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

6 years agoFix the failure caused by r322773
Volkan Keles [Thu, 18 Jan 2018 01:10:30 +0000 (01:10 +0000)]
Fix the failure caused by r322773

Do not run GlobalISel if `-fast-isel=0 -global-isel=false`.

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

6 years ago[MachineOutliner] Add DISubprograms to outlined functions.
Jessica Paquette [Thu, 18 Jan 2018 00:00:58 +0000 (00:00 +0000)]
[MachineOutliner] Add DISubprograms to outlined functions.

Before, it wasn't possible to get backtraces inside outlined functions. This
commit adds DISubprograms to the IR functions created by the outliner which
makes this possible. Also attached a test that ensures that the produced
debug information is correct. This is useful to users that want to debug
outlined code.

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

6 years ago[CodeGen] Hoist common AsmPrinter code out of X86, ARM, and AArch64
Reid Kleckner [Wed, 17 Jan 2018 23:55:23 +0000 (23:55 +0000)]
[CodeGen] Hoist common AsmPrinter code out of X86, ARM, and AArch64

Every known PE COFF target emits /EXPORT: linker flags into a .drective
section. The AsmPrinter should handle this.

While we're at it, use global_values() and emit each export flag with
its own .ascii directive. This should make the .s file output more
readable.

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

6 years ago[LangRef] Clarify Varargs forwarding for musttail calls.
Florian Hahn [Wed, 17 Jan 2018 23:29:25 +0000 (23:29 +0000)]
[LangRef] Clarify Varargs forwarding for musttail calls.

This clarification was suggested by @efriedma in D41335, which uses this
behavior to inline musttail calls with varargs.

Reviewers: hfinkel, efriedma, rnk

Reviewed By: rnk

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

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

6 years ago[hwasan] LLVM-level flags for linux kernel-compatible hwasan instrumentation.
Evgeniy Stepanov [Wed, 17 Jan 2018 23:24:38 +0000 (23:24 +0000)]
[hwasan] LLVM-level flags for linux kernel-compatible hwasan instrumentation.

Summary:
-hwasan-mapping-offset defines the non-zero shadow base address.
-hwasan-kernel disables calls to __hwasan_init in module constructors.
Unlike ASan, -hwasan-kernel does not force callback instrumentation.
This is controlled separately with -hwasan-instrument-with-calls.

Reviewers: kcc

Subscribers: srhines, hiraditya, llvm-commits

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

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

6 years agoAdd a TargetOption to enable/disable GlobalISel
Volkan Keles [Wed, 17 Jan 2018 22:34:21 +0000 (22:34 +0000)]
Add a TargetOption to enable/disable GlobalISel

Summary:
This patch adds a new target option in order to control GlobalISel.
This will allow the users to enable/disable GlobalISel prior to the
backend by calling `TargetMachine::setGlobalISel(bool Enable)`.

No test case as there is already a test to check GlobalISel
command line options.
See: CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll.

Reviewers: qcolombet, aemerson, ab, dsanders

Reviewed By: qcolombet

Subscribers: rovka, javed.absar, kristof.beyls, llvm-commits

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

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

6 years agoAdd support for emitting libcalls for x86_fp80 -> fp128 and vice-versa
Benjamin Kramer [Wed, 17 Jan 2018 22:29:16 +0000 (22:29 +0000)]
Add support for emitting libcalls for x86_fp80 -> fp128 and vice-versa

compiler_rt doesn't provide them (yet), but libgcc does. PR34076.

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

6 years agoAdd a ProfileCount class to represent entry counts.
Easwaran Raman [Wed, 17 Jan 2018 22:24:23 +0000 (22:24 +0000)]
Add a ProfileCount class to represent entry counts.

Summary:
The class wraps a uint64_t and an enum to represent the type of profile
count (real and synthetic) with some helper methods.

Reviewers: davidxl

Subscribers: llvm-commits

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

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

6 years ago[X86][MMX] Add PR35982 test cases
Simon Pilgrim [Wed, 17 Jan 2018 22:19:31 +0000 (22:19 +0000)]
[X86][MMX] Add PR35982 test cases

FEMMS has the same problem as EMMS

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

6 years ago[LegalizeDAG] Fix ATOMIC_CMP_SWAP_WITH_SUCCESS legalization.
Eli Friedman [Wed, 17 Jan 2018 22:04:36 +0000 (22:04 +0000)]
[LegalizeDAG] Fix ATOMIC_CMP_SWAP_WITH_SUCCESS legalization.

The code wasn't zero-extending correctly, so the comparison could
spuriously fail.

Adds some AArch64 tests to cover this case.

Inspired by D41791.

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

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

6 years ago[SCEV] Fix typo. NFC.
Javed Absar [Wed, 17 Jan 2018 21:58:35 +0000 (21:58 +0000)]
[SCEV] Fix typo. NFC.

Fix confusing typo in comment.

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

6 years ago[globalisel][tablegen] Honour priority order within nested instructions.
Daniel Sanders [Wed, 17 Jan 2018 20:34:29 +0000 (20:34 +0000)]
[globalisel][tablegen] Honour priority order within nested instructions.

It appears that we haven't been prioritizing rules that contain nested
instructions properly. InstructionOperandMatcher didn't override
isHigherPriorityThan so it never compared the instructions/operands/predicates
inside nested instructions.

Fixes PR35926. Thanks to Diana Picus for the bug report.

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

6 years agoRevert [PowerPC] This reverts commit rL322721
Zaara Syeda [Wed, 17 Jan 2018 20:00:15 +0000 (20:00 +0000)]
Revert [PowerPC] This reverts commit rL322721

Failing build bots. Revert the commit now.

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

6 years ago[MDA] Use common code instead of reimplementing same. [NFC]
Philip Reames [Wed, 17 Jan 2018 19:57:19 +0000 (19:57 +0000)]
[MDA] Use common code instead of reimplementing same. [NFC]

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

6 years ago[GISel] Make constrainSelectedInstRegOperands() available to the legalizer. NFC
Aditya Nandakumar [Wed, 17 Jan 2018 19:31:33 +0000 (19:31 +0000)]
[GISel] Make constrainSelectedInstRegOperands() available to the legalizer. NFC

https://reviews.llvm.org/D42149

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

6 years ago[WebAssembly] Remove debug names from symbol table
Sam Clegg [Wed, 17 Jan 2018 19:28:43 +0000 (19:28 +0000)]
[WebAssembly] Remove debug names from symbol table

Get rid of DEBUG_FUNCTION_NAME symbols. When we actually debug
data, maybe we'll want somewhere to put it... but having a symbol
that just stores the name of another symbol seems odd.
It means you have multiple Symbols with the same name, one
containing the actual function and another containing the name!

Store the names in a vector on the WasmObjectFile when reading
them in. Also stash them on the WasmFunctions themselves.
The names are //not// "symbol names" or aliases or anything,
they're just the name that a debugger should show against the
function body itself. NB. The WasmObjectFile stores them so that
they can be exported in the YAML losslessly, and hence the tests
can be precise.

Enforce that the CODE section has been read in before reading
the "names" section. Requires minor adjustment to some tests.

Patch by Nicholas Wilson!

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

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

6 years agoUse a got to access a hidden weak undefined on MachO.
Rafael Espindola [Wed, 17 Jan 2018 19:19:55 +0000 (19:19 +0000)]
Use a got to access a hidden weak undefined on MachO.

Trying to link

__attribute__((weak, visibility("hidden"))) extern int foo;
int *main(void) {
  return &foo;
}

on OS X fails with

ld: 32-bit RIP relative reference out of range (-4294971318 max is +/-2GB): from _main (0x100000FAB) to _foo@0x00001000 (0x00000000) in '_main' from test.o for architecture x86_64

The problem being that 0 cannot be computed as a fixed difference from
%rip. Exactly the same issue exists on ELF and we can use the same
solution.

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

6 years ago[ARM] Optimize {s,u}mul.with.overflow.
Joel Galenson [Wed, 17 Jan 2018 19:19:05 +0000 (19:19 +0000)]
[ARM] Optimize {s,u}mul.with.overflow.

This extends my previous patches to also optimize overflow-checked multiplies during SelectionDAG.

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

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

6 years ago[ARM] Optimize {s,u}{add,sub}.with.overflow.
Joel Galenson [Wed, 17 Jan 2018 19:19:05 +0000 (19:19 +0000)]
[ARM] Optimize {s,u}{add,sub}.with.overflow.

The ARM backend contains code that tries to optimize compares by replacing them with an existing instruction that sets the flags the same way. This allows it to replace a "cmp" with a "adds", generalizing the code that replaces "cmp" with "sub". It also heuristically disables sinking of instructions that could potentially be used to replace compares (currently only if they're next to each other).

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

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

6 years ago[Attributes] Fix crash when attempting to remove alignment from an attribute list/set
Daniel Neilson [Wed, 17 Jan 2018 19:15:21 +0000 (19:15 +0000)]
[Attributes] Fix crash when attempting to remove alignment from an attribute list/set

Summary:
 Discovered while working on a patch to move alignment in
@llvm.memcpy/move/set from an arg into parameter attributes.

 The current implementations of AttributeSet::removeAttribute() and
AttributeList::removeAttribute crash when attempting to remove the
alignment attribute. Currently, these implementations add the
to-be-removed attributes to an AttrBuilder and then remove
the builder from the list/set. Alignment is special in that it
must be added to a builder with an integer value for the alignment;
attempts to add alignment to a builder without a value is an error.

 This change fixes the removeAttribute implementations for AttributeSet and
AttributeList to make them able to remove the alignment, and other similar,
attributes.

Reviewers: rnk, chandlerc, pete, javed.absar, reames

Reviewed By: rnk

Subscribers: llvm-commits

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

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

6 years ago[X86][BTVER2] Reduce instregex usage (PR35955)
Simon Pilgrim [Wed, 17 Jan 2018 19:12:48 +0000 (19:12 +0000)]
[X86][BTVER2] Reduce instregex usage (PR35955)

Most are just replaced with instrs lists, but a few regexps have been further generalized to match more instructions with a single pattern.

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

6 years ago[InstCombine] add baseline tests for D39958; NFC
Sanjay Patel [Wed, 17 Jan 2018 19:04:18 +0000 (19:04 +0000)]
[InstCombine] add baseline tests for D39958; NFC

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

6 years ago[X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and...
Craig Topper [Wed, 17 Jan 2018 18:58:22 +0000 (18:58 +0000)]
[X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and use a 64-bit broadcast

If we are splatting pairs of 32-bit elements, we can use a 64-bit broadcast to get the job done.

We could probably could probably do this with other sizes too, for example four 16-bit elements. Or we could broadcast pairs of 16-bit elements using a 32-bit element broadcast. But I've left that as a future improvement.

I've also restricted this to AVX2 only because we can only broadcast loads under AVX.

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

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

6 years ago[utils] Make .cfi_startproc optional for powerpc
Fangrui Song [Wed, 17 Jan 2018 18:48:50 +0000 (18:48 +0000)]
[utils] Make .cfi_startproc optional for powerpc

Summary: llc sometimes may not emit .cfi_startproc which makes func_dict to have less entries.

Subscribers: nemanjai, llvm-commits

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

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

6 years ago[X86] When legalizing (v64i1 select i8, v64i1, v64i1) make sure not to introduce...
Craig Topper [Wed, 17 Jan 2018 18:46:01 +0000 (18:46 +0000)]
[X86] When legalizing (v64i1 select i8, v64i1, v64i1) make sure not to introduce bitcasts to i64 in 32-bit mode

We legalize selects of masks with scalar conditions using a bitcast to an integer type. But if we are in 32-bit mode we can't convert v64i1 to i64. So instead split the v64i1 to v32i1 and concat it back together. Each half will then be legalized by bitcasting to i32 which is fine.

The test case is a little indirect. If we have the v64i1 select in IR it will get legalized by legalize vector ops which has a run of type legalization after it. That type legalization run is able to fix this i64 bitcast. So in order to avoid that we need a build_vector of a splat which legalize vector ops will ignore. Legalize DAG will then turn that into a select via LowerBUILD_VECTORvXi1. And the select will get legalized. In this case there is no type legalizer run to cleanup the bitcast.

This fixes pr35972.

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

6 years ago[X86][SSE] Add v4i16 PMULLD tests
Simon Pilgrim [Wed, 17 Jan 2018 18:41:27 +0000 (18:41 +0000)]
[X86][SSE] Add v4i16 PMULLD tests

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

6 years ago[PowerPC] Add handling for ColdCC calling convention and a pass to mark
Zaara Syeda [Wed, 17 Jan 2018 18:22:55 +0000 (18:22 +0000)]
[PowerPC] Add handling for ColdCC calling convention and a pass to mark
candidates with coldcc attribute.

This patch adds support for the coldcc calling convention for Power.
This changes the set of non-volatile registers. It includes a pass to stress
test the implementation by marking all static directly called functions with
the coldcc attribute through the option -enable-coldcc-stress-test. It also
includes an option, -ppc-enable-coldcc, to add the coldcc attribute to
functions which are cold at all call sites based on BlockFrequencyInfo when
the containing function does not call any non cold functions.

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

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

6 years agoFix MSVC "not all control paths return a value" warning.
Simon Pilgrim [Wed, 17 Jan 2018 18:16:28 +0000 (18:16 +0000)]
Fix MSVC "not all control paths return a value" warning.

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

6 years ago[ARC] Add missing condition codes.
Tatyana Krasnukha [Wed, 17 Jan 2018 17:58:28 +0000 (17:58 +0000)]
[ARC] Add missing condition codes.

Summary: Added VS and VC, required for disassembling.

Reviewers: petecoup

Reviewed By: petecoup

Subscribers: llvm-commits

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

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

6 years ago[SystemZ] Handle BRCTH branches correctly in SystemZLongBranch.cpp.
Jonas Paulsson [Wed, 17 Jan 2018 17:16:07 +0000 (17:16 +0000)]
[SystemZ]  Handle BRCTH branches correctly in SystemZLongBranch.cpp.

BRCTH is capable of a long branch which needs to be recognized during branch
relaxation. This is done by checking for ExtraRelaxSize == 0.

Review: Ulrich Weigand

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

6 years agoAMDGPU: Error in SIAnnotateControlFlow instead of assert
Matt Arsenault [Wed, 17 Jan 2018 16:30:01 +0000 (16:30 +0000)]
AMDGPU: Error in SIAnnotateControlFlow instead of assert

This assert typically happens if an unstructured CFG is passed
to the pass. This can happen if the pass is run independently
without the structurizer.

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

6 years agoAdd tests for ConstantFoldTerminator preserving DomTree
Matt Arsenault [Wed, 17 Jan 2018 16:27:17 +0000 (16:27 +0000)]
Add tests for ConstantFoldTerminator preserving DomTree

With my bad luck I separately implemented the DomTree preservation
for ConstantFoldTerminator before r322401 was committed. Commit the
tests which I think still provide some value.

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

6 years ago[ARM GlobalISel] Rename local variable. NFC
Diana Picus [Wed, 17 Jan 2018 15:25:37 +0000 (15:25 +0000)]
[ARM GlobalISel] Rename local variable. NFC

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

6 years ago[ARM GlobalISel] Add instselect tests for G_FPEXT and G_FPTRUNC
Diana Picus [Wed, 17 Jan 2018 15:01:19 +0000 (15:01 +0000)]
[ARM GlobalISel] Add instselect tests for G_FPEXT and G_FPTRUNC

G_FPEXT and G_FPTRUNC are handled by TableGen'erated code, just add
tests.

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

6 years ago[AArch64] Fix incorrect LD1 of 16-bit FP vectors in big endian
Pablo Barrio [Wed, 17 Jan 2018 14:39:29 +0000 (14:39 +0000)]
[AArch64] Fix incorrect LD1 of 16-bit FP vectors in big endian

Summary:
Loading a vector of 4 half-precision FP sometimes results in an LD1
of 2 single-precision FP + a reversal. This results in an incorrect
byte swap due to the conversion from little endian to big endian.

In order to generate the correct byte swap, it is easier to
generate the correct LD1 of 4 half-precision FP, thus avoiding the
subsequent reversal.

Reviewers: craig.topper, jmolloy, olista01

Reviewed By: olista01

Subscribers: efriedma, samparker, SjoerdMeijer, rogfer01, aemerson, rengolin, javed.absar, kristof.beyls, llvm-commits

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

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

6 years ago[InstCombine] fix demanded-bits propagation for zext/trunc
Sanjay Patel [Wed, 17 Jan 2018 14:39:28 +0000 (14:39 +0000)]
[InstCombine] fix demanded-bits propagation for zext/trunc

I was comparing the demanded-bits implementations between InstCombine
and TargetLowering as part of investigating questions in D42088 and
noticed that this was wrong in IR. We were losing all of the prior
known bits when we got back to the 'zext'.

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

6 years ago[InstCombine] add test to show hole in demanded bits; NFC
Sanjay Patel [Wed, 17 Jan 2018 14:27:35 +0000 (14:27 +0000)]
[InstCombine] add test to show hole in demanded bits; NFC

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

6 years ago[RISCV] Allow RISCVAsmBackend::writeNopData to generate c.nop when supported
Alex Bradbury [Wed, 17 Jan 2018 14:17:12 +0000 (14:17 +0000)]
[RISCV] Allow RISCVAsmBackend::writeNopData to generate c.nop when supported

When the compressed instruction set is enabled, the 16-bit c.nop can be
generated if necessary.

Differential Revision: https://reviews.llvm.org/D41221
Patch by Shiva Chen.

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

6 years ago[ARM GlobalISel] Map G_FPEXT and G_FPTRUNC to FPR
Diana Picus [Wed, 17 Jan 2018 14:14:14 +0000 (14:14 +0000)]
[ARM GlobalISel] Map G_FPEXT and G_FPTRUNC to FPR

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

6 years ago[AMDGPU] add LDS f32 intrinsics
Daniil Fukalov [Wed, 17 Jan 2018 14:05:05 +0000 (14:05 +0000)]
[AMDGPU] add LDS f32 intrinsics

added llvm.amdgcn.atomic.{add|min|max}.f32 intrinsics
to allow generate ds_{add|min|max}[_rtn]_f32 instructions
needed for OpenCL float atomics in LDS

Reviewed by: arsenm

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

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

6 years ago[AMDGPU][MC][GFX9] Enable inline constants for SDWA operands
Dmitry Preobrazhensky [Wed, 17 Jan 2018 14:00:48 +0000 (14:00 +0000)]
[AMDGPU][MC][GFX9] Enable inline constants for SDWA operands

See bug 35771: https://bugs.llvm.org/show_bug.cgi?id=35771

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

Reviewers: vpykhtin, artem.tamazov, arsenm

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

6 years ago[ARM GlobalISel] Legalize G_FPEXT and G_FPTRUNC
Diana Picus [Wed, 17 Jan 2018 13:34:10 +0000 (13:34 +0000)]
[ARM GlobalISel] Legalize G_FPEXT and G_FPTRUNC

Mark G_FPEXT and G_FPTRUNC as legal or libcall, depending on hardware
support, but only for conversions between float and double.

Also add the necessary boilerplate so that the LegalizerHelper can
introduce the required libcalls. This also works only for float and
double, but isn't too difficult to extend when the need arises.

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

6 years ago[Transforms] Support making mutable versions of new-format TBAA access tags
Ivan A. Kosarev [Wed, 17 Jan 2018 13:29:54 +0000 (13:29 +0000)]
[Transforms] Support making mutable versions of new-format TBAA access tags

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

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

6 years ago[X86] Don't mutate shuffle arguments after early-out for AVX512
Benjamin Kramer [Wed, 17 Jan 2018 13:01:06 +0000 (13:01 +0000)]
[X86] Don't mutate shuffle arguments after early-out for AVX512

The match* functions have the annoying behavior of modifying its inputs.
Save and restore the inputs, just in case the early out for AVX512 is
hit. This is still not great and its only a matter of time this kind of
bug happens again, but I couldn't come up with a better pattern without
rewriting significant chunks of this code. Fixes PR35977.

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

6 years ago[X86] Constify DebugLoc parameters. No functionality change.
Benjamin Kramer [Wed, 17 Jan 2018 13:00:58 +0000 (13:00 +0000)]
[X86] Constify DebugLoc parameters. No functionality change.

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

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Wed, 17 Jan 2018 12:29:38 +0000 (12:29 +0000)]
[NFC] fix trivial typos in comments

"the the" -> "the"

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

6 years agoDon't emit apple accelerator tables on non-darwin targets
Pavel Labath [Wed, 17 Jan 2018 11:52:13 +0000 (11:52 +0000)]
Don't emit apple accelerator tables on non-darwin targets

Summary:
Currently -glldb turns on emission of apple tables on all targets, but
lldb is only really capable of consuming them on darwin. Furthermore,
making lldb consume these tables is not straight-forward because of the
differences in how the debug info is distributed on darwin vs. elf
targets.

The darwin debug model assumes that the debug info (along with
accelerator tables) will either remain in the .o files or it will be
linked into a dsym bundle by a linker that knows how to merge these
tables. In the elf world, all present linkers will simply concatenate
these accelerator tables into the shared object. Since the tables are
not self-terminating, this renders the tables unusable, as the debugger
cannot pry the individual tables apart anymore.

It might theoretically be possible to make the tables work with split
dwarf, as that is somewhat similar to the apple .o model, but
unfortunately right now the combination of -glldb and -gsplit-dwarf
produces broken object files.

Until these issues are resolved there is no point in emitting the apple
tables for these targets. At best, it wastes space; at worst, it breaks
compilation and prevents the user from getting other benefits of -glldb.

Reviewers: probinson, aprantl, dblaikie

Subscribers: emaste, dim, llvm-commits, JDevlieghere

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

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

6 years agoRewrite debugger tuning test case to not depend on apple sections
Pavel Labath [Wed, 17 Jan 2018 11:11:53 +0000 (11:11 +0000)]
Rewrite debugger tuning test case to not depend on apple sections

Summary:
In a follow-up commit I'll change the rules for emission of accelerator
tables, which means we won't be able to use them as a litmus test for
the debugger tuning options. Instead of sections, I base the test on the
presence/absence of some debug info attributes and opcodes:
LLDB - prefers DW_OP_form_tls_address and uses DW_AT_APPLE_optimized
GDB - prefers DW_OP_GNU_push_tls_address and does not use the optimized
  attribute
SCE - prefers DW_OP_form_tls_address and does not use the optimized
  attribute

Reviewers: probinson, aprantl, dblaikie

Subscribers: JDevlieghere, llvm-commits

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

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

6 years ago[SCEV] fix typo
Javed Absar [Wed, 17 Jan 2018 11:03:06 +0000 (11:03 +0000)]
[SCEV] fix typo

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

6 years ago[X86][AVX] Add extra 'interleaved+lanepermute' shuffle test
Simon Pilgrim [Wed, 17 Jan 2018 10:56:54 +0000 (10:56 +0000)]
[X86][AVX] Add extra 'interleaved+lanepermute' shuffle test

Possible missed opportunity to use 64-bit lane permute on AVX1 in lowerShuffleAsRepeatedMaskAndLanePermute

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

6 years ago[ThinLTO] - Remove code duplication. NFC.
George Rimar [Wed, 17 Jan 2018 10:33:05 +0000 (10:33 +0000)]
[ThinLTO] - Remove code duplication. NFC.

Refactors 3 copies of isExpected.
Splitted from D42107.

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

6 years agoAllow usage of X86-prefixes as separate instrs.
Andrew V. Tischenko [Wed, 17 Jan 2018 10:12:06 +0000 (10:12 +0000)]
Allow usage of X86-prefixes as separate instrs.
Differential Revision: https://reviews.llvm.org/D42102

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

6 years ago[MC] Fix -stack-size-section on ARM
Sean Eveson [Wed, 17 Jan 2018 09:01:29 +0000 (09:01 +0000)]
[MC] Fix -stack-size-section on ARM

Change symbol values in the stack_size section from being 8 bytes, to being a target dependent size.

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

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

6 years ago[X86] In LowerBUILD_VECTOR, rename ExtVT to EltVT so it makes sense.
Craig Topper [Wed, 17 Jan 2018 03:58:21 +0000 (03:58 +0000)]
[X86] In LowerBUILD_VECTOR, rename ExtVT to EltVT so it makes sense.

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

6 years ago[X86] Remove duplicate lines from scheduler models. NFC
Craig Topper [Wed, 17 Jan 2018 03:50:21 +0000 (03:50 +0000)]
[X86] Remove duplicate lines from scheduler models. NFC

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

6 years ago[pdbutil] Replace 0 byte PDB input with correct version to fix failing unit test
Aaron Smith [Wed, 17 Jan 2018 03:48:07 +0000 (03:48 +0000)]
[pdbutil] Replace 0 byte PDB input with correct version to fix failing unit test

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

6 years ago[Support] Return an enum instead of an unsigned; NFC.
George Burgess IV [Wed, 17 Jan 2018 03:12:06 +0000 (03:12 +0000)]
[Support] Return an enum instead of an unsigned; NFC.

We seem to be (logically) returning ArchExtKinds here in all cases, so
the return type should reflect that.

The static_cast is necessary because `A.ID` is actually an `unsigned`,
presumably since we use `decltype(A)` to represent extended attributes
for both ARM and AArch64, which use distinct `ArchExtKinds`.

We can't trivially make the same change for ARM, because one of the
values it returns is the bitwise-or of two `ARM::ArchExtKind`s.

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

6 years agoFix build error - 'default label in switch which covers all enumeration values'
Aaron Smith [Wed, 17 Jan 2018 01:49:01 +0000 (01:49 +0000)]
Fix build error - 'default label in switch which covers all enumeration values'

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

6 years agoFix pretty printing the unspecified param of a variadic function
Aaron Smith [Wed, 17 Jan 2018 01:22:03 +0000 (01:22 +0000)]
Fix pretty printing the unspecified param of a variadic function

Summary:
 - Fix a bug in PrettyBuiltinDumper that returns "void" as the name for
  an unspecified builtin type. Since the unspecified param of a variadic
  function is considered a builtin of unspecified type in PDBs, we set
  "..." for its name.

  - Provide a method to determine if a PDBSymbolFunc is variadic in
  PrettyFunctionDumper since PDBSymbolFunc::getArgument() doesn't return the
  last unspecified-type param.

  - Add a pretty-func-dumper.test to test pretty dumping of variadic
  functions.

Reviewers: zturner, llvm-commits

Reviewed By: zturner

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

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

6 years ago[hwasan] Rename sized load/store callbacks to be consistent with ASan.
Evgeniy Stepanov [Tue, 16 Jan 2018 23:15:08 +0000 (23:15 +0000)]
[hwasan] Rename sized load/store callbacks to be consistent with ASan.

Summary: __hwasan_load is now __hwasan_loadN.

Reviewers: kcc

Subscribers: hiraditya, llvm-commits

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

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

6 years ago[X86][BTVER2] Fix scheduling of VCMPSD/VCMPSS instructions
Simon Pilgrim [Tue, 16 Jan 2018 22:15:41 +0000 (22:15 +0000)]
[X86][BTVER2] Fix scheduling of VCMPSD/VCMPSS instructions

For some reason they don't have a trailing i like the packed equivalents.

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

6 years ago[CallSiteSplitting] Pass list of (BB, Conditions) pairs to splitCallSite.
Florian Hahn [Tue, 16 Jan 2018 22:13:15 +0000 (22:13 +0000)]
[CallSiteSplitting] Pass list of (BB, Conditions) pairs to splitCallSite.

This removes some duplication from splitCallSite and makes it easier to
add additional code dealing with each predecessor. It also allows us to
split for more than 2 predecessors, although that is not enabled for
now.

Reviewers: junbuml, mcrosier, davidxl, davide

Reviewed By: junbuml

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

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

6 years ago[X86][BTVER2] Use instrs instead of instregex for low match counts (PR35955)
Simon Pilgrim [Tue, 16 Jan 2018 22:08:43 +0000 (22:08 +0000)]
[X86][BTVER2] Use instrs instead of instregex for low match counts (PR35955)

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

6 years ago[X86][BTVER2] Use instrs instead of instregex for single use matches (PR35955)
Simon Pilgrim [Tue, 16 Jan 2018 21:44:48 +0000 (21:44 +0000)]
[X86][BTVER2] Use instrs instead of instregex for single use matches (PR35955)

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

6 years agoSpecify inline for isWhitespace in CommandLine.cpp
Rui Ueyama [Tue, 16 Jan 2018 20:52:32 +0000 (20:52 +0000)]
Specify inline for isWhitespace in CommandLine.cpp

Patch by Takuto Ikuta.

In chromium's component build, there are many directive sections and
commandline parsing takes much time.
This patch is for speed up of lld in RelWithDebInfo build by forcing
inline heavily called isWhitespace function.

10 times link perf stats of blink_core.dll changed like below.

master:
TotalSeconds: 9.8764878
TotalSeconds: 10.1455242
TotalSeconds: 10.075279
TotalSeconds: 10.3397347
TotalSeconds: 9.8361665
TotalSeconds: 9.9544441
TotalSeconds: 9.8960686
TotalSeconds: 9.8877865
TotalSeconds: 10.0551879
TotalSeconds: 10.0492254
Avg: 10.01159047

with this patch:
TotalSeconds: 8.8696762
TotalSeconds: 9.1021585
TotalSeconds: 9.0233893
TotalSeconds: 9.1886175
TotalSeconds: 9.156954
TotalSeconds: 9.0978564
TotalSeconds: 9.1316824
TotalSeconds: 8.8354606
TotalSeconds: 9.2549431
TotalSeconds: 9.4473085
Avg: 9.11080465

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

6 years ago[ExecutionEngine] Rename JITSymbol::isStrongDefinition to isStrong.
Lang Hames [Tue, 16 Jan 2018 20:39:51 +0000 (20:39 +0000)]
[ExecutionEngine] Rename JITSymbol::isStrongDefinition to isStrong.

For symmetry with isWeak, isCommon.

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

6 years ago[PPC] Add a new register XER aliased to CARRY
Guozhi Wei [Tue, 16 Jan 2018 19:28:50 +0000 (19:28 +0000)]
[PPC] Add a new register XER aliased to CARRY

When "xer" is specified as clobbered register in inline assembler, clang can accept it, but llvm simply ignore it when lowered to machine instructions. It may cause problems later in scheduler.

This patch adds a new register XER aliased to CARRY, and adds it to register class CARRYRC. Now PPCTargetLowering::getRegForInlineAsmConstraint can return correct register number for inline asm constraint "{xer}", and scheduler behave correctly.

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

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

6 years ago[CodeGen] Skip some instructions that shouldn't affect shrink-wrapping
Francis Visoiu Mistrih [Tue, 16 Jan 2018 18:55:26 +0000 (18:55 +0000)]
[CodeGen] Skip some instructions that shouldn't affect shrink-wrapping

r320606 checked for MI.isMetaInstruction which skips all DBG_VALUEs.

This also skips IMPLICIT_DEFs and other instructions that may def / read
a register.

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

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

6 years ago[GlobalISel][TableGen] Add support for SDNodeXForm
Volkan Keles [Tue, 16 Jan 2018 18:44:05 +0000 (18:44 +0000)]
[GlobalISel][TableGen] Add support for SDNodeXForm

Summary:
This patch adds CustomRenderer which renders the matched
operands to the specified instruction.

Targets can enable the matching of SDNodeXForm by adding
a definition that inherits from GICustomOperandRenderer and
GISDNodeXFormEquiv as follows.

def gi_imm8 : GICustomOperandRenderer<"renderImm8”>,
                       GISDNodeXFormEquiv<imm8_xform>;

Custom renderer functions should be of the form:
void render(MachineInstrBuilder &MIB, const MachineInstr &I);

Reviewers: dsanders, ab, rovka

Reviewed By: dsanders

Subscribers: kristof.beyls, javed.absar, llvm-commits, mgrang, qcolombet

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

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

6 years ago[SLP] Fix for PR32164: Improve vectorization of reverse order of extract operations.
Alexey Bataev [Tue, 16 Jan 2018 18:17:01 +0000 (18:17 +0000)]
[SLP] Fix for PR32164: Improve vectorization of reverse order of extract operations.

Summary: Sometimes vectorization of insertelement instructions with extractelement operands may produce an extra shuffle operation, if these operands are in the reverse order. Patch tries to improve this situation by the reordering of the operands to remove this extra shuffle operation.

Reviewers: mkuper, hfinkel, RKSimon, spatel

Subscribers: mzolotukhin, llvm-commits

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

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

6 years ago[X86][MMX] Accept UNDEF upper bits for MOVD GR32->MMX
Simon Pilgrim [Tue, 16 Jan 2018 17:01:31 +0000 (17:01 +0000)]
[X86][MMX] Accept UNDEF upper bits for MOVD GR32->MMX

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

6 years ago[LiveDebugValues] update kill-after-spill test with target triple
Petar Jovanovic [Tue, 16 Jan 2018 15:57:03 +0000 (15:57 +0000)]
[LiveDebugValues] update kill-after-spill test with target triple

Set target triple to "x86_64-unknown-linux-gnu".

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