OSDN Git Service

android-x86/external-llvm.git
5 years ago[AsmPrinter] refactor to support %c w/ GlobalAddress'
Nick Desaulniers [Fri, 26 Apr 2019 18:45:04 +0000 (18:45 +0000)]
[AsmPrinter] refactor to support %c w/ GlobalAddress'

Summary:
Targets like ARM, MSP430, PPC, and SystemZ have complex behavior when
printing the address of a MachineOperand::MO_GlobalAddress. Move that
handling into a new overriden method in each base class. A virtual
method was added to the base class for handling the generic case.

Refactors a few subclasses to support the target independent %a, %c, and
%n.

The patch also contains small cleanups for AVRAsmPrinter and
SystemZAsmPrinter.

It seems that NVPTXTargetLowering is possibly missing some logic to
transform GlobalAddressSDNodes for
TargetLowering::LowerAsmOperandForConstraint to handle with "i" extended
inline assembly asm constraints.

Fixes:
- https://bugs.llvm.org/show_bug.cgi?id=41402
- https://github.com/ClangBuiltLinux/linux/issues/449

Reviewers: echristo, void

Reviewed By: void

Subscribers: void, craig.topper, jholewinski, dschuff, jyknight, dylanmckay, sdardis, nemanjai, javed.absar, sbc100, jgravelle-google, eraman, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, jrtc27, atanasyan, jsji, llvm-commits, kees, tpimh, nathanchance, peter.smith, srhines

Tags: #llvm

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

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

5 years ago[X86][AVX] Fold extract_subvector(broadcast(x)) -> broadcast(x) iff x has one use
Simon Pilgrim [Fri, 26 Apr 2019 18:02:14 +0000 (18:02 +0000)]
[X86][AVX] Fold extract_subvector(broadcast(x)) -> broadcast(x) iff x has one use

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

5 years ago[AArch64][GlobalISel] Select G_BSWAP for vectors of s32 and s64
Jessica Paquette [Fri, 26 Apr 2019 18:00:01 +0000 (18:00 +0000)]
[AArch64][GlobalISel] Select G_BSWAP for vectors of s32 and s64

There are instructions for these, so mark them as legal. Select the correct
instruction in AArch64InstructionSelector.cpp.

Update select-bswap.mir and arm64-rev.ll to reflect the changes.

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

5 years ago[AMDGPU] gfx1010 VOP3 and VOP3P implementation
Stanislav Mekhanoshin [Fri, 26 Apr 2019 17:56:03 +0000 (17:56 +0000)]
[AMDGPU] gfx1010 VOP3 and VOP3P implementation

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

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

5 years ago[DAGCombine] Cleanup visitEXTRACT_SUBVECTOR. NFCI.
Simon Pilgrim [Fri, 26 Apr 2019 17:49:02 +0000 (17:49 +0000)]
[DAGCombine] Cleanup visitEXTRACT_SUBVECTOR. NFCI.

Use ArrayRef::slice, reduce some rather awkward long lines for legibility and run clang-format.

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

5 years ago[ConstantRange] Add abs() support
Nikita Popov [Fri, 26 Apr 2019 16:50:31 +0000 (16:50 +0000)]
[ConstantRange] Add abs() support

Add support for abs() to ConstantRange. This will allow to handle
SPF_ABS select flavor in LVI and will also come in handy as a
primitive for the srem implementation.

The implementation is slightly tricky, because a) abs of signed min
is signed min and b) sign-wrapped ranges may have an abs() that is
smaller than a full range, so we need to explicitly handle them.

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

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

5 years ago[X86] Sink NoRegister creation for unused Base/Index registers into getAddressOperand...
Craig Topper [Fri, 26 Apr 2019 16:39:38 +0000 (16:39 +0000)]
[X86] Sink NoRegister creation for unused Base/Index registers into getAddressOperands. NFCI

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

5 years ago[X86] Segment registers should have i16 type not i32.
Craig Topper [Fri, 26 Apr 2019 16:39:35 +0000 (16:39 +0000)]
[X86] Segment registers should have i16 type not i32.

Probably doesn't really matter, but was inconsistent with the rest of the code.

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

5 years ago[AMDGPU] gfx1010 VOP2 changes
Stanislav Mekhanoshin [Fri, 26 Apr 2019 16:37:51 +0000 (16:37 +0000)]
[AMDGPU] gfx1010 VOP2 changes

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

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

5 years ago[llvm-nm] Revert inadvertently committed 'i' change in r359314
Fangrui Song [Fri, 26 Apr 2019 16:27:11 +0000 (16:27 +0000)]
[llvm-nm] Revert inadvertently committed 'i' change in r359314

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

5 years ago[ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' change
Fangrui Song [Fri, 26 Apr 2019 16:21:51 +0000 (16:21 +0000)]
[ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' change

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

5 years ago[PowerPC] Update P9 vector costs for insert/extract element
Roland Froese [Fri, 26 Apr 2019 16:14:17 +0000 (16:14 +0000)]
[PowerPC] Update P9 vector costs for insert/extract element

The PPC vector cost model values for insert/extract element reflect older
processors that lacked vector insert/extract and move-to/move-from VSR
instructions.  Update getVectorInstrCost to give appropriate values for when
the newer instructions are present.

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

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

5 years ago[llvm-nm] Generalize symbol types 'N', 'n' and '?'
Fangrui Song [Fri, 26 Apr 2019 16:03:31 +0000 (16:03 +0000)]
[llvm-nm] Generalize symbol types 'N', 'n' and '?'

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

5 years ago[llvm-nm] Fix handling of symbol types 't' 'd' 'r'
Fangrui Song [Fri, 26 Apr 2019 16:01:48 +0000 (16:01 +0000)]
[llvm-nm] Fix handling of symbol types 't' 'd' 'r'

In addition, fix and convert the two tests to yaml2obj based. This
allows us to delete two executables.

X86/weak.test: 'v' was not tested
X86/init-fini.test: symbol types of __bss_start _edata _end were wrong
  GNU nm reports __init_array_start as 't', and __preinit_array_start as 'd'.
  __init_array_start is 't' just because its section ".init_array" starts with ".init"

  'd' makes more sense and allows us to drop the weird SHT_INIT_ARRAY rule.
  So, change __init_array_start to 'd' instead.

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

5 years ago[docs] Put DefaultOption bullet in alphabetical order.
Don Hinton [Fri, 26 Apr 2019 15:22:21 +0000 (15:22 +0000)]
[docs] Put DefaultOption bullet in alphabetical order.

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

5 years ago[llvm-nm][llvm-size] Use --double-dash options in tests
Fangrui Song [Fri, 26 Apr 2019 13:42:16 +0000 (13:42 +0000)]
[llvm-nm][llvm-size] Use --double-dash options in tests

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

5 years agos/Dwarf 5/DWARF v5/ NFC
Fangrui Song [Fri, 26 Apr 2019 13:41:19 +0000 (13:41 +0000)]
s/Dwarf 5/DWARF v5/ NFC

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

5 years ago[x86] add tests for fmin/fmax; NFC
Sanjay Patel [Fri, 26 Apr 2019 13:36:37 +0000 (13:36 +0000)]
[x86] add tests for fmin/fmax; NFC

'maximum' and 'minimum' still crash, so they are commented out.

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

5 years agoFix llvm-objcopy/ELF/preserve-segment-contents test on UTF-8 locale
Alexandre Ganea [Fri, 26 Apr 2019 13:09:26 +0000 (13:09 +0000)]
Fix llvm-objcopy/ELF/preserve-segment-contents test on UTF-8 locale

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

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

5 years ago[yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.
George Rimar [Fri, 26 Apr 2019 13:09:11 +0000 (13:09 +0000)]
[yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.

No need to use SmallVector of char* here.
This simplifies the code.

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

5 years ago[yaml2obj] - Remove excessive variable. NFC.
George Rimar [Fri, 26 Apr 2019 12:45:54 +0000 (12:45 +0000)]
[yaml2obj] - Remove excessive variable. NFC.

`auto &Strtab` was used only once.

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

5 years agoFix Wparentheses warning. NFCI.
Simon Pilgrim [Fri, 26 Apr 2019 12:23:42 +0000 (12:23 +0000)]
Fix Wparentheses warning. NFCI.

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

5 years ago[yaml2obj] - Make the code to match the LLVM style. NFCI.
George Rimar [Fri, 26 Apr 2019 12:20:51 +0000 (12:20 +0000)]
[yaml2obj] - Make the code to match the LLVM style. NFCI.

This renames the variables to uppercase and
removes use of `auto` for unobvious type.

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

5 years ago[yaml2elf] - Cleanup the initSectionHeaders(). NFCI.
George Rimar [Fri, 26 Apr 2019 12:15:32 +0000 (12:15 +0000)]
[yaml2elf] - Cleanup the initSectionHeaders(). NFCI.

This encapsulates the section specific code inside the
corresponding writeSectionContent methods.
Making the code a bit more consistent.

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

5 years ago[X86][SSE] Pull out OR(EXTRACTELT(X,0),OR(EXTRACTELT(X,1),...)) matching code from...
Simon Pilgrim [Fri, 26 Apr 2019 11:45:54 +0000 (11:45 +0000)]
[X86][SSE] Pull out OR(EXTRACTELT(X,0),OR(EXTRACTELT(X,1),...)) matching code from LowerVectorAllZeroTest

Create a matchBitOpReduction helper that checks for the pattern with any opcode.

First step towards reusing this code to recognize other scalar reduction patterns.

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

5 years agoMinor formatting tweak, no behavior change
Nico Weber [Fri, 26 Apr 2019 11:44:10 +0000 (11:44 +0000)]
Minor formatting tweak, no behavior change

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

5 years agocaseFoldingDjbHash: simplify and make the US-ASCII fast path faster
Fangrui Song [Fri, 26 Apr 2019 10:56:10 +0000 (10:56 +0000)]
caseFoldingDjbHash: simplify and make the US-ASCII fast path faster

The slow path (with at least one non US-ASCII) will be slower but that
doesn't matter.

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

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

5 years ago[X86][SSE] Disable shouldFoldConstantShiftPairToMask for btver1/btver2 targets (PR40758)
Simon Pilgrim [Fri, 26 Apr 2019 10:49:13 +0000 (10:49 +0000)]
[X86][SSE] Disable shouldFoldConstantShiftPairToMask for btver1/btver2 targets (PR40758)

As detailed on PR40758, Bobcat/Jaguar can perform vector immediate shifts on the same pipes as vector ANDs with the same latency - so it doesn't make sense to replace a shl+lshr with a shift+and pair as it requires an additional mask (with the extra constant pool, loading and register pressure costs).

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

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

5 years ago[X86][AVX] Combine shuffles extracted from a common vector
Simon Pilgrim [Fri, 26 Apr 2019 09:56:14 +0000 (09:56 +0000)]
[X86][AVX] Combine shuffles extracted from a common vector

A small step towards combining shuffles across vector sizes - this recognizes when a shuffle's operands are all extracted from the same larger source and tries to combine to an unary shuffle of that source instead. Fixes one of the test cases from PR34380.

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

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

5 years ago[InferAddressSpaces] Add AS parameter to the pass factory
Sven van Haastregt [Fri, 26 Apr 2019 09:21:25 +0000 (09:21 +0000)]
[InferAddressSpaces] Add AS parameter to the pass factory

This enables the pass to be used in the absence of
TargetTransformInfo. When the argument isn't passed, the factory
defaults to UninitializedAddressSpace and the flat address space is
obtained from the TargetTransformInfo as before this change. Existing
users won't have to change.

Patch by Kevin Petit.

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

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

5 years agoFix alignment in AArch64InstructionSelector::emitConstantPoolEntry()
Hans Wennborg [Fri, 26 Apr 2019 08:31:00 +0000 (08:31 +0000)]
Fix alignment in AArch64InstructionSelector::emitConstantPoolEntry()

The code was using the alignment of a pointer to the value, not the
alignment of the constant itself.

Maybe we got away with it so far because the pointer alignment is
fairly high, but we did end up under-aligning <16 x i8> vectors,
which was caught in the Chromium build after lld stopped over-aligning
the .rodata.cst16 section in r356428. (See crbug.com/953815)

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

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

5 years ago[GlobalISel] Fix inserting copies in the right position for reg definitions
Marcello Maggioni [Fri, 26 Apr 2019 07:21:56 +0000 (07:21 +0000)]
[GlobalISel] Fix inserting copies in the right position for reg definitions

When constrainRegClass is called if the constraining happens on a use the COPY
needs to be inserted before the instruction that contains the MachineOperand,
but if we are constraining a definition it actually needs to be added
after the instruction. In addition, the COPY needs to have its operands
flipped (in the use case we are copying from the old unconstrained register
to the new constrained register, while in the definition case we are copying
from the new constrained register that the instruction defines to the old
unconstrained register).

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

5 years agoFix typos: (re)?sor?uce -> (re)?source
Fangrui Song [Fri, 26 Apr 2019 05:56:23 +0000 (05:56 +0000)]
Fix typos: (re)?sor?uce -> (re)?source

Closes: https://github.com/llvm/llvm-project/pull/10

In-collaboration-with: Olivier Cochard-LabbĂ© <olivier@FreeBSD.org>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Differential Revision: https://reviews.llvm.org/D61021

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

5 years ago[NFC] Add baseline tests for int isKnownNonZero
Dan Robertson [Fri, 26 Apr 2019 02:55:54 +0000 (02:55 +0000)]
[NFC] Add baseline tests for int isKnownNonZero

Add baseline tests for improvements of isKnownNonZero for integer types.

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

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

5 years ago[llvm-objcopy] Accept --long-option but not -long-option
Fangrui Song [Fri, 26 Apr 2019 02:10:10 +0000 (02:10 +0000)]
[llvm-objcopy] Accept --long-option but not -long-option

Summary:

llvm-{objcopy,strip} (and many other LLVM binary utilities) accept
cl::opt style -long-option as well as many short options (e.g. -p -S
-x). People who use them as replacement of GNU binutils often use the
grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x,
-Wd => -W -d, -sj.text => -s -j.text

There is ambiguity if a long option starts with the character used by a
short option. Drop the support for -long-option to resolve the ambiguity.

This divergence from other utilities is accepted (other utilities
continue supporting -long-option).
https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola

Reviewed By: jakehehrlich, jhenderson, rupprecht

Subscribers: grimar, emaste, arichardson, llvm-commits

Tags: #llvm

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

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

5 years ago[GlobalOpt] Swap the expensive check for cold calls with the cheap TTI check
Justin Bogner [Fri, 26 Apr 2019 00:12:50 +0000 (00:12 +0000)]
[GlobalOpt] Swap the expensive check for cold calls with the cheap TTI check

isValidCandidateForColdCC is much more expensive than
TTI.useColdCCForColdCall, which by default just returns false. Avoid
doing this work if we're not going to look at the answer anyway.

This change is NFC, but I see significant compile time improvements on
some code with pathologically many functions.

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

5 years ago[ORC] Remove symbols from dependency lists when failing materialization.
Lang Hames [Thu, 25 Apr 2019 23:31:33 +0000 (23:31 +0000)]
[ORC] Remove symbols from dependency lists when failing materialization.

When failing materialization of a symbol X, remove X from the dependants list
of any of X's dependencies. This ensures that when X's dependencies are
emitted (or fail themselves) they do not try to access the no-longer-existing
MaterializationInfo for X.

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

5 years ago[CUDA] Implemented _[bi]mma* builtins.
Artem Belevich [Thu, 25 Apr 2019 22:28:09 +0000 (22:28 +0000)]
[CUDA] Implemented _[bi]mma* builtins.

These builtins provide access to the new integer and
sub-integer variants of MMA (matrix multiply-accumulate) instructions
provided by CUDA-10.x on sm_75 (AKA Turing) GPUs.

Also added a feature for PTX 6.4. While Clang/LLVM does not generate
any PTX instructions that need it, we still need to pass it through to
ptxas in order to be able to compile code that uses the new 'mma'
instruction as inline assembly (e.g used by NVIDIA's CUTLASS library
https://github.com/NVIDIA/cutlass/blob/master/cutlass/arch/mma.h#L101)

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

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

5 years agoPTX 6.3 extends `wmma` instruction to support s8/u8/s4/u4/b1 -> s32.
Artem Belevich [Thu, 25 Apr 2019 22:27:57 +0000 (22:27 +0000)]
PTX 6.3 extends `wmma` instruction to support s8/u8/s4/u4/b1 -> s32.

All of the new instructions are still handled mostly by tablegen. I've slightly
refactored the code to drive intrinsic/instruction generation from a master
list of supported variants, so all irregularities have to be implemented in one place only.

The test generation script wmma.py has been refactored in a similar way.

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

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

5 years ago[NVPTX] generate correct MMA instruction mnemonics with PTX63+.
Artem Belevich [Thu, 25 Apr 2019 22:27:46 +0000 (22:27 +0000)]
[NVPTX] generate correct MMA instruction mnemonics with PTX63+.

PTX 6.3 requires using ".aligned" in the MMA instruction names.
In order to generate correct name, now we pass current
PTX version to each instruction as an extra constant operand
and InstPrinter adjusts its output accordingly.

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

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

5 years ago[NVPTX] Refactor generation of MMA intrinsics and instructions. NFC.
Artem Belevich [Thu, 25 Apr 2019 22:27:35 +0000 (22:27 +0000)]
[NVPTX] Refactor generation of MMA intrinsics and instructions. NFC.

Generalized constructions of 'fragments' of MMA operations to provide
common primitives for construction of the ops. This will make it easier
to add new variants of the instructions that operate on integer types.

Use nested foreach loops which makes it possible to better control
naming of the intrinsics.

This patch does not affect LLVM's output, so there are no test changes.

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

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

5 years ago[Object][XCOFF] Add intial support for section header table.
Sean Fertile [Thu, 25 Apr 2019 21:36:04 +0000 (21:36 +0000)]
[Object][XCOFF] Add intial support for section header table.

Adds a representation of the section header table to XCOFFObjectFile,
and implements enough to dump the section headers with llvm-obdump.

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

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

5 years ago[CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPC
Keno Fischer [Thu, 25 Apr 2019 21:28:03 +0000 (21:28 +0000)]
[CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPC

Summary:
This value is derived from the host triple, which on the machine
I'm currently using is `ppc64le-linux-redhat`. This change makes
LLVM compile.

Reviewers: nemanjai
Differential Revision: https://reviews.llvm.org/D57118

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

5 years ago[AMDGPU] gfx1010 - fix ubsan failure
Stanislav Mekhanoshin [Thu, 25 Apr 2019 20:39:06 +0000 (20:39 +0000)]
[AMDGPU] gfx1010 - fix ubsan failure

Revert DecoderNamespace in one place for now. It will need more
changes to properly work.

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

5 years ago[x86] add tests for vector fdiv reciprocal estimate; NFC
Sanjay Patel [Thu, 25 Apr 2019 20:35:47 +0000 (20:35 +0000)]
[x86] add tests for vector fdiv reciprocal estimate; NFC

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

5 years agoAssigning to a local object in a return statement prevents copy elision. NFC.
David Blaikie [Thu, 25 Apr 2019 20:09:00 +0000 (20:09 +0000)]
Assigning to a local object in a return statement prevents copy elision. NFC.

I added a diagnostic along the lines of `-Wpessimizing-move` to detect `return x = y` suppressing copy elision, but I don't know if the diagnostic is really worth it. Anyway, here are the places where my diagnostic reported that copy elision would have been possible if not for the assignment.

P1155R1 in the post-San-Diego WG21 (C++ committee) mailing discusses whether WG21 should fix this pitfall by just changing the core language to permit copy elision in cases like these.

(Kona update: The bulk of P1155 is proceeding to CWG review, but specifically *not* the parts that explored the notion of permitting copy-elision in these specific cases.)

Reviewed By: dblaikie

Author: Arthur O'Dwyer

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

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

5 years ago[GlobalISel][AArch64] Make G_EXTRACT_VECTOR_ELT legal for v8s16s
Jessica Paquette [Thu, 25 Apr 2019 20:00:57 +0000 (20:00 +0000)]
[GlobalISel][AArch64] Make G_EXTRACT_VECTOR_ELT legal for v8s16s

This case was missing before, so we couldn't legalize it.

Add it to AArch64LegalizerInfo.cpp and update select-extract-vector-elt.mir.

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

5 years ago[ObjC][ARC] Let ARC optimizer bail out if the number of pointer states
Akira Hatanaka [Thu, 25 Apr 2019 19:42:55 +0000 (19:42 +0000)]
[ObjC][ARC] Let ARC optimizer bail out if the number of pointer states
it keeps track of becomes too large

ARC optimizer does a top-down and a bottom-up traversal of the whole
function to pair up retain and release instructions and remove them.
This can be expensive if the number of instructions in the function and
pointer states it tracks are large since it has to look at each pointer
state and determine whether the instruction being visited can
potentially use the pointer.

This patch adds a command line option that sets a limit to the number of
pointers it tracks.

rdar://problem/49477063

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

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

5 years ago[AMDGPU] gfx1010 VOP1 instructions
Stanislav Mekhanoshin [Thu, 25 Apr 2019 19:01:51 +0000 (19:01 +0000)]
[AMDGPU] gfx1010 VOP1 instructions

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

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

5 years ago[AMDGPU] gfx1010 utility functions
Stanislav Mekhanoshin [Thu, 25 Apr 2019 18:53:41 +0000 (18:53 +0000)]
[AMDGPU] gfx1010 utility functions

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

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

5 years ago[GlobalISel][AArch64] Add generic legalization rule for extends
Jessica Paquette [Thu, 25 Apr 2019 18:42:00 +0000 (18:42 +0000)]
[GlobalISel][AArch64] Add generic legalization rule for extends

This adds a legalization rule for G_ZEXT, G_ANYEXT, and G_SEXT which allows
extends whenever the types will fit in registers (or the source is an s1).

Update tests. Add GISel checks throughout all of arm64-vabs.ll,
where we now select a good portion of the code. Add GISel checks to
arm64-subvector-extend.ll, which has a good number of vector extends in it.

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

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

5 years ago[SelectionDAG][X86] Use stack load/store in PromoteIntRes_BITCAST when the input...
Craig Topper [Thu, 25 Apr 2019 18:19:59 +0000 (18:19 +0000)]
[SelectionDAG][X86] Use stack load/store in PromoteIntRes_BITCAST when the input needs to be be split and the output type is a vector.

We had special case handling here, but it uses a scalar any_extend for the
promotion then bitcasts to the final type. This won't split up the input data
into multiple promoted elements like we need.

This patch falls back to doing the conversion through memory.

Fixes PR41594 which I believe was reflected in the bitcast-vector-bool.ll
changes. The changes to vector-half-conversions.ll are fixing a previously
unknown miscompile from this issue.

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

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

5 years ago[Evaluator] Walk initial elements when handling load through bitcast
Robert Lougher [Thu, 25 Apr 2019 17:00:01 +0000 (17:00 +0000)]
[Evaluator] Walk initial elements when handling load through bitcast

When evaluating a store through a bitcast, the evaluator tries to move the
bitcast from the pointer onto the stored value. If the cast is invalid, it
tries to "introspect" the type to get a valid cast by obtaining a pointer to
the initial element (if the type is nested, this may require walking several
initial elements).

In some situations it is possible to get a bitcast on a load (e.g. with
unions, where the bitcast may not be the same type as the store). However,
equivalent logic to the store to introspect the type is missing. This patch
add this logic.

Note, when developing the patch I was unhappy with adding similar logic
directly to the load case as it could get out of step. Instead, I have
abstracted the "introspection" into a helper function, with the specifics
being handled by a passed-in lambda function.

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

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

5 years ago[GlobalISel][AArch64] Legalize G_FNEARBYINT
Jessica Paquette [Thu, 25 Apr 2019 16:44:40 +0000 (16:44 +0000)]
[GlobalISel][AArch64] Legalize G_FNEARBYINT

Add legalizer support for G_FNEARBYINT. It's the same as G_FCEIL etc.

Since the importer allows us to automatically select this after legalization,
also add tests for selection etc. Also update arm64-vfloatintrinsics.ll.

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

5 years ago[GlobalISel] Add IRTranslator support for G_FNEARBYINT
Jessica Paquette [Thu, 25 Apr 2019 16:39:28 +0000 (16:39 +0000)]
[GlobalISel] Add IRTranslator support for G_FNEARBYINT

Translate llvm.nearbyint into G_FNEARBYINT as a simple intrinsic. Update
arm64-irtranslator.ll.

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

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

5 years ago[GlobalISel] Add a G_FNEARBYINT opcode
Jessica Paquette [Thu, 25 Apr 2019 16:36:03 +0000 (16:36 +0000)]
[GlobalISel] Add a G_FNEARBYINT opcode

For eventually selecting llvm.nearbyint. Equivalent to the SelectionDAG
nearbyint node.

Update legalizer-info-validation.mir.

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

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

5 years agoRevert "[JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows."
Lang Hames [Thu, 25 Apr 2019 15:18:31 +0000 (15:18 +0000)]
Revert "[JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows."

This reverts r359169, as it broke one of the windows bots.

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

5 years agogn build: Document llvm_enable_dia_sdk variable better
Nico Weber [Thu, 25 Apr 2019 14:56:56 +0000 (14:56 +0000)]
gn build: Document llvm_enable_dia_sdk variable better

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

5 years agogn build: Make setting llvm_enable_dia_sdk=true work
Nico Weber [Thu, 25 Apr 2019 14:53:53 +0000 (14:53 +0000)]
gn build: Make setting llvm_enable_dia_sdk=true work

If this is set, %INCLUDE% must contain ".../DIA SDK/include"
and %LIB% must contain ".../DIA SKD/lib/amd64" (assuming you're doing a
64-bit build).

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

5 years ago[InstCombine][X86] Tweak generic expansion of PACKSS/PACKUS to shuffle then truncate...
Simon Pilgrim [Thu, 25 Apr 2019 13:51:57 +0000 (13:51 +0000)]
[InstCombine][X86] Tweak generic expansion of PACKSS/PACKUS to shuffle then truncate. NFCI.

This has no effect on constant folding but will be useful when we expand non-saturating PACKSS/PACKUS intrinsics.

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

5 years ago[Support] json::OStream::flush(), which passes through to the underlying stream
Sam McCall [Thu, 25 Apr 2019 13:33:18 +0000 (13:33 +0000)]
[Support] json::OStream::flush(), which passes through to the underlying stream

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

5 years agogn build: Merge r359179
Nico Weber [Thu, 25 Apr 2019 13:29:34 +0000 (13:29 +0000)]
gn build: Merge r359179

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

5 years agogn build: Merge r359174
Nico Weber [Thu, 25 Apr 2019 13:26:54 +0000 (13:26 +0000)]
gn build: Merge r359174

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

5 years agogn build: Merge r359142
Nico Weber [Thu, 25 Apr 2019 13:25:00 +0000 (13:25 +0000)]
gn build: Merge r359142

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

5 years ago[Support] Add JSON streaming output API, faster where the heavy value types aren...
Sam McCall [Thu, 25 Apr 2019 12:51:42 +0000 (12:51 +0000)]
[Support] Add JSON streaming output API, faster where the heavy value types aren't needed.

Summary:
There's still a little bit of constant factor that could be trimmed (e.g.
more overloads to avoid round-tripping primitives through json::Value).
But this solves the memory scaling problem, and greatly improves the performance
constant factor, and the API should leave room for optimization if needed.

Adapt TimeProfiler to use it, eliminating almost all the performance regression
from r358476.

Performance test on my machine:
perf stat -r 5 ~/llvmbuild-opt/bin/clang++ -w -S -ftime-trace -mllvm -time-trace-granularity=0 spirit.cpp

Handcrafted JSON (HEAD=r358532 with r358476 reverted): 2480ms
json::Value (HEAD): 2757ms (+11%)
After this patch: 2520 ms (+1.6%)

Reviewers: anton-afanasyev, lebedev.ri

Subscribers: kristina, llvm-commits

Tags: #llvm

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

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

5 years ago[InstCombine][X86] Add PACKSS/PACKUS tests for truncation where saturation won't...
Simon Pilgrim [Thu, 25 Apr 2019 12:45:11 +0000 (12:45 +0000)]
[InstCombine][X86] Add PACKSS/PACKUS tests for truncation where saturation won't occur

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

5 years ago[Support] Try to unbreak windows buildbot
Ilya Biryukov [Thu, 25 Apr 2019 11:57:40 +0000 (11:57 +0000)]
[Support] Try to unbreak windows buildbot

After r359179.

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

5 years agoParallel: only allow the first TaskGroup to run tasks parallelly
Fangrui Song [Thu, 25 Apr 2019 11:33:30 +0000 (11:33 +0000)]
Parallel: only allow the first TaskGroup to run tasks parallelly

Summary:
Concurrent (e.g. nested) llvm::parallel::for_each() may lead to dead
locks. See PR35788 (fixed by rLLD322041) and PR41508 (fixed by D60757).

When parallel_for_each() is about to return, in ~Latch() called by
~TaskGroup(), a thread (in the default executor) may block in
Latch::sync() waiting for Count to become zero. If all threads in the
default executor are blocked, it is a dead lock.

To fix this, force serial execution if the current TaskGroup is not the
first one. For a nested llvm::parallel::for_each(), this parallelizes
the outermost loop and serializes inner loops.

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

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

5 years ago[llvm-objdump] Prep for adding newlines before and after "Disassembly of section...
Fangrui Song [Thu, 25 Apr 2019 10:25:52 +0000 (10:25 +0000)]
[llvm-objdump] Prep for adding newlines before and after "Disassembly of section ...:"

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

5 years ago[ConstantRange] [a, b) udiv a full range is [0, umax(b)).
Florian Hahn [Thu, 25 Apr 2019 10:12:43 +0000 (10:12 +0000)]
[ConstantRange] [a, b) udiv a full range is [0, umax(b)).

Reviewers: nikic, spatel, efriedma

Reviewed By: nikic

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

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

5 years ago[Testing] Move clangd::Annotations to llvm testing support
Ilya Biryukov [Thu, 25 Apr 2019 10:08:31 +0000 (10:08 +0000)]
[Testing] Move clangd::Annotations to llvm testing support

Summary:
Annotations allow writing nice-looking unit test code when one needs
access to locations from the source code, e.g. running code completion
at particular offsets in a file. See comments in Annotations.cpp for
more details on the API.

Also got rid of a duplicate annotations parsing code in clang's code
complete tests.

Reviewers: gribozavr, sammccall

Reviewed By: gribozavr

Subscribers: mgorny, hiraditya, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[yaml2obj] - Don't crash on invalid inputs.
George Rimar [Thu, 25 Apr 2019 09:59:55 +0000 (09:59 +0000)]
[yaml2obj] - Don't crash on invalid inputs.

yaml2obj might crash on invalid input when unable to parse the YAML.

Recently a crash with a very similar nature was fixed for an empty files.
This patch revisits the fix and does it in yaml::Input instead.
It seems to be more correct way to handle such situation.

With that crash for invalid inputs is also fixed now.

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

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

5 years agoFix include order. NFCI.
Simon Pilgrim [Thu, 25 Apr 2019 09:49:37 +0000 (09:49 +0000)]
Fix include order. NFCI.

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

5 years ago[X86][SSE] combineBitcastvxi1 - add support for bitcasting to non-scalar integers
Simon Pilgrim [Thu, 25 Apr 2019 09:34:36 +0000 (09:34 +0000)]
[X86][SSE] combineBitcastvxi1 - add support for bitcasting to non-scalar integers

Truncate the movmsk scalar integer result to the equivalent scalar integer width as before but then bitcast to the requested type.

We still have the issue identified in PR41594 but D61114 should handle this.

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

5 years ago[Support] Add a GTest matcher for Optional<T>
Ilya Biryukov [Thu, 25 Apr 2019 09:03:32 +0000 (09:03 +0000)]
[Support] Add a GTest matcher for Optional<T>

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][LoopIdiomRecognize] Some basic baseline tests for bcmp loop idiom
Roman Lebedev [Thu, 25 Apr 2019 08:33:47 +0000 (08:33 +0000)]
[NFC][LoopIdiomRecognize] Some basic baseline tests for bcmp loop idiom

Doubt this is the final test coverage, but this appears to have good
coverage already, so i figure i might as well precommit it.

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

5 years ago[MIPS] Use custom bitcast lowering to avoid excessive instructions
Simon Atanasyan [Thu, 25 Apr 2019 07:47:28 +0000 (07:47 +0000)]
[MIPS] Use custom bitcast lowering to avoid excessive instructions

On Mips32r2 bitcast can be expanded to two sw instructions and an ldc1
when using bitcast i64 to double or an sdc1 and two lw instructions when
using bitcast double to i64. By introducing custom lowering that uses
mtc1/mthc1 we can avoid excessive instructions.

Patch by Mirko Brkusanin.

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

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

5 years ago[X86] Remove part of an if condition that should always be true.
Craig Topper [Thu, 25 Apr 2019 06:08:02 +0000 (06:08 +0000)]
[X86] Remove part of an if condition that should always be true.

The IndexReg will always be non-null at this point. Earlier in the function, if
IndexReg was null we set it to CurDAG->getRegister(0, VT) which made it
non-null.

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

5 years ago[JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows.
Lang Hames [Thu, 25 Apr 2019 05:24:40 +0000 (05:24 +0000)]
[JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows.

This should fix the MachO/x86-64 eh-frame regression test by ensuring that
the symbols __ZTIi and ___gxx_personality_v0 are defined on all platforms.

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

5 years ago[llvm-rtdyld] Add support for passing command line arguments to rtdyld-run code.
Lang Hames [Thu, 25 Apr 2019 05:02:10 +0000 (05:02 +0000)]
[llvm-rtdyld] Add support for passing command line arguments to rtdyld-run code.

The --args option can now be used to pass arguments to code linked with
llvm-rtdyld. E.g.

$ llvm-rtdyld file1.o file2.o --args a b c

is equivalent to:

$ ld -o program file1.o file2.o
$ ./program a b c

This is the rtdyld counterpart to the jitlink change in r359115, and makes
benchmarking and comparison between the tools easier.

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

5 years agoEnable LoopVectorization by default.
Alina Sbirlea [Thu, 25 Apr 2019 04:49:48 +0000 (04:49 +0000)]
Enable LoopVectorization by default.

Summary:
When refactoring vectorization flags, vectorization was disabled by default in the new pass manager.
This patch re-enables is for both managers, and changes the assumptions opt makes, based on the new defaults.
Comments in opt.cpp should clarify the intended use of all flags to enable/disable vectorization.

Reviewers: chandlerc, jgorbe

Subscribers: jlebar, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-objdump] errorToErrorCode+message -> toString
Fangrui Song [Thu, 25 Apr 2019 04:31:26 +0000 (04:31 +0000)]
[llvm-objdump] errorToErrorCode+message -> toString

For test/Object/elf-invalid-phdr.test, the intended error message got lost due to errorToErrorCode().

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

5 years agoConsolidate existing utilities for interpreting vector predicate maskes [NFC]
Philip Reames [Thu, 25 Apr 2019 02:30:17 +0000 (02:30 +0000)]
Consolidate existing utilities for interpreting vector predicate maskes [NFC]

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

5 years agoFix unused variable warning in LoopFusion pass.
Kit Barton [Thu, 25 Apr 2019 02:10:02 +0000 (02:10 +0000)]
Fix unused variable warning in LoopFusion pass.

Do not wrap the contents of printFusionCandidates in the LLVM_DEBUG macro. This
fixes an unused variable warning generated when compiling without asserts but
with -DENABLE_LLVM_DUMP.

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

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

5 years ago[InstCombine] Be consistent w/handling of masked intrinsics style wise [NFC]
Philip Reames [Thu, 25 Apr 2019 01:18:56 +0000 (01:18 +0000)]
[InstCombine] Be consistent w/handling of masked intrinsics style wise [NFC]

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

5 years ago[utils] Add a lldb data formatter for llvm::SmallString.
Davide Italiano [Thu, 25 Apr 2019 00:03:02 +0000 (00:03 +0000)]
[utils] Add a lldb data formatter for llvm::SmallString.

Result:

(lldb) p val
(llvm::SmallString<32>) $31 = "patatino"

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

5 years agoFix spelling error. NFC
Austin Kerbow [Wed, 24 Apr 2019 23:32:21 +0000 (23:32 +0000)]
Fix spelling error. NFC

Summary: Test commit.

Reviewers: msearles, jkorous

Reviewed By: jkorous

Subscribers: dexonsmith, arsenm, jvesely, nhaehnle, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agollvm-cvtres: Make new dupe resource error a bit friendlier
Nico Weber [Wed, 24 Apr 2019 23:26:30 +0000 (23:26 +0000)]
llvm-cvtres: Make new dupe resource error a bit friendlier

For well-known type IDs, include the name of the type.

To not duplicate the ID->name map, make llvm-readobj call this new
function as well.  It has slightly different output, so this also
requires updating a few tests.

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

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

5 years agoposix_spawn should retry upon EINTR
JF Bastien [Wed, 24 Apr 2019 23:24:53 +0000 (23:24 +0000)]
posix_spawn should retry upon EINTR

Summary:
We've seen cases of bots failing with:
  clang: error: unable to execute command: posix_spawn failed: Interrupted system call

Add a small retry loop to posix_spawn in case this happens. Don't retry too much in case there's some systemic problem going on, but retry a few times.
<rdar://problem/50181448>

Reviewers: Bigcheese, arphaman

Subscribers: jkorous, dexonsmith, kristina, llvm-commits

Tags: #llvm

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

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

5 years agoMark new jitlink test XFAIL for windows
Reid Kleckner [Wed, 24 Apr 2019 23:11:17 +0000 (23:11 +0000)]
Mark new jitlink test XFAIL for windows

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

5 years agoRecommitting r358783 and r358786 "[MS] Emit S_HEAPALLOCSITE debug info" with fixes...
Amy Huang [Wed, 24 Apr 2019 23:02:48 +0000 (23:02 +0000)]
Recommitting r358783 and r358786 "[MS] Emit S_HEAPALLOCSITE debug info" with fixes for buildbot error (undefined assembler label).

Summary:
This emits labels around heapallocsite calls and S_HEAPALLOCSITE debug
info in codeview. Currently only changes FastISel, so emitting labels still
needs to be implemented in SelectionDAG.

Reviewers: rnk

Subscribers: aprantl, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

5 years ago[DAGCombiner] scale repeated FP divisor by splat factor
Sanjay Patel [Wed, 24 Apr 2019 22:28:58 +0000 (22:28 +0000)]
[DAGCombiner] scale repeated FP divisor by splat factor

If we have a vector FP division with a splatted divisor, use the existing transform
that converts 'x/y' into 'x * (1.0/y)' to allow more conversions. This can then
potentially be converted into a scalar FP division by existing combines (rL358984)
as seen in the tests here.

That can be a potentially big perf difference if scalar fdiv has better timing
(including avoiding possible frequency throttling for vector ops).

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

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

5 years ago[PowerPC] Allow using initial-exec TLS with PIC
Joerg Sonnenberger [Wed, 24 Apr 2019 22:12:22 +0000 (22:12 +0000)]
[PowerPC] Allow using initial-exec TLS with PIC

Using initial-exec TLS variables is a reasonable performance
optimisation for system libraries. Use the correct PIC mechanism to get
hold of the GOT to avoid text relocations.

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

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

5 years agoAdd period at end of comment.
Sean Fertile [Wed, 24 Apr 2019 21:51:30 +0000 (21:51 +0000)]
Add period at end of comment.

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

5 years ago[X86] Attempt to fix use-after-poison from r359121.
Craig Topper [Wed, 24 Apr 2019 21:48:24 +0000 (21:48 +0000)]
[X86] Attempt to fix use-after-poison from r359121.

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

5 years ago[AMDGPU] gfx1010 SOP instructions
Stanislav Mekhanoshin [Wed, 24 Apr 2019 20:44:34 +0000 (20:44 +0000)]
[AMDGPU] gfx1010 SOP instructions

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

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

5 years ago[SLP] Fix crash after r358519, by V. Porpodas.
Alexey Bataev [Wed, 24 Apr 2019 20:21:32 +0000 (20:21 +0000)]
[SLP] Fix crash after r358519, by V. Porpodas.

Summary: The code did not check if operand was undef before casting it to Instruction.

Reviewers: RKSimon, ABataev, dtemirbulatov

Reviewed By: ABataev

Subscribers: uabelho

Tags: #llvm

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

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

5 years agoTry once more to ensure constant initializaton of ManagedStatics
Reid Kleckner [Wed, 24 Apr 2019 20:13:23 +0000 (20:13 +0000)]
Try once more to ensure constant initializaton of ManagedStatics

First, use the old style of linker initialization for MSVC 2019 in
addition to 2017. MSVC 2019 emits a dynamic initializer for
ManagedStatic when compiled in debug mode, and according to zturner,
also sometimes in release mode. I wasn't able to reproduce that, but it
seems best to stick with the old code that works.

When clang is using the MSVC STL, we have to give ManagedStatic a
constexpr constructor that fully zero initializes all fields, otherwise
it emits a dynamic initializer. The MSVC STL implementation of
std::atomic has a non-trivial (but constexpr) default constructor that
zero initializes the atomic value. Because one of the fields has a
non-trivial constructor, ManagedStatic ends up with a non-trivial ctor.
The ctor is not constexpr, so clang ends up emitting a dynamic
initializer, even though it simply does zero initialization. To make it
constexpr, we must initialize all fields of the ManagedStatic.

However, while the constructor that takes a pointer is marked constexpr,
clang says it does not evaluate to a constant because it contains a cast
from a pointer to an integer. I filed this as:
https://developercommunity.visualstudio.com/content/problem/545566/stdatomic-value-constructor-is-not-actually-conste.html

Once we do that, we can add back the
LLVM_REQUIRE_CONSTANT_INITIALIZATION marker, and so far as I'm aware it
compiles successfully on all supported targets.

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

5 years agoAdd optional arg to profile count getters to filter
Xinliang David Li [Wed, 24 Apr 2019 19:51:16 +0000 (19:51 +0000)]
Add optional arg to profile count getters to filter
synthetic profile count.

Differential Revision: http://reviews.llvm.org/D61025

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

5 years ago[X86] Prevent folding a load into an AND if that AND is really a ZEXT_INREG that...
Craig Topper [Wed, 24 Apr 2019 19:28:38 +0000 (19:28 +0000)]
[X86] Prevent folding a load into an AND if that AND is really a ZEXT_INREG that should use movzx.

This can save a 32-bit immediate move.

We would shrink the load and fold it if it was non-volatile, but that's trickier to check for.

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