]> granicus.if.org Git - llvm/log
llvm
7 years ago[X86] truncateVectorCompareWithPACKSS - remove duplicate variables. NFCI.
Simon Pilgrim [Tue, 24 Oct 2017 14:18:32 +0000 (14:18 +0000)]
[X86] truncateVectorCompareWithPACKSS - remove duplicate variables. NFCI.

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

7 years agoUpdate f16c instruction scheduling on btver2.
Andrew V. Tischenko [Tue, 24 Oct 2017 13:38:30 +0000 (13:38 +0000)]
Update f16c instruction scheduling on btver2.
Differential Revision: https://reviews.llvm.org/D39051

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

7 years agoX86CallFrameOptimization: Update comments and variable names. NFCI.
Zvi Rackover [Tue, 24 Oct 2017 13:24:26 +0000 (13:24 +0000)]
X86CallFrameOptimization: Update comments and variable names. NFCI.

Following up on D38738.

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

7 years agoX86CallFrameOptimization: Recognize 'store 0/-1 using and/or' idioms
Zvi Rackover [Tue, 24 Oct 2017 12:13:05 +0000 (12:13 +0000)]
X86CallFrameOptimization: Recognize 'store 0/-1 using and/or' idioms

Summary:
r264440 added or/and patterns for storing -1 or 0 with the intention of decreasing code size. However,
X86CallFrameOptimization does not recognize these memory accesses so it will not replace them with push's when profitable.

This patch fixes this problem by teaching X86CallFrameOptimization these store 0/-1 idioms.

An alternative fix would be to prevent the 'store 0/1 idioms' patterns from firing when accessing the stack. This would save
the need to teach the pass about these idioms. However, because X86CallFrameOptimization does not always fire we may result
in cases where neither X86CallFrameOptimization not the patterns for 'store 0/1 idioms' fire.

Fixes pr34863

Reviewers: DavidKreitzer, guyblank, aymanmus

Reviewed By: aymanmus

Subscribers: llvm-commits

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

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

7 years ago[ConstantFolding] Avoid assert when folding ptrtoint of vectorized GEP
Bjorn Pettersson [Tue, 24 Oct 2017 12:08:11 +0000 (12:08 +0000)]
[ConstantFolding] Avoid assert when folding ptrtoint of vectorized GEP

Summary:
Got asserts in llvm::CastInst::getCastOpcode saying:
`DestBits == SrcBits && "Illegal cast to vector (wrong type or size)"' failed.

Problem seemed to be that llvm::ConstantFoldCastInstruction did
not handle ptrtoint cast of a getelementptr returning a vector
correctly. I assume such situations are quite rare, since the
GEP needs to be considered as a constant value (base pointer
being null).
The solution used here is to simply avoid the constant fold
of ptrtoint when the value is a vector. It is not supported,
and by bailing out we do not fail on assertions later on.

Reviewers: craig.topper, majnemer, davide, filcab, efriedma

Reviewed By: efriedma

Subscribers: efriedma, filcab, llvm-commits

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

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

7 years ago[LangRef] Update description of Constant Expressions
Bjorn Pettersson [Tue, 24 Oct 2017 11:59:20 +0000 (11:59 +0000)]
[LangRef] Update description of Constant Expressions

Summary:
When describing trunc/zext/sext/ptrtoint/inttoptr in the chapter
about Constant Expressions we now simply refer to the Instruction
Reference. As far as I know there are no difference when it comes
to the semantics and the argument constraints. The only difference
is that the syntax is slighly different for the constant expressions,
regarding the use of parenthesis in constant expressions.
Referring to the Instruction Reference is the same solution as
already used for several other operations, such as bitcast.

The main goal was to add information that vector types are allowed
also in trunc/zext/sext/ptrtoint/inttoptr constant expressions.
That was not explicitly mentioned earlier, and resulted in some
questions in the review of https://reviews.llvm.org/D38546

Reviewers: efriedma, majnemer

Reviewed By: efriedma

Subscribers: llvm-commits

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

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

7 years ago[llvm-dwarfdump] - Cleanup of gnu_call_site.s. NFC.
George Rimar [Tue, 24 Oct 2017 11:44:19 +0000 (11:44 +0000)]
[llvm-dwarfdump] - Cleanup of gnu_call_site.s. NFC.

This change fixes values of test so that it passes
-verify without errors and also adds comments.
Test was introduced in D39119 and intention was to check
that tool is able to dump few
DW_*GNU_call_site* tags and attributes, so that
change is NFC cleanup.

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

7 years agoAMDGPU: Add new intrinsic llvm.amdgcn.kill(i1)
Marek Olsak [Tue, 24 Oct 2017 10:27:13 +0000 (10:27 +0000)]
AMDGPU: Add new intrinsic llvm.amdgcn.kill(i1)

Summary:
Kill the thread if operand 0 == false.
llvm.amdgcn.wqm.vote can be applied to the operand.

Also allow kill in all shader stages.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

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

7 years agoAMDGPU: Add llvm.amdgcn.wqm.vote intrinsic
Marek Olsak [Tue, 24 Oct 2017 10:26:59 +0000 (10:26 +0000)]
AMDGPU: Add llvm.amdgcn.wqm.vote intrinsic

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye

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

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

7 years ago[docs] Code example fix
Jan Korous [Tue, 24 Oct 2017 10:23:10 +0000 (10:23 +0000)]
[docs] Code example fix

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

7 years ago[ARM] Replace development diagnostics with normal DEBUG macro
Oliver Stannard [Tue, 24 Oct 2017 09:46:56 +0000 (09:46 +0000)]
[ARM] Replace development diagnostics with normal DEBUG macro

* Remove the -arm-asm-parser-dev-diags option.
* Use normal DEBUG(dbgs()) printing for the extra development information about
  missing diagnostics.

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

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

7 years agoRestore the fix rL316059 eliminated by rL316372
Serguei Katkov [Tue, 24 Oct 2017 09:42:55 +0000 (09:42 +0000)]
Restore the fix rL316059 eliminated by rL316372

rL316059 fixed the potential build failure when compiling
with -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON.

rL316372 just reverted the part of the fix, so restore it.

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

7 years ago[ARM] tSETEND needs IsThumb
Oliver Stannard [Tue, 24 Oct 2017 09:03:33 +0000 (09:03 +0000)]
[ARM] tSETEND needs IsThumb

This is the Thumb encoding, so the Requires list must include IsThumb.

No test because we happen to select the ARM one first, but that's just luck.

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

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

7 years ago[ARM] Remove tCPS alias which just crashed
Oliver Stannard [Tue, 24 Oct 2017 08:55:36 +0000 (08:55 +0000)]
[ARM] Remove tCPS alias which just crashed

This alias caused a crash when trying to print the "cps #0" instruction in a
diagnostic for thumbv6 (which doesn't have that instruction).

The comment was incorrect, this instruction is UNPREDICTABLE if no flag bits
are set, so I don't think it's worth keeping.

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

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

7 years agoSupport formatv of TimePoint with strftime-style formats.
Sam McCall [Tue, 24 Oct 2017 08:30:19 +0000 (08:30 +0000)]
Support formatv of TimePoint with strftime-style formats.

Summary:
Support formatv of TimePoint with strftime-style formats.

Extensions for millis/micros/nanos are added.
Inital use case is HH:MM:SS.MMM timestamps in clangd logs.

Reviewers: bkramer, ilya-biryukov

Subscribers: labath, llvm-commits

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

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

7 years ago[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)
Clement Courbet [Tue, 24 Oct 2017 08:05:07 +0000 (08:05 +0000)]
[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)

Refactor ExpandMemcmp:

 - Stop duplicating the logic for computation of the sequence of loads to
   generate (thsi was done in three different places), this is now done
   only once in MemCmpExpansion::MemCmpExpansion().

 - Add a FIXME to expose a bug with the computation of the number of loads
   when not all sizes are loadable. For example, on X86-32 + SSE, possible
   loads are {16,4,2,1} bytes. The current code considers that all loads
   starting at MaxLoadSize are possible. This is not an issue right now as
   vector loads are not enabled, so I'm not fixing the issue here to keep
   the change as small as possible. I'm going to address this in a
   subsequent revision, where I enable vector loads.

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

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

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

7 years agoX86: Fix X86CallFrameOptimization to search for the COPY StackPointer
Zvi Rackover [Tue, 24 Oct 2017 07:38:29 +0000 (07:38 +0000)]
X86: Fix X86CallFrameOptimization to search for the COPY StackPointer

SelectionDAG inserts a copy of ESP into a virtual register.
X86CallFrameOptimization assumed that the COPY, if present, is always
right after the call-frame setup instruction (ADJCALLSTACKDOWN). This was a
wrong assumption as the COPY can be located anywhere between the call-frame setup
instruction and its first use. If the COPY happened to be located in a different
location than what X86CallFrameOptimization assumed, visiting it while
processing the call chain would lead to a conservative bail-out.

The fix is quite straightfoward, scan ahead for the stack-pointer copy and make note
of it so it can be ignored while processing the call chain.

Fixes pr34903

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

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

7 years ago[Modules] Add module for Config/llvm-config.h
Bruno Cardoso Lopes [Tue, 24 Oct 2017 06:18:52 +0000 (06:18 +0000)]
[Modules] Add module for Config/llvm-config.h

Besides all the goodness from modularizing a header, this is necessary
to compile ToT with modules with the clang host compiler from Xcode 9 in
macOS 10.13, which our bots don't use yet.

rdar://problem/35038151

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

7 years ago[MC] Adding code padding for performance stability - infrastructure. NFC.
Omer Paparo Bivas [Tue, 24 Oct 2017 06:16:03 +0000 (06:16 +0000)]
[MC] Adding code padding for performance stability - infrastructure. NFC.

Infrastructure designed for padding code with nop instructions in key places such that preformance improvement will be achieved.
The infrastructure is implemented such that the padding is done in the Assembler after the layout is done and all IPs and alignments are known.
This patch by itself in a NFC. Future patches will make use of this infrastructure to implement required policies for code padding.

Reviewers:
aaboud
zvi
craig.topper
gadi.haber

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

Change-Id: I92110d0c0a757080a8405636914a93ef6f8ad00e

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

7 years agoX86: Register the X86CallFrameOptimization pass
Zvi Rackover [Tue, 24 Oct 2017 05:47:07 +0000 (05:47 +0000)]
X86: Register the X86CallFrameOptimization pass

Summary:
The motivation of this change is to enable .mir testing for this pass.
Added one test case to cover the functionality, this same case will be improved by
a future patch.

Reviewers: igorb, guyblank, DavidKreitzer

Reviewed By: guyblank, DavidKreitzer

Subscribers: llvm-commits

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

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

7 years ago[globalisel][tablegen] Remove unused InstructionMatcher's. NFC
Daniel Sanders [Tue, 24 Oct 2017 01:48:34 +0000 (01:48 +0000)]
[globalisel][tablegen] Remove unused InstructionMatcher's. NFC

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

7 years ago[raw_fd_ostream] report actual error in error messages
Bob Haarman [Tue, 24 Oct 2017 01:26:22 +0000 (01:26 +0000)]
[raw_fd_ostream] report actual error in error messages

Summary:
Previously, we would emit error messages like "IO failure on output
stream". This change causes use to include information about what
actually went wrong, e.g. "No space left on device".

Reviewers: sunfish, rnk

Reviewed By: rnk

Subscribers: mehdi_amini, llvm-commits, hiraditya

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

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

7 years agoObjCARC: do not increment past the end of the BB
Saleem Abdulrasool [Tue, 24 Oct 2017 00:09:10 +0000 (00:09 +0000)]
ObjCARC: do not increment past the end of the BB

The `BasicBlock::getFirstInsertionPt` call may return `std::end` for the
BB.  Dereferencing the end iterator results in an assertion failure
"(!NodePtr->isKnownSentinel()), function operator*".  Ensure that the
returned iterator is valid before dereferencing it.  If the end is
returned, move one position backward to get a valid insertion point.

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

7 years ago[codeview] Add support for inlinee lists
Reid Kleckner [Mon, 23 Oct 2017 23:43:40 +0000 (23:43 +0000)]
[codeview] Add support for inlinee lists

This adds type index discovery and dumper support for symbol record kind
0x1168, which is a list of inlined function ids. This symbol kind is
undocumented, but S_INLINEES is consistent with the existing
nomenclature.

Fixes PR34222

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

7 years ago[PM] Fix Typo
Justin Lebar [Mon, 23 Oct 2017 23:42:05 +0000 (23:42 +0000)]
[PM] Fix Typo

Patch by Nick Sarnie.

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

7 years ago[MachineOutliner] Add optimisation remarks for successful outlining
Jessica Paquette [Mon, 23 Oct 2017 23:36:46 +0000 (23:36 +0000)]
[MachineOutliner] Add optimisation remarks for successful outlining

This commit adds optimisation remarks for outlining which fire when a function
is successfully outlined.

To do this, OutlinedFunctions must now contain references to their Candidates.
Since the Candidates must still be sorted and worked on separately, this is
done by working on everything in terms of shared_ptrs to Candidates. This is
good; it means that we can easily move everything to outlining in terms of
the OutlinedFunctions rather than the individual Candidates. This is far more
intuitive than what's currently there!

(Remarks are output when a function is created for some group of Candidates.
In a later commit, all of the outlining logic should be rewritten so that we
loop over OutlinedFunctions rather than over Candidates.)

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

7 years agoAMDGPU: Initialize WavefrontSize from TD files
Konstantin Zhuravlyov [Mon, 23 Oct 2017 23:02:39 +0000 (23:02 +0000)]
AMDGPU: Initialize WavefrontSize from TD files

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

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

7 years ago[GISel][ARM]: Fix illegal Generic copies in tests
Aditya Nandakumar [Mon, 23 Oct 2017 22:53:08 +0000 (22:53 +0000)]
[GISel][ARM]: Fix illegal Generic copies in tests

This is in preparation for a verifier check that makes sure
copies are of the same size (when generic virtual registers are involved).

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

7 years ago[GISel][AArch64]: Fix illegal Generic copies in tests
Aditya Nandakumar [Mon, 23 Oct 2017 22:53:04 +0000 (22:53 +0000)]
[GISel][AArch64]: Fix illegal Generic copies in tests

This is in preparation for a verifier check that makes sure copies are
of the same size (when generic virtual registers are involved).

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

7 years ago[codeview] Recognize two records with no type index fields
Reid Kleckner [Mon, 23 Oct 2017 22:44:24 +0000 (22:44 +0000)]
[codeview] Recognize two records with no type index fields

Thunk records do not have types and frame cookies do not have types.

These were found while linking libconcrt.lib from MSVC.

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

7 years ago[PM] Add pgo-memop-opt pass to the new pass manager
Rong Xu [Mon, 23 Oct 2017 22:21:29 +0000 (22:21 +0000)]
[PM] Add pgo-memop-opt pass to the new pass manager

This pass adds pgo-memop-opt pass to the new pass manager.
It is in the old pass manager but somehow left out in the new pass manager.

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

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

7 years ago[X86][SSE] combineBitcastvxi1 - use PACKSSWB directly to pack v8i16 to v16i8
Simon Pilgrim [Mon, 23 Oct 2017 22:05:02 +0000 (22:05 +0000)]
[X86][SSE] combineBitcastvxi1 - use PACKSSWB directly to pack v8i16 to v16i8

Avoid difficulties determining the number of sign bits later on in shuffle lowering to lower to PACKSS

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

7 years agoAdd a new Simulator entry for the target triple environment.
Bob Wilson [Mon, 23 Oct 2017 21:51:50 +0000 (21:51 +0000)]
Add a new Simulator entry for the target triple environment.

Apple's iOS, tvOS and watchOS simulator platforms have never been clearly
distinguished in the target triples. Even though they are intended to
behave similarly to the corresponding device platforms, they have separate
SDKs and are really separate platforms from the compiler's perspective.
Clang now defines a macro when building for one of these simulator platforms
(r297866) but that relies on the very indirect mechanism of checking to see
which option was used to specify the minimum deployment target. That is not
so great. Swift would also like to distinguish these simulator platforms in
a similar way, but unlike Clang, Swift does not use a separate option to
specify the minimum deployment target -- it uses a -target option to
specify the target triple directly, including the OS version number.
Using a different target triple for the simulator platforms is a much
more direct and obvious way to specify this. Putting the "simulator" in
the environment component of the triple means the OS values can stay the
same and existing code the looks at the OS field will not be affected.

https://reviews.llvm.org/D39143
rdar://problem/34729432

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

7 years agoFix buildbot breakage
George Burgess IV [Mon, 23 Oct 2017 21:08:02 +0000 (21:08 +0000)]
Fix buildbot breakage

SP is only used in an assert. Caused by r316374.

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

7 years agoMade llvm-cfi-verify not execute unit tests on non-x86 builds.
Mitch Phillips [Mon, 23 Oct 2017 20:54:01 +0000 (20:54 +0000)]
Made llvm-cfi-verify not execute unit tests on non-x86 builds.

Patched out from D38427.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: llvm-commits, kcc, pcc, mgorny

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

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

7 years agoDon't crash when we see unallocatable registers in clobbers
George Burgess IV [Mon, 23 Oct 2017 20:46:36 +0000 (20:46 +0000)]
Don't crash when we see unallocatable registers in clobbers

This fixes a bug where we'd crash given code like the test-case from
https://bugs.llvm.org/show_bug.cgi?id=30792 . Instead, we let the
offending clobber silently slide through.

This doesn't fully fix said bug, since the assembler will still complain
the moment it sees a crypto/fp/vector op, and we still don't diagnose
calls that require vector regs.

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

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

7 years agoGraph builder implementation.
Mitch Phillips [Mon, 23 Oct 2017 20:25:19 +0000 (20:25 +0000)]
Graph builder implementation.

Implement a localised graph builder for indirect control flow
instructions. Main interface is through GraphBuilder::buildFlowGraph,
which will build a flow graph around an indirect CF instruction. Various
modifications to FileVerifier are also made to const-expose some members
needed for machine code analysis done by the graph builder.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: llvm-commits, kcc, pcc

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

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

7 years agoRevert "[PowerPC] Try to simplify a Swap if it feeds a Splat"
Stefan Pintilie [Mon, 23 Oct 2017 20:22:23 +0000 (20:22 +0000)]
Revert "[PowerPC] Try to simplify a Swap if it feeds a Splat"

Revert commit r316366.
Previous commit causes p8-scalar_vector_conversions.ll to fail.

This reverts commit 990e764ad8a2eec206ce5dda6aefab059ccd4e92.

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

7 years ago[GVNSink] Fix failing GVNSink tests in the reverse iteration bot
Mandeep Singh Grang [Mon, 23 Oct 2017 19:56:52 +0000 (19:56 +0000)]
[GVNSink] Fix failing GVNSink tests in the reverse iteration bot

Summary:

The elts of ActivePreds which is defined as a SmallPtrSet are copied
into Blocks using std::copy. This makes the resultant order of Blocks
non-deterministic. We cannot simply sort Blocks as they need to match
the corresponding Values. So a better approach is to define ActivePreds
as SmallSetVector.

This fixes the following failures in
http://lab.llvm.org:8011/builders/reverse-iteration:
  LLVM :: Transforms/GVNSink/indirect-call.ll
  LLVM :: Transforms/GVNSink/sink-common-code.ll
  LLVM :: Transforms/GVNSink/struct.ll

Reviewers: dberlin, jmolloy, bkramer, efriedma

Reviewed By: dberlin

Subscribers: llvm-commits

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

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

7 years ago[Hexagon] Return the correct chain edge for i1 function calls
Krzysztof Parzyszek [Mon, 23 Oct 2017 19:35:25 +0000 (19:35 +0000)]
[Hexagon] Return the correct chain edge for i1 function calls

In HexagonISelLowering, there is code to handle the case when
a function returns an i1 type. In this case, we need to generate
extra nodes to copy the result from R0 to a predicate register.

The code was returning the wrong value for the chain edge which
caused an assert "Wrong topological sorting" when converting the
instructions to MIs.

This patch fixes the problem by returning the chain for the final
copy.

Patch by Brendon Cahoon.

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

7 years ago[PowerPC] Try to simplify a Swap if it feeds a Splat
Stefan Pintilie [Mon, 23 Oct 2017 19:33:31 +0000 (19:33 +0000)]
[PowerPC] Try to simplify a Swap if it feeds a Splat

If we have the situation where a Swap feeds a Splat we can sometimes change the
index on the Splat and then remove the Swap instruction.

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

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

7 years ago[Hexagon] Add extra pattern for S4_addaddi
Krzysztof Parzyszek [Mon, 23 Oct 2017 19:07:50 +0000 (19:07 +0000)]
[Hexagon] Add extra pattern for S4_addaddi

One combination was missing: add(add(x,y),c).

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

7 years agoFix FormatVariadicTest with GCC
Jonas Hahnfeld [Mon, 23 Oct 2017 18:41:22 +0000 (18:41 +0000)]
Fix FormatVariadicTest with GCC

Looks like GCC didn't like the original specialization, try within namespace.

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

7 years ago[globalisel][tablegen] Import stores and allow GISel to automatically substitute...
Daniel Sanders [Mon, 23 Oct 2017 18:19:24 +0000 (18:19 +0000)]
[globalisel][tablegen] Import stores and allow GISel to automatically substitute zero regs like WZR/XZR/$zero.

This patch enables the import of stores. Unfortunately, doing so by itself,
loses an optimization where storing 0 to memory makes use of WZR/XZR.

To mitigate this, this patch also introduces a new feature that allows register
operands to nominate a zero register. When this is done, GlobalISel will
substitute (G_CONSTANT 0) with the nominated register automatically. This
is currently configured to only apply to the stores.

Applying it to GPR32/GPR64 register classes in general will be done after
review see (https://reviews.llvm.org/D39150).

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

7 years agoAccidently merged an incomplete upstream patch in 10e6ee563a6b5ca498f27972ca6dbe6c308...
Mitch Phillips [Mon, 23 Oct 2017 18:17:56 +0000 (18:17 +0000)]
Accidently merged an incomplete upstream patch in 10e6ee563a6b5ca498f27972ca6dbe6c308f1ac2 - reverting the changes.

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

7 years agoPatch in
Mitch Phillips [Mon, 23 Oct 2017 18:11:31 +0000 (18:11 +0000)]
Patch in

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

7 years ago[wasm] readSection: Avoid reading past eof (fixes oss-fuzz #3219)
Vedant Kumar [Mon, 23 Oct 2017 18:04:34 +0000 (18:04 +0000)]
[wasm] readSection: Avoid reading past eof (fixes oss-fuzz #3219)

A wasm file crafted with a bogus section size can trigger an ASan issue
in the DWARFObjInMemory constructor. Nip the problem in the bud when we
read the wasm section.

Found by OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3219

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

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

7 years ago[X86][SSE] Regenerate PACKSS tests on 32 + 64-bit targets
Simon Pilgrim [Mon, 23 Oct 2017 17:50:40 +0000 (17:50 +0000)]
[X86][SSE] Regenerate PACKSS tests on 32 + 64-bit targets

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

7 years agoUpdated 'Getting Started' to use valid git links (added trailing slashes)
Mitch Phillips [Mon, 23 Oct 2017 17:37:41 +0000 (17:37 +0000)]
Updated 'Getting Started' to use valid git links (added trailing slashes)

Reviewers: pcc, asl, tonic

Reviewed By: pcc

Subscribers: llvm-commits, kcc

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

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

7 years ago[PassManager] add test to show the new PM uses -latesimplifycfg early; NFC
Sanjay Patel [Mon, 23 Oct 2017 17:30:17 +0000 (17:30 +0000)]
[PassManager] add test to show the new PM uses -latesimplifycfg early; NFC

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

7 years ago[globalisel] Add very brief docs summarizing the ISel part of the LLVMDev tutorial.
Daniel Sanders [Mon, 23 Oct 2017 17:18:44 +0000 (17:18 +0000)]
[globalisel] Add very brief docs summarizing the ISel part of the LLVMDev tutorial.

Also added links to the talks available.

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

7 years agoAMDGPU: Cleanup local atomic node names
Matt Arsenault [Mon, 23 Oct 2017 17:16:43 +0000 (17:16 +0000)]
AMDGPU: Cleanup local atomic node names

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

7 years agoAMDGPU: Fix default range in non-kernel functions
Matt Arsenault [Mon, 23 Oct 2017 17:09:35 +0000 (17:09 +0000)]
AMDGPU: Fix default range in non-kernel functions

The range should be assumed to be the hardware maximum
if a workitem intrinsic is used in a callable function
which does not know the restricted limit of the calling
kernel.

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

7 years ago[X86] Fix disassembler table generation to prevent instructions tagged with 'PS'...
Craig Topper [Mon, 23 Oct 2017 16:49:26 +0000 (16:49 +0000)]
[X86] Fix disassembler table generation to prevent instructions tagged with 'PS' being inherited into PD/XS/XD attribute entries.

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

7 years ago[MachineOutliner] NFC: Rename getters/setters to fit coding style
Jessica Paquette [Mon, 23 Oct 2017 16:25:53 +0000 (16:25 +0000)]
[MachineOutliner] NFC: Rename getters/setters to fit coding style

Rename endIdx, startIdx, and length to getEndIdx, getStartIdx, and getLength
in Candidate.

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

7 years ago[X86] Change VMPTRST to use PS instead of TB to match VMPTRLD.
Craig Topper [Mon, 23 Oct 2017 16:22:40 +0000 (16:22 +0000)]
[X86] Change VMPTRST to use PS instead of TB to match VMPTRLD.

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

7 years ago[X86] Change RDRAND to use PS instead of TB.
Craig Topper [Mon, 23 Oct 2017 16:22:38 +0000 (16:22 +0000)]
[X86] Change RDRAND to use PS instead of TB.

Should be no functional change for now. A future disassembler change will prevent disassembling with 0xf2/0xf3.

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

7 years ago[X86] Change XRSTOR to use PS instead of TB to match XSAVE.
Craig Topper [Mon, 23 Oct 2017 16:11:33 +0000 (16:11 +0000)]
[X86] Change XRSTOR to use PS instead of TB to match XSAVE.

I don't think this changes anything functionally yet, but I plan to fix the disassembler to use this to disable matching certain instructions with 0xf3/0xf2/0x66 prefixes.

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

7 years ago[X86][SSE] Remove AssertZext stage from PEXTRW/PEXTRB lowering. NFCI.
Simon Pilgrim [Mon, 23 Oct 2017 16:00:57 +0000 (16:00 +0000)]
[X86][SSE] Remove AssertZext stage from PEXTRW/PEXTRB lowering. NFCI.

Remove AssertZext and instead add PEXTRW/PEXTRB support to computeKnownBitsForTargetNode to simplify instruction selection.

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

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

7 years agoUpdate DPPD/DPPS instruction scheduling on btver2.
Andrew V. Tischenko [Mon, 23 Oct 2017 15:53:30 +0000 (15:53 +0000)]
Update DPPD/DPPS instruction scheduling on btver2.
Differential Revision: https://reviews.llvm.org/D39046

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

7 years ago[X86] Add PTWRITE instruction for assembler and disassembler.
Craig Topper [Mon, 23 Oct 2017 15:53:21 +0000 (15:53 +0000)]
[X86] Add PTWRITE instruction for assembler and disassembler.

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

7 years ago[X86] Add RDPID instruction for assembler and disassembler.
Craig Topper [Mon, 23 Oct 2017 15:53:16 +0000 (15:53 +0000)]
[X86] Add RDPID instruction for assembler and disassembler.

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

7 years ago[DAGCombine] Permit combining of shuffles of equivalent splat BUILD_VECTORs
Simon Pilgrim [Mon, 23 Oct 2017 15:48:08 +0000 (15:48 +0000)]
[DAGCombine] Permit combining of shuffles of equivalent splat BUILD_VECTORs

combineShuffleOfScalars is very conservative about shuffled BUILD_VECTORs that can be combined together.

This patch adds one additional case - if both BUILD_VECTORs represent splats of the same scalar value but with different UNDEF elements, then we should create a single splat BUILD_VECTOR, sharing only the UNDEF elements defined by the shuffle mask.

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

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

7 years agoSupport formatting formatv_objects.
Sam McCall [Mon, 23 Oct 2017 15:40:44 +0000 (15:40 +0000)]
Support formatting formatv_objects.

Summary:
Support formatting formatv_objects.

While here, fix documentation about member-formatters, and attempted
perfect-forwarding (I think).

Reviewers: zturner

Subscribers: llvm-commits

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

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

7 years ago[X86][SSE] Regenerate bitcast-and-setcc tests
Simon Pilgrim [Mon, 23 Oct 2017 14:47:49 +0000 (14:47 +0000)]
[X86][SSE] Regenerate bitcast-and-setcc tests

Avoid the retl/retq changes in an upcoming patch

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

7 years ago[X86][AVX2] Regenerate AVX2 intrinsics tests on 32 + 64-bit targets
Simon Pilgrim [Mon, 23 Oct 2017 14:19:46 +0000 (14:19 +0000)]
[X86][AVX2] Regenerate AVX2 intrinsics tests on 32 + 64-bit targets

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

7 years ago[X86][AVX] Regenerate AVX intrinsics tests on 32 + 64-bit targets
Simon Pilgrim [Mon, 23 Oct 2017 14:17:59 +0000 (14:17 +0000)]
[X86][AVX] Regenerate AVX intrinsics tests on 32 + 64-bit targets

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

7 years ago[X86][F16C] Regenerate F16C schedule tests
Simon Pilgrim [Mon, 23 Oct 2017 14:15:24 +0000 (14:15 +0000)]
[X86][F16C] Regenerate F16C schedule tests

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

7 years agoTest commit.
Artur Gainullin [Mon, 23 Oct 2017 13:25:49 +0000 (13:25 +0000)]
Test commit.

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

7 years ago[llvm-dwarfdump] - Teach tool about few GNU call_sites constants.
George Rimar [Mon, 23 Oct 2017 11:24:14 +0000 (11:24 +0000)]
[llvm-dwarfdump] - Teach tool about few GNU call_sites constants.

This teaches tool about following consants:
DW_TAG_GNU_call_site,
DW_TAG_GNU_call_site_parameter,
DW_AT_GNU_call_site_value,
DW_AT_GNU_all_call_sites.

Constants documented here: https://sourceware.org/elfutils/DwarfExtensions

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

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

7 years ago[X86] Add test for opportunity to use bzhi X86 instruction instead of load+and instru...
Ayman Musa [Mon, 23 Oct 2017 10:24:19 +0000 (10:24 +0000)]
[X86] Add test for opportunity to use bzhi X86 instruction instead of load+and instructions.

Transformation uploaded for CR in https://reviews.llvm.org/D34141.

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

7 years agoFix for Bug 30718 - Failure to disassemble certain MOV with rex.R. The issue was...
Andrew V. Tischenko [Mon, 23 Oct 2017 09:36:33 +0000 (09:36 +0000)]
Fix for Bug 30718 - Failure to disassemble certain MOV with rex.R. The issue was in illegal segment register index.
Differential Revision: https://reviews.llvm.org/D38786

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

7 years ago[COFF] Improve the check for functions that should get an extra underscore
Martin Storsjo [Mon, 23 Oct 2017 09:08:13 +0000 (09:08 +0000)]
[COFF] Improve the check for functions that should get an extra underscore

This fixes exporting functions starting with an underscore, and
fully decorated fastcall/vectorcall functions.

Tests will be added in the lld repo.

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

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

7 years agoFix a -Wpedantic warning.
Haojian Wu [Mon, 23 Oct 2017 09:02:59 +0000 (09:02 +0000)]
Fix a -Wpedantic warning.

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

7 years ago[ARM] Allow unrolling of multi-block loops.
Sam Parker [Mon, 23 Oct 2017 08:05:14 +0000 (08:05 +0000)]
[ARM] Allow unrolling of multi-block loops.

Before, loop unrolling was only enabled for loops with a single
block. This restriction has been removed and replaced by:
- allow a maximum of two exiting blocks,
- a four basic block limit for cores with a branch predictor.

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

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

7 years ago[X86] Update a doxygen comment in the disassembler tablegen code. NFC
Craig Topper [Mon, 23 Oct 2017 03:42:35 +0000 (03:42 +0000)]
[X86] Update a doxygen comment in the disassembler tablegen code. NFC

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

7 years ago[X86] Fix disassembly of EVEX rounding control and SAE instructions.
Craig Topper [Mon, 23 Oct 2017 02:26:24 +0000 (02:26 +0000)]
[X86] Fix disassembly of EVEX rounding control and SAE instructions.

Fixes PR31955.

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

7 years agoExecutionEngine: make COFF Thumb2 assertions non-tautological
Saleem Abdulrasool [Sun, 22 Oct 2017 20:51:25 +0000 (20:51 +0000)]
ExecutionEngine: make COFF Thumb2 assertions non-tautological

The overflow detection assertions were tautological due to truncation.
Adjust them to no longer be tautological.

Patch by Alex Langford!

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

7 years agoFix invalid ptrtoint in InstCombine
Yichao Yu [Sun, 22 Oct 2017 20:28:17 +0000 (20:28 +0000)]
Fix invalid ptrtoint in InstCombine

Summary:
It's unclear if this is the only thing we can do but at least this is consistent with the check
of address space agreement in `isBitCastable`.

The code is used at least in both instcombine and jumpthreading though
I could only find a way to trigger the invalid cast in instcombine.

Reviewers: loladiro, sanjoy, majnemer

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

7 years agoCreate fewer copies of StringMaps. No functionality change intended.
Benjamin Kramer [Sun, 22 Oct 2017 20:16:28 +0000 (20:16 +0000)]
Create fewer copies of StringMaps. No functionality change intended.

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

7 years ago[X86] Add missing override. NFC.
Benjamin Kramer [Sun, 22 Oct 2017 19:16:31 +0000 (19:16 +0000)]
[X86] Add missing override. NFC.

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

7 years ago[SimplifyCFG] delay switch condition forwarding to -latesimplifycfg
Sanjay Patel [Sun, 22 Oct 2017 19:10:07 +0000 (19:10 +0000)]
[SimplifyCFG] delay switch condition forwarding to -latesimplifycfg

As discussed in D39011:
https://reviews.llvm.org/D39011
...replacing constants with a variable is inverting the transform done
by other IR passes, so we definitely don't want to do this early.
In fact, it's questionable whether this transform belongs in SimplifyCFG
at all. I'll look at moving this to codegen as a follow-up step.

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

7 years ago[utils] Support -mtriple=powerpc64
Fangrui Song [Sun, 22 Oct 2017 18:43:23 +0000 (18:43 +0000)]
[utils] Support -mtriple=powerpc64

Summary: test/CodeGen/PowerPC/pr33093.ll uses both powerpc64 (big-endian) and powerpc64le while the former was unsupported.

Subscribers: nemanjai

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

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

7 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Sun, 22 Oct 2017 18:38:57 +0000 (18:38 +0000)]
Strip trailing whitespace. NFCI.

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

7 years agoAdd logic to greedy reg alloc to avoid bad eviction chains
Marina Yatsina [Sun, 22 Oct 2017 17:59:38 +0000 (17:59 +0000)]
Add logic to greedy reg alloc to avoid bad eviction chains

This fixes bugzilla 26810
https://bugs.llvm.org/show_bug.cgi?id=26810

This is intended to prevent sequences like:
movl %ebp, 8(%esp) # 4-byte Spill
movl %ecx, %ebp
movl %ebx, %ecx
movl %edi, %ebx
movl %edx, %edi
cltd
idivl %esi
movl %edi, %edx
movl %ebx, %edi
movl %ecx, %ebx
movl %ebp, %ecx
movl 16(%esp), %ebp # 4 - byte Reload

Such sequences are created in 2 scenarios:

Scenario #1:
vreg0 is evicted from physreg0 by vreg1
Evictee vreg0 is intended for region splitting with split candidate physreg0 (the reg vreg0 was evicted from)
Region splitting creates a local interval because of interference with the evictor vreg1 (normally region spliiting creates 2 interval, the "by reg" and "by stack" intervals. Local interval created when interference occurs.)
one of the split intervals ends up evicting vreg2 from physreg1
Evictee vreg2 is intended for region splitting with split candidate physreg1
one of the split intervals ends up evicting vreg3 from physreg2 etc.. until someone spills

Scenario #2
vreg0 is evicted from physreg0 by vreg1
vreg2 is evicted from physreg2 by vreg3 etc
Evictee vreg0 is intended for region splitting with split candidate physreg1
Region splitting creates a local interval because of interference with the evictor vreg1
one of the split intervals ends up evicting back original evictor vreg1 from physreg0 (the reg vreg0 was evicted from)
Another evictee vreg2 is intended for region splitting with split candidate physreg1
one of the split intervals ends up evicting vreg3 from physreg2 etc.. until someone spills

As compile time was a concern, I've added a flag to control weather we do cost calculations for local intervals we expect to be created (it's on by default for X86 target, off for the rest).

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

Change-Id: Id9411ff7bbb845463d289ba2ae97737a1ee7cc39

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

7 years ago[X86] More correctly support LIG and WIG for EVEX instructions in the disassembler...
Craig Topper [Sun, 22 Oct 2017 17:22:29 +0000 (17:22 +0000)]
[X86] More correctly support LIG and WIG for EVEX instructions in the disassembler tables.

This is similar to how we generate the VEX tables.

More fixes are still needed for the instructions that use EVEX.b (broadcast and embedded rounding).

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

7 years ago[SimplifyCFG] try harder to forward switch condition to phi (PR34471)
Sanjay Patel [Sun, 22 Oct 2017 16:51:03 +0000 (16:51 +0000)]
[SimplifyCFG] try harder to forward switch condition to phi (PR34471)

The missed canonicalization/optimization in the motivating test from PR34471 leads to very different codegen:

  int switcher(int x) {
      switch(x) {
      case 17: return 17;
      case 19: return 19;
      case 42: return 42;
      default: break;
      }
      return 0;
    }

  int comparator(int x) {
    if (x == 17) return 17;
    if (x == 19) return 19;
    if (x == 42) return 42;
    return 0;
  }

For the first example, we use a bit-test optimization to avoid a series of compare-and-branch:
https://godbolt.org/g/BivDsw

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

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

7 years ago[ARM] Dynamic stack alignment for 16-bit Thumb
Momchil Velikov [Sun, 22 Oct 2017 11:56:35 +0000 (11:56 +0000)]
[ARM] Dynamic stack alignment for 16-bit Thumb

This patch implements dynamic stack (re-)alignment for 16-bit Thumb. When
targeting processors, which support only the 16-bit Thumb instruction set
the compiler ignores the alignment attributes of automatic variables and may
silently generate incorrect code.

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

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

7 years ago[X86] Add a pass to convert instruction chains between domains.
Guy Blank [Sun, 22 Oct 2017 11:43:08 +0000 (11:43 +0000)]
[X86] Add a pass to convert instruction chains between domains.

The pass scans the function to find instruction chains that define
registers in the same domain (closures).
It then calculates the cost of converting the closure to another domain.
If found profitable, the instructions are converted to instructions in
the other domain and the register classes are changed accordingly.

This commit adds the pass infrastructure and a simple conversion from
the GPR domain to the Mask domain.

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

Change-Id: Ic2cf1d76598110401168326d411128ae2580a604

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

7 years ago[mips] Adds support for R_MIPS_26, HIGHER, HIGHEST relocations in RuntimeDyld.
Nitesh Jain [Sun, 22 Oct 2017 09:47:41 +0000 (09:47 +0000)]
[mips] Adds support for R_MIPS_26, HIGHER, HIGHEST relocations in RuntimeDyld.

Reviewers: sdardis

Subscribers: jaydeep, bhushan, llvm-commits

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

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

7 years ago[X86] Teach the disassembler that some instructions use VEX.W==0 without a correspond...
Craig Topper [Sun, 22 Oct 2017 06:18:26 +0000 (06:18 +0000)]
[X86] Teach the disassembler that some instructions use VEX.W==0 without a corresponding VEX.W==1 instruction and we shouldn't treat them as if VEX.W is ignored.

Fixes PR11304.

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

7 years ago[X86] Add VEX_WIG to applicable AVX512 instructions.
Craig Topper [Sun, 22 Oct 2017 06:18:23 +0000 (06:18 +0000)]
[X86] Add VEX_WIG to applicable AVX512 instructions.

This should be NFC. Will be used in future patches to fix disassembler bugs.

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

7 years ago[X86] Add VEX_WIG to VROUNDSSrr/VROUNDSSrm/VROUNDSDrr/VROUNDSDrm
Craig Topper [Sun, 22 Oct 2017 06:18:20 +0000 (06:18 +0000)]
[X86] Add VEX_WIG to VROUNDSSrr/VROUNDSSrm/VROUNDSDrr/VROUNDSDrm

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

7 years ago[X86] Don't allow gather/scatter to disassembler if memory operand does not use a...
Craig Topper [Sun, 22 Oct 2017 04:32:30 +0000 (04:32 +0000)]
[X86] Don't allow gather/scatter to disassembler if memory operand does not use a SIB byte.

Fixes PR34998.

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

7 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Sat, 21 Oct 2017 20:40:49 +0000 (20:40 +0000)]
Strip trailing whitespace. NFCI.

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

7 years agoReverting r316270 due to failing build bots.
Aaron Ballman [Sat, 21 Oct 2017 20:38:15 +0000 (20:38 +0000)]
Reverting r316270 due to failing build bots.

http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/12899
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/7951

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

7 years ago[X86][SSE] Add extractps/pextrd equivalence to domain tables
Simon Pilgrim [Sat, 21 Oct 2017 20:19:48 +0000 (20:19 +0000)]
[X86][SSE] Add extractps/pextrd equivalence to domain tables

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

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

7 years ago[X86] Fix disassembling of EVEX instructions to stop accidentally decoding the SIB...
Craig Topper [Sat, 21 Oct 2017 20:03:20 +0000 (20:03 +0000)]
[X86] Fix disassembling of EVEX instructions to stop accidentally decoding the SIB index register as an XMM/YMM/ZMM register.

This introduces a new operand type to encode the whether the index register should be XMM/YMM/ZMM. And new code to fixup the results created by readSIB.

This has the nice effect of removing a bunch of code that hard coded the name of every GATHER and SCATTER instruction to map the index type.

This fixes PR32807.

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

7 years agoFix MSVC 'result of 32-bit shift implicitly converted to 64 bits' warning. NFCI.
Simon Pilgrim [Sat, 21 Oct 2017 17:23:04 +0000 (17:23 +0000)]
Fix MSVC 'result of 32-bit shift implicitly converted to 64 bits' warning. NFCI.

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

7 years ago[PPC CodeGen] Fix the bitreverse.i64 intrinsic.
Fangrui Song [Sat, 21 Oct 2017 16:59:40 +0000 (16:59 +0000)]
[PPC CodeGen] Fix the bitreverse.i64 intrinsic.

Summary: The two 32-bit words were swapped.

Subscribers: nemanjai, kbarton

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

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