OSDN Git Service

android-x86/external-llvm.git
7 years ago[PDB] Teach libpdb to write DBI Stream ECNames.
Zachary Turner [Fri, 7 Jul 2017 05:04:36 +0000 (05:04 +0000)]
[PDB] Teach libpdb to write DBI Stream ECNames.

Based strictly on the name, this seems to have something to do
width edit & continue.  The goal of this patch has nothing to do
with supporting edit and continue though.  msvc link.exe writes
very basic information into this area even when *not* compiling
with support for E&C, and so the goal here is to bring lld-link
to parity.  Since we cannot know what assumptions standard tools
make about the content of PDB files, we need to be as close as
possible.

This ECNames data structure is a standard PDB string hash table.
link.exe puts a single string into this hash table, which is the
full path to the PDB file on disk.  It then references this string
from the module descriptor for the compiler generated `* Linker *`
module.

With this patch, lld-link will generate the exact same sequence of
bytes as MSVC link for this subsection for a given object file
input (as reported by `llvm-pdbutil bytes -ec`).

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

7 years ago[Orc] Add missing return value (left out in r307350).
Lang Hames [Fri, 7 Jul 2017 03:22:57 +0000 (03:22 +0000)]
[Orc] Add missing return value (left out in r307350).

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

7 years agoCorrect GFX9 processor names.
Tony Tye [Fri, 7 Jul 2017 03:10:01 +0000 (03:10 +0000)]
Correct GFX9 processor names.

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

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

7 years agoRegisterScavenging: Fix PR33687
Matthias Braun [Fri, 7 Jul 2017 03:02:18 +0000 (03:02 +0000)]
RegisterScavenging: Fix PR33687

When scavenging for a use in instruction MI, we will reload after
that instruction and hence cannot spill uses/defs of this instruction.

This fixes http://llvm.org/PR33687

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

7 years agoLiveRegUnits: Rename accumulateBackward()->accumulate()
Matthias Braun [Fri, 7 Jul 2017 03:02:17 +0000 (03:02 +0000)]
LiveRegUnits: Rename accumulateBackward()->accumulate()

Contrary to the stepForward()/stepBackward() method accumulate() doesn't
have a direction as defs, uses and clobbers all have the same effect.

Also improve the documentation comment.

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

7 years ago[ORC] Errorize the ORC APIs.
Lang Hames [Fri, 7 Jul 2017 02:59:13 +0000 (02:59 +0000)]
[ORC] Errorize the ORC APIs.

This patch updates the ORC layers and utilities to return and propagate
llvm::Errors where appropriate. This is necessary to allow ORC to safely handle
error cases in cross-process and remote JITing.

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

7 years ago[InferAddressSpaces] Fix assertion about null pointer
Yaxun Liu [Fri, 7 Jul 2017 02:40:13 +0000 (02:40 +0000)]
[InferAddressSpaces] Fix assertion about null pointer

InferAddressSpaces does not check address space in collectFlatAddressExpressions,
which causes values with non flat address space put into Postorder and causes
assertion in cloneValueWithNewAddressSpace.

This patch fixes assertion in OpenCL 2.0 conformance test generic_address_space
subtest for amdgcn target.

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

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

7 years ago[WebAssembly] Support weak defined symbols
Sam Clegg [Fri, 7 Jul 2017 02:01:29 +0000 (02:01 +0000)]
[WebAssembly] Support weak defined symbols

Model weakly defined symbols as symbols that are both
exports and imported and marked as weak. Local references
to the symbols refer to the import but the linker can
resolve this to the weak export if not strong symbol
is found at link time.

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

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

7 years agoExtend memcpy expansion in Transform/Utils to handle wider operand types.
Sean Fertile [Fri, 7 Jul 2017 02:00:06 +0000 (02:00 +0000)]
Extend memcpy expansion in Transform/Utils to handle wider operand types.

Adds loop expansions for known-size and unknown-sized memcpy calls, allowing the
target to provide the operand types through TTI callbacks. The default values
for the TTI callbacks use int8 operand types and matches the existing behaviour
if they aren't overridden by the target.

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

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

7 years agoRevert r307342, r307343.
Evgeniy Stepanov [Fri, 7 Jul 2017 01:31:23 +0000 (01:31 +0000)]
Revert r307342, r307343.

Revert "Copy arguments passed by value into explicit allocas for ASan."
Revert "[asan] Add end-to-end tests for overflows of byval arguments."

Build failure on lldb-x86_64-ubuntu-14.04-buildserver.
Test failure on clang-cmake-aarch64-42vma and sanitizer-x86_64-linux-android.

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

7 years agoCopy arguments passed by value into explicit allocas for ASan.
Evgeniy Stepanov [Fri, 7 Jul 2017 00:48:25 +0000 (00:48 +0000)]
Copy arguments passed by value into explicit allocas for ASan.

ASan determines the stack layout from alloca instructions. Since
arguments marked as "byval" do not have an explicit alloca instruction, ASan
does not produce red zones for them. This commit produces an explicit alloca
instruction and copies the byval argument into the allocated memory so that red
zones are produced.

Patch by Matt Morehouse.

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

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

7 years ago[SafepointIRVerifier] NFC: Refactor code for identifying exclusive base type
Anna Thomas [Fri, 7 Jul 2017 00:40:37 +0000 (00:40 +0000)]
[SafepointIRVerifier] NFC: Refactor code for identifying exclusive base type

Added a new Enum to identify if the base pointer is exclusively null or
exlusively some constant or not exclusively any constant.
Converted the base pointer identification method from recursive to
iterative form.

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

7 years ago[lit] Modify LIT to accept environment variable LIT_FILTER to select tests.
George Karpenkov [Fri, 7 Jul 2017 00:22:11 +0000 (00:22 +0000)]
[lit] Modify LIT to accept environment variable LIT_FILTER to select tests.

This is especially useful when lit is invoked indirectly by the build
system, and additional arguments can not be easily specified.

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

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

7 years ago[ConstHoisting] Turn on consthoist-with-block-frequency by default.
Wei Mi [Fri, 7 Jul 2017 00:11:05 +0000 (00:11 +0000)]
[ConstHoisting] Turn on consthoist-with-block-frequency by default.

Using profile information to guide consthoisting is generally helpful for
performance, so the patch turns it on by default. No compile time or perf
regression were found using spec2000 and spec2006 on x86.  Some significant
improvement (>20%) was seen on internal benchmarks.

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

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

7 years agoReverting r307326 because it breaks clang tests.
Michael Kuperstein [Thu, 6 Jul 2017 23:24:39 +0000 (23:24 +0000)]
Reverting r307326 because it breaks clang tests.

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

7 years ago[InstCombine] No need to pass DataLayout to helper functions if we're passing the...
Craig Topper [Thu, 6 Jul 2017 23:18:43 +0000 (23:18 +0000)]
[InstCombine] No need to pass DataLayout to helper functions if we're passing the InstCombiner object. We can just ask it for the DataLayout. NFC

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

7 years ago[InstCombine] Remove unused arguments from some helper functions. NFC
Craig Topper [Thu, 6 Jul 2017 23:18:42 +0000 (23:18 +0000)]
[InstCombine] Remove unused arguments from some helper functions. NFC

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

7 years ago[InstCombine] Change a couple helper functions to only take the IRBuilder as an argum...
Craig Topper [Thu, 6 Jul 2017 23:18:41 +0000 (23:18 +0000)]
[InstCombine] Change a couple helper functions to only take the IRBuilder as an argument and not the whole InstCombiner object. NFC

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

7 years ago[ConstHoisting] choose to hoist when frequency is the same.
Wei Mi [Thu, 6 Jul 2017 22:32:27 +0000 (22:32 +0000)]
[ConstHoisting] choose to hoist when frequency is the same.

The patch is to adjust the strategy of frequency based consthoisting:
Previously when the candidate block has the same frequency with the existing
blocks containing a const, it will not hoist the const to the candidate block.
For that case, now we change the strategy to hoist the const if only existing
blocks have more than one block member. This is helpful for reducing code size.

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

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

7 years ago[NVPTX] Add lowering of i128 params.
Michael Kuperstein [Thu, 6 Jul 2017 22:18:54 +0000 (22:18 +0000)]
[NVPTX] Add lowering of i128 params.

The patch adds support of i128 params lowering. The changes are quite trivial to
support i128 as a "special case" of integer type. With this patch, we lower i128
params the same way as aggregates of size 16 bytes: .param .b8 _ [16].

Currently, NVPTX can't deal with the 128 bit integers:
* in some cases because of failed assertions like
ValVTs.size() == OutVals.size() && "Bad return value decomposition"
* in other cases emitting PTX with .i128 or .u128 types (which are not valid [1])
[1] http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#fundamental-types

Differential Revision: https://reviews.llvm.org/D34555
Patch by: Denys Zariaiev (denys.zariaiev@gmail.com)

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

7 years ago[ORC] Add missing <memory> include for shared_ptr.
Lang Hames [Thu, 6 Jul 2017 22:02:49 +0000 (22:02 +0000)]
[ORC] Add missing <memory> include for shared_ptr.

Accidentally left out of r307319.

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

7 years agoChange remaining references to lit.util.capture to use subprocess.check_output.
David L. Jones [Thu, 6 Jul 2017 21:46:47 +0000 (21:46 +0000)]
Change remaining references to lit.util.capture to use subprocess.check_output.

Summary:
The capture() function was removed in r306625. This should fix PGO breakages
reported by Michael Zolotukhin.

Reviewers: mzolotukhin

Subscribers: sanjoy, llvm-commits

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

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

7 years ago[ORC] Update GlobalMappingLayer::addModuleSet to addModule.
Lang Hames [Thu, 6 Jul 2017 21:33:48 +0000 (21:33 +0000)]
[ORC] Update GlobalMappingLayer::addModuleSet to addModule.

This layer was accidentally left out of r306166.

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

7 years agoUse @LINE in two more tests.
Rafael Espindola [Thu, 6 Jul 2017 21:33:23 +0000 (21:33 +0000)]
Use @LINE in two more tests.

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

7 years ago[COFF, AArch64] Set the private label prefix to .L
Martin Storsjo [Thu, 6 Jul 2017 21:08:34 +0000 (21:08 +0000)]
[COFF, AArch64] Set the private label prefix to .L

This fixes calls to external functions starting with a capital L,
fixing errors like this:
fatal error: error in backend: assembler label 'LocalFree' can not be undefined

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

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

7 years agoAMDGPU: Add macro fusion schedule DAG mutation
Matt Arsenault [Thu, 6 Jul 2017 20:57:05 +0000 (20:57 +0000)]
AMDGPU: Add macro fusion schedule DAG mutation

Try to increase opportunities to shrink vcc uses.

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

7 years agoAMDGPU: Minor cleanup of shrinking logic
Matt Arsenault [Thu, 6 Jul 2017 20:56:59 +0000 (20:56 +0000)]
AMDGPU: Minor cleanup of shrinking logic

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

7 years agoAMDGPU: Remove unnecessary IR from MIR tests
Matt Arsenault [Thu, 6 Jul 2017 20:56:57 +0000 (20:56 +0000)]
AMDGPU: Remove unnecessary IR from MIR tests

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

7 years ago[lit] Factor out some shell input/output redirection logic, NFC
Reid Kleckner [Thu, 6 Jul 2017 20:40:27 +0000 (20:40 +0000)]
[lit] Factor out some shell input/output redirection logic, NFC

This is a very light refactoring aimed at improving readability. There
is definitely still room for improvement here.

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

7 years ago[AMDGPU] Always use rcp + mul with fast math
Stanislav Mekhanoshin [Thu, 6 Jul 2017 20:34:21 +0000 (20:34 +0000)]
[AMDGPU] Always use rcp + mul with fast math

Regardless of relaxation options such as -cl-fast-relaxed-math
we are producing rather long code for fdiv via amdgcn_fdiv_fast
intrinsic. This intrinsic is used to replace fdiv with 2.5ulp
metadata and does not handle denormals, thus believed to be fast.

An fdiv instruction can also have fast math flag either by itself
or together with fpmath metadata. Clang used with a relaxation flag
always produces both metadata and fast flag:

%div = fdiv fast float %v, %0, !fpmath !12
!12 = !{float 2.500000e+00}

Current implementation ignores fast flag and favors metadata. An
instruction with just fast flag would be lowered to a fastest rcp +
mul, but that never happen on practice because of described mutual
clang and BE behavior.

This change allows an "fdiv fast" to be always lowered as rcp + mul.

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

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

7 years ago[lib/LTO] Add a comment to explain where we set the linkage in the summary.
Davide Italiano [Thu, 6 Jul 2017 20:04:20 +0000 (20:04 +0000)]
[lib/LTO] Add a comment to explain where we set the linkage in the summary.

Pointed out by Teresa!

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

7 years ago[ValueTracking] Support icmps fed by 'and' and 'or'.
Chad Rosier [Thu, 6 Jul 2017 20:00:25 +0000 (20:00 +0000)]
[ValueTracking] Support icmps fed by 'and' and 'or'.

This patch adds support for handling some forms of ands and ors in
ValueTracking's isImpliedCondition API.

PR33611
https://reviews.llvm.org/D34901

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

7 years ago[LTO] Fix the interaction between linker redefined symbols and ThinLTO
Davide Italiano [Thu, 6 Jul 2017 19:58:26 +0000 (19:58 +0000)]
[LTO] Fix the interaction between linker redefined symbols and ThinLTO

This is the same as r304719 but for ThinLTO.
The substantial difference is that in this case we don't have
whole visibility, just the summary.
In the LTO case, when we got the resolution for the input file we
could just see if the linker told us whether a symbol was linker
redefined (using --wrap or --defsym) and switch the linkage directly
for the GV.

Here, we have the summary. So, we record that the linkage changed
from <whatever it was> to $weakany to prevent IPOs across this symbol
boundaries and actually just switch the linkage at FunctionImport time.

This patch should also fixes the lld bits (as all the scaffolding for
communicating if a symbol is linker redefined should be there & should
be the same), but I'll make sure to add some tests there as well.

Fixes PR33192.

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

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

7 years ago[GISel]: Enhance the MachineIRBuilder API
Aditya Nandakumar [Thu, 6 Jul 2017 19:40:07 +0000 (19:40 +0000)]
[GISel]: Enhance the MachineIRBuilder API

Allows the MachineIRBuilder APIs to directly create registers (based on
LLT or TargetRegisterClass) as well as accept MachineInstrBuilders
and implicitly converts to register(with getOperand(0).getReg()).

Eg usage:
LLT s32 = LLT::scalar(32);
auto C32 = Builder.buildConstant(s32, 32);
auto Tmp = Builder.buildInstr(TargetOpcode::G_SUB, s32, C32,
OtherReg);
auto Tmp2 = Builder.buildInstr(Opcode, DstReg,
Builder.buildConstant(s32, 31)); ....

Only a few methods added for now.

Reviewed by Tim

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

7 years ago[X86][SSE] Tests for bitcasting iX integers to vXi1 boolean vectors
Simon Pilgrim [Thu, 6 Jul 2017 19:33:10 +0000 (19:33 +0000)]
[X86][SSE] Tests for bitcasting iX integers to vXi1 boolean vectors

Including sign/zero extension to legal types

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

7 years agoAdd @LINE to checks in a test.
Rafael Espindola [Thu, 6 Jul 2017 19:09:35 +0000 (19:09 +0000)]
Add @LINE to checks in a test.

This makes it a lot easier to see which error failed a check.

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

7 years agoremove an unused empty file.
Chris Lattner [Thu, 6 Jul 2017 19:06:13 +0000 (19:06 +0000)]
remove an unused empty file.

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

7 years agoPrototype: Reduce llvm-profdata merge memory usage further
David Blaikie [Thu, 6 Jul 2017 19:00:12 +0000 (19:00 +0000)]
Prototype: Reduce llvm-profdata merge memory usage further

The InstrProfWriter already stores the name and hash of the record in
the nested maps it uses for lookup while merging - this data is
duplicated in the value within the maps.

Refactor the InstrProfRecord to use a nested struct for the counters
themselves so that InstrProfWriter can use this nested struct alone
without the name or hash duplicated there.

This work is incomplete, but enough to demonstrate the value (around a
50% decrease in memory usage for a large test case (10GB -> 5GB)).
Though most of that decrease is probably from removing the
SoftInstrProfError as well, but I haven't implemented a replacement for
it yet. (it needs to go with the counters, because the operations on the
counters - merging, etc, are where the failures are - unlike the
name/hash which are totally unused by those counter-related operations
and thus easy to split out)

Ongoing discussion about removing SoftInstrProfError as a field of the
InstrProfRecord is happening on the thread that added it - including
the possibility of moving back towards an earlier version of that
proposed patch that passed SoftInstrProfError through the various APIs,
rather than as a member of InstrProfRecord.

Reviewers: davidxl

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

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

7 years ago[llvm] Separate out reverse iteration flag into its own header
Mandeep Singh Grang [Thu, 6 Jul 2017 18:52:16 +0000 (18:52 +0000)]
[llvm] Separate out reverse iteration flag into its own header

Summary: This will ease out adding reverse iteration flags to other containers by simply including the header.

Reviewers: mehdi_amini, dexonsmith, davide, dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

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

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

7 years ago[InstCombine] Remove include of DIBuilder.h and Dwarf.h as they don't appear to be...
Craig Topper [Thu, 6 Jul 2017 18:47:47 +0000 (18:47 +0000)]
[InstCombine] Remove include of DIBuilder.h and Dwarf.h as they don't appear to be necessary.

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

7 years agoModify constraints in `llvm::canReplaceOperandWithVariable`
Leo Li [Thu, 6 Jul 2017 18:47:05 +0000 (18:47 +0000)]
Modify constraints in `llvm::canReplaceOperandWithVariable`

Summary:
`Instruction::Switch`: only first operand can be set to a non-constant value.
`Instruction::InsertValue` both the first and the second operand can be set to a non-constant value.
`Instruction::Alloca` return true for non-static allocation.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: srhines, pirama, llvm-commits

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

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

7 years ago[Constants] Replace calls to ConstantInt::equalsInt(0)/equalsInt(1) with isZero and...
Craig Topper [Thu, 6 Jul 2017 18:39:49 +0000 (18:39 +0000)]
[Constants] Replace calls to ConstantInt::equalsInt(0)/equalsInt(1) with isZero and isOne. NFCI

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

7 years ago[Constants] If we already have a ConstantInt*, prefer to use isZero/isOne/isMinusOne...
Craig Topper [Thu, 6 Jul 2017 18:39:47 +0000 (18:39 +0000)]
[Constants] If we already have a ConstantInt*, prefer to use isZero/isOne/isMinusOne instead of isNullValue/isOneValue/isAllOnesValue inherited from Constant. NFCI

Going through the Constant methods requires redetermining that the Constant is a ConstantInt and then calling isZero/isOne/isMinusOne.

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

7 years ago[LoopUnrollRuntime] Bailout when multiple exiting blocks to the unique latch exit...
Anna Thomas [Thu, 6 Jul 2017 18:39:26 +0000 (18:39 +0000)]
[LoopUnrollRuntime] Bailout when multiple exiting blocks to the unique latch exit block

Currently, we do not support multiple exiting blocks to the
latch exit block. However, this bailout wasn't triggered when we had a
unique exit block (which is the latch exit), with multiple exiting
blocks to that unique exit.

Moved the bailout so that it's triggered in both cases and added
testcase.

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

7 years ago[InstCombine] Remove Builder argument from InstCombiner::tryFactorization. NFC
Craig Topper [Thu, 6 Jul 2017 18:35:52 +0000 (18:35 +0000)]
[InstCombine] Remove Builder argument from InstCombiner::tryFactorization. NFC

Builder is already a member of the InstCombiner class so we can use it with passing it.

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

7 years ago[X86][SSE] Dropped -mcpu from bitcast+setcc tests
Simon Pilgrim [Thu, 6 Jul 2017 18:27:34 +0000 (18:27 +0000)]
[X86][SSE] Dropped -mcpu from bitcast+setcc tests

Use triple and attribute only for consistency

Added SSE2/AVX tests on 256-bit vectors to test PACKSS behaviour

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

7 years agoFix spelling in comments. NFCI.
Simon Pilgrim [Thu, 6 Jul 2017 18:17:07 +0000 (18:17 +0000)]
Fix spelling in comments. NFCI.

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

7 years agoBitcode: Include any strings added to the string table in the module hash.
Peter Collingbourne [Thu, 6 Jul 2017 17:56:01 +0000 (17:56 +0000)]
Bitcode: Include any strings added to the string table in the module hash.

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

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

7 years ago[opt-viewer] Move under tools, install it
Adam Nemet [Thu, 6 Jul 2017 17:51:15 +0000 (17:51 +0000)]
[opt-viewer] Move under tools, install it

We weren't installing opt-viewer and co before, this fixes the omission.  I am
also moving the tools from utils/ to tools/.  I believe that this is more
appropriate since these tools have matured greatly in the past year through
contributions by multiple people (thanks!) so they are ready to become
external tools.

The tools are installed under <install>/share/opt-viewer/.

I am *not* adding the llvm- prefix.  If people feel strongly about adding
that, this is probably a good time since the new location will require some
mental adjustment anyway.

Fixes PR33521

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

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

7 years ago[PDB] Fill in "Parent" and "End" fields of scope-like symbol records
Reid Kleckner [Thu, 6 Jul 2017 16:39:32 +0000 (16:39 +0000)]
[PDB] Fill in "Parent" and "End" fields of scope-like symbol records

Summary:
There are a variety of records that open scopes: function scopes, block
scopes, and inlined call site scopes. These symbol records contain
Parent and End fields with the offsets of other symbol records. The End
field contains the offset of the matching S_END or S_INLINESITE_END
record. The Parent field contains the offset of the parent record, or 0
if this is a top-level scope (i.e. a function).

With this change, `llvm-pdbutil pretty -all` no longer crashes on PDBs
produced by LLD. I haven't tried a real debugger yet.

Reviewers: zturner, ruiu

Subscribers: llvm-commits

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

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

7 years ago[SimplifyCFG] Move a portion of an if statement that should already be implied to...
Craig Topper [Thu, 6 Jul 2017 16:29:43 +0000 (16:29 +0000)]
[SimplifyCFG]  Move a portion of an if statement that should already be implied to an assert

Summary: In this code we got to Dom by following the predecessor link of BB. So it stands to reason that BB should also show up as a successor of Dom's terminator right? There isn't a way to have the CFG connect in only one direction is there?

Reviewers: jmolloy, davide, mcrosier

Reviewed By: mcrosier

Subscribers: mcrosier, llvm-commits

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

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

7 years ago[InstCombine] Change helper method to a file local static method. NFC
Craig Topper [Thu, 6 Jul 2017 16:24:23 +0000 (16:24 +0000)]
[InstCombine] Change helper method to a file local static method. NFC

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

7 years ago[InstCombine] Clarify comment to mention other transform that it does. NFC
Craig Topper [Thu, 6 Jul 2017 16:24:22 +0000 (16:24 +0000)]
[InstCombine] Clarify comment to mention other transform that it does. NFC

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

7 years ago[InstCombine] Add single use checks to SimplifyBSwap to ensure we are really saving...
Craig Topper [Thu, 6 Jul 2017 16:24:21 +0000 (16:24 +0000)]
[InstCombine] Add single use checks to SimplifyBSwap to ensure we are really saving instructions

Bswap isn't a simple operation so we need to make sure we are really removing a call to it before doing these simplifications.

For the case when both LHS and RHS are bswaps I've allowed it to be moved if either LHS or RHS has a single use since that at least allows us to move it later where it might find another bswap to combine with and it decreases the use count on the other side so maybe the other user can be optimized.

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

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

7 years ago[InstCombine] Don't create extra ConstantInt objects in foldSelectICmpAnd. NFCI
Craig Topper [Thu, 6 Jul 2017 15:58:54 +0000 (15:58 +0000)]
[InstCombine] Don't create extra ConstantInt objects in foldSelectICmpAnd. NFCI

Instead just use APInt objects and only create a ConstantInt at the end if we need it for the Offset.

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

7 years ago[LSR] Narrow search space by filtering non-optimal formulae with the same ScaledReg...
Wei Mi [Thu, 6 Jul 2017 15:52:14 +0000 (15:52 +0000)]
[LSR] Narrow search space by filtering non-optimal formulae with the same ScaledReg and Scale.

When the formulae search space is huge, LSR uses a series of heuristic to keep
pruning the search space until the number of possible solutions are within
certain limit.

The big hammer of the series of heuristics is NarrowSearchSpaceByPickingWinnerRegs,
which picks the register which is used by the most LSRUses and deletes the other
formulae which don't use the register. This is a effective way to prune the search
space, but quite often not a good way to keep the best solution. We saw cases before
that the heuristic pruned the best formula candidate out of search space.

To relieve the problem, we introduce a new heuristic called
NarrowSearchSpaceByFilterFormulaWithSameScaledReg. The basic idea is in order to
reduce the search space while keeping the best formula, we want to keep as many
formulae with different Scale and ScaledReg as possible. That is because the central
idea of LSR is to choose a group of loop induction variables and use those induction
variables to represent LSRUses. An induction variable candidate is often represented
by the Scale and ScaledReg in a formula. If we have more formulae with different
ScaledReg and Scale to choose, we have better opportunity to find the best solution.
That is why we believe pruning search space by only keeping the best formula with the
same Scale and ScaledReg should be more effective than PickingWinnerReg. And we use
two criteria to choose the best formula with the same Scale and ScaledReg. The first
criteria is to select the formula using less non shared registers, and the second
criteria is to select the formula with less cost got from RateFormula. The patch
implements the heuristic before NarrowSearchSpaceByPickingWinnerRegs, which is the
last resort.

Testing shows we get 1.8% and 2% on two internal benchmarks on x86. llvm nightly
testsuite performance is neutral. We also tried lsr-exp-narrow and it didn't help
on the two improved internal cases we saw.

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

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

7 years ago[X86][SSE4A] Add support for shuffle combining to INSERTQI.
Simon Pilgrim [Thu, 6 Jul 2017 15:34:17 +0000 (15:34 +0000)]
[X86][SSE4A] Add support for shuffle combining to INSERTQI.

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

7 years ago[CGP, x86] update test checks; NFC
Sanjay Patel [Thu, 6 Jul 2017 15:31:38 +0000 (15:31 +0000)]
[CGP, x86] update test checks; NFC

This was auto-generated using an older version of the script,
and that version does not work with phis, so if we enable
expansion it will go bad.

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

7 years ago[X86][SSE4A] Add test showing missed opportunities to combine INSERTQI shuffle
Simon Pilgrim [Thu, 6 Jul 2017 14:52:24 +0000 (14:52 +0000)]
[X86][SSE4A] Add test showing missed opportunities to combine INSERTQI shuffle

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

7 years agoDoxygen formatting. NFCI
Joel Jones [Thu, 6 Jul 2017 14:17:36 +0000 (14:17 +0000)]
Doxygen formatting. NFCI

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

7 years ago[x86] fix over-specified triple and auto-generate checks; NFC
Sanjay Patel [Thu, 6 Jul 2017 14:15:15 +0000 (14:15 +0000)]
[x86] fix over-specified triple and auto-generate checks; NFC

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

7 years ago[MachineVerifier] Add check that tied physregs aren't different.
Mikael Holmen [Thu, 6 Jul 2017 13:18:21 +0000 (13:18 +0000)]
[MachineVerifier] Add check that tied physregs aren't different.

Summary: Added MachineVerifier code to check register ties more thoroughly, especially so that physical registers that are tied are the same. This may help e.g. when creating MIR files.

Original patch by Jesper Antonsson

Reviewers: stoklund, sanjoy, qcolombet

Reviewed By: qcolombet

Subscribers: qcolombet, llvm-commits

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

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

7 years agoFixes to Dockerfile scripts.
Ilya Biryukov [Thu, 6 Jul 2017 13:10:55 +0000 (13:10 +0000)]
Fixes to Dockerfile scripts.

- Put buildfiles into /tmp/clang-build/build, instead of /tmp/clang-build.
  We checkout the sources to /tmp/clang-build/src and running
  cmake in /tmp/clang-build was done by mistake.
- Don't add an extra ';' at the start of enabled projects list.
  It worked either way, but looked strange.
- Minor comment update.

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

7 years ago[X86][SSE] combineX86ShuffleChain - merge duplicate creations of integer mask types
Simon Pilgrim [Thu, 6 Jul 2017 13:09:19 +0000 (13:09 +0000)]
[X86][SSE] combineX86ShuffleChain - merge duplicate creations of integer mask types

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

7 years agoMade a script to build docker images easier to use.
Ilya Biryukov [Thu, 6 Jul 2017 12:46:51 +0000 (12:46 +0000)]
Made a script to build docker images easier to use.

Summary:
- Removed double indirection via command-line args (i.e. two `--`
  options of `build_docker_image.sh`).
- Added a comment on how to build 2-stage clang install into the
  `build_docker_image.sh`, it used to be only in the `docs/Docker.rst`.

Reviewers: klimek, mehdi_amini

Reviewed By: klimek

Subscribers: llvm-commits

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

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

7 years ago[X86][SSE] combineX86ShuffleChain - merge duplicate 'Zeroable' element masks
Simon Pilgrim [Thu, 6 Jul 2017 12:40:10 +0000 (12:40 +0000)]
[X86][SSE] combineX86ShuffleChain - merge duplicate 'Zeroable' element masks

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

7 years ago[X86][SSE4A] Add support for shuffle combining to EXTRQ.
Simon Pilgrim [Thu, 6 Jul 2017 12:22:58 +0000 (12:22 +0000)]
[X86][SSE4A] Add support for shuffle combining to EXTRQ.

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

7 years ago[X86][SSE4A] Add scheduling tests for SSE4A instructions
Simon Pilgrim [Thu, 6 Jul 2017 11:26:43 +0000 (11:26 +0000)]
[X86][SSE4A] Add scheduling tests for SSE4A instructions

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

7 years ago[X86][SSE4A] Split EXTRQ/INSERTQ shuffle matching from lowering. NFCI.
Simon Pilgrim [Thu, 6 Jul 2017 11:06:54 +0000 (11:06 +0000)]
[X86][SSE4A] Split EXTRQ/INSERTQ shuffle matching from lowering. NFCI.

First step toward supporting shuffle combining to EXTRQ/INSERTQ.

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

7 years agoRevert "Revert "Revert "[IndVars] Canonicalize comparisons between non-negative value...
Max Kazantsev [Thu, 6 Jul 2017 10:47:13 +0000 (10:47 +0000)]
Revert "Revert "Revert "[IndVars] Canonicalize comparisons between non-negative values and indvars"""

It appears that the problem is still there. Needs more analysis to understand why
SaturatedMultiply test fails.

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

7 years ago[globalisel][tablegen] Rename and re-comment render functions to match the new MatchT...
Daniel Sanders [Thu, 6 Jul 2017 10:37:17 +0000 (10:37 +0000)]
[globalisel][tablegen] Rename and re-comment render functions to match the new MatchTables. NFC.

The conversion to MatchTable left the function names and comments referring to
C++ statements and expressions. Updated the names and comments to account for
the fact that they're no longer unconstrained statements/expressions.

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

7 years ago[RegisterCoalescer] Fix for SubRange join unreachable
David Stuttard [Thu, 6 Jul 2017 10:07:57 +0000 (10:07 +0000)]
[RegisterCoalescer] Fix for SubRange join unreachable

Summary:
During remat, some subranges might end up having invalid segments which caused problems for later
coalescing.

Added in a check to remove segments that are invalidated as part of the remat.

See http://llvm.org/PR33524

Subscribers: MatzeB, qcolombet

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

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

7 years ago[globalisel][tablegen] Rename and re-comment to match the new MatchTables. NFC.
Daniel Sanders [Thu, 6 Jul 2017 10:06:12 +0000 (10:06 +0000)]
[globalisel][tablegen] Rename and re-comment to match the new MatchTables. NFC.

The conversion to MatchTable left the function names and comments referring to
C++ statements and expressions. Updated the names and comments to account for
the fact that they're no longer unconstrained statements/expressions.

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

7 years ago[ARM] GlobalISel: Map s32 G_FCMP in reg bank select
Diana Picus [Thu, 6 Jul 2017 09:57:46 +0000 (09:57 +0000)]
[ARM] GlobalISel: Map s32 G_FCMP in reg bank select

Map hard G_FCMP operands to FPR and the result to GPR.

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

7 years agoRevert "Revert "[IndVars] Canonicalize comparisons between non-negative values and...
Max Kazantsev [Thu, 6 Jul 2017 09:57:41 +0000 (09:57 +0000)]
Revert "Revert "[IndVars] Canonicalize comparisons between non-negative values and indvars""

It seems that the patch was reverted by mistake. Clang testing showed failure of the
MathExtras.SaturatingMultiply test, however I was unable to reproduce the issue on the
fresh code base and was able to confirm that the transformation introduced by the change
does not happen in the said test. This gives a strong confidence that the actual reason of
the failure of the initial patch was somewhere else, and that problem now seems to be
fixed. Re-submitting the change to confirm that.

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

7 years ago[ARM] GlobalISel: Legalize G_FCMP for s32
Diana Picus [Thu, 6 Jul 2017 09:09:33 +0000 (09:09 +0000)]
[ARM] GlobalISel: Legalize G_FCMP for s32

This covers both hard and soft float.

Hard float is easy, since it's just Legal.

Soft float is more involved, because there are several different ways to
handle it based on the predicate: one and ueq need not only one, but two
libcalls to get a result. Furthermore, we have large differences between
the values returned by the AEABI and GNU functions.

AEABI functions return a nice 1 or 0 representing true and respectively
false. GNU functions generally return a value that needs to be compared
against 0 (e.g. for ogt, the value returned by the libcall is > 0 for
true).  We could introduce redundant comparisons for AEABI as well, but
they don't seem easy to remove afterwards, so we do different processing
based on whether or not the result really needs to be compared against
something (and just truncate if it doesn't).

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

7 years ago[DWARF] - Provide default implementation for getSectionLoadAddress() method of Loaded...
George Rimar [Thu, 6 Jul 2017 08:46:01 +0000 (08:46 +0000)]
[DWARF] - Provide default implementation for getSectionLoadAddress() method of LoadedObjectInfo

It is a bit unconvinent that client should implement this method
even if not use it. Patch provides default implementation.

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

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

7 years ago[globalisel][tablegen] Import rules containing intrinsic_wo_chain.
Daniel Sanders [Thu, 6 Jul 2017 08:12:20 +0000 (08:12 +0000)]
[globalisel][tablegen] Import rules containing intrinsic_wo_chain.

Summary:
As of this patch, 1018 out of 3938 rules are currently imported.

Depends on D32275

Reviewers: qcolombet, kristof.beyls, rovka, t.p.northover, ab, aditya_nandakumar

Reviewed By: qcolombet

Subscribers: dberris, igorb, llvm-commits

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

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

7 years ago[ARM] GlobalISel: Widen s1, s8, s16 G_CONSTANT
Diana Picus [Thu, 6 Jul 2017 08:04:16 +0000 (08:04 +0000)]
[ARM] GlobalISel: Widen s1, s8, s16 G_CONSTANT

Get the legalizer to widen small constants.

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

7 years agoFix -Wunused-function by making function declarations in a header non-static
David Blaikie [Thu, 6 Jul 2017 05:33:32 +0000 (05:33 +0000)]
Fix -Wunused-function by making function declarations in a header non-static

Also avoids ODR violations by ensuring names used in headers find the
same entity, not different, file-local entities in each translation
unit.

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

7 years agoSimplify InstrProfRecord tests, eliminating named temporaries in favor of braced...
David Blaikie [Thu, 6 Jul 2017 05:19:17 +0000 (05:19 +0000)]
Simplify InstrProfRecord tests, eliminating named temporaries in favor of braced init args

This will also simplify an API transition and class renaming coming
soon.

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

7 years ago[lit] Fix unit test discovery for Visual Studio builds.
David L. Jones [Thu, 6 Jul 2017 03:23:18 +0000 (03:23 +0000)]
[lit] Fix unit test discovery for Visual Studio builds.

Fix by Andrew Ng!

The Visual Studio build can contain output for multiple configuration types (
e.g. Debug, Release & RelWithDebInfo) within the same build output
directory. Therefore when discovering unit tests, the "build mode" sub directory
containing the appropriate configuration is included in the search. This sub
directory may not always be present, so a test for its existence is required.

Reviewers: zturner, modocache, dlj

Reviewed By: zturner, dlj

Subscribers: grimar, bd1976llvm, gbreynoo, edd, jhenderson, llvm-commits

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

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

7 years agoAvoid constructing GlobalExtensions only to find out it is empty.
Frederich Munch [Thu, 6 Jul 2017 00:09:09 +0000 (00:09 +0000)]
Avoid constructing GlobalExtensions only to find out it is empty.

Summary:
GlobalExtensions is dereferenced twice, once for iteration and then a check if it is empty.
As a ManagedStatic this dereference forces it's construction which is unnecessary.

Reviewers: efriedma, davide, mehdi_amini

Reviewed By: mehdi_amini

Subscribers: chapuni, llvm-commits, mehdi_amini

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

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

7 years agoRevert "Revert "Revert "Switch external cvtres.exe for llvm's own resource library."""
Eric Beckmann [Wed, 5 Jul 2017 23:46:06 +0000 (23:46 +0000)]
Revert "Revert "Revert "Switch external cvtres.exe for llvm's own resource library."""

This reverts commit ae21ee0b6cacbc1efaf4d42502e71da2f0eb45c3.

The initial revert was done in order to prevent ongoing errors on
chromium bots such as CrWinClangLLD.  However, this was done haphazardly
and I didn't realize there were test and compilation failures, so this
revert was reverted.  Now that those have been fixed, we can revert the
revert of the revert.

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

7 years agoRevert "Revert "Revert "Replace trivial use of external rc.exe by writing our own...
Eric Beckmann [Wed, 5 Jul 2017 23:45:50 +0000 (23:45 +0000)]
Revert "Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file."""

This reverts commit 5fecbbbe5049665d86834cf69d8f75db4f392308.

The initial revert was done in order to prevent ongoing errors on
chromium bots such as CrWinClangLLD.  However, this was done haphazardly
and I didn't realize there were test and compilation failures, so this
revert was reverted.  Now that those have been fixed, we can revert the
revert of the revert.

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

7 years ago[IR] Use CmpInst::isFPPredicate/isIntPredicate in a few other places. NFC
Craig Topper [Wed, 5 Jul 2017 23:35:46 +0000 (23:35 +0000)]
[IR] Use CmpInst::isFPPredicate/isIntPredicate in a few other places. NFC

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

7 years ago[GlobalOpt] Remove unreachable blocks before optimizing a function.
Davide Italiano [Wed, 5 Jul 2017 22:28:28 +0000 (22:28 +0000)]
[GlobalOpt] Remove unreachable blocks before optimizing a function.

LLVM's definition of dominance allows instructions that are cyclic
in unreachable blocks, e.g.:

  %pat = select i1 %condition, @global, i16* %pat

because any instruction dominates an instruction in a block that's
not reachable from entry.
So, remove unreachable blocks from the function, because a) there's
no point in analyzing them and b) GlobalOpt should otherwise grow
some more complicated logic to break these cycles.

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

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

7 years ago[IR] Use CmpInst::isIntPredicate()/isFPPredicate in some asserts instead of doing...
Craig Topper [Wed, 5 Jul 2017 22:09:00 +0000 (22:09 +0000)]
[IR] Use CmpInst::isIntPredicate()/isFPPredicate in some asserts instead of doing the equivalent range check. NFC

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

7 years agoFix libcall expansion creating DAG nodes with invalid type post type legalization.
Vadim Chugunov [Wed, 5 Jul 2017 22:01:49 +0000 (22:01 +0000)]
Fix libcall expansion creating DAG nodes with invalid type post type legalization.

If we are lowering a libcall after legalization, we'll split the return type into a pair of legal values.

Patch by Jatin Bhateja and Eli Friedman.

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

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

7 years agoFix std::min ambiguity between uint32 and size_t.
Zachary Turner [Wed, 5 Jul 2017 21:59:20 +0000 (21:59 +0000)]
Fix std::min ambiguity between uint32 and size_t.

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

7 years ago[llvm-pdbutil] Add the ability to truncate stream purpose names.
Zachary Turner [Wed, 5 Jul 2017 21:54:58 +0000 (21:54 +0000)]
[llvm-pdbutil] Add the ability to truncate stream purpose names.

This will be useful for aligning fields to a fixed with in
subsequent patches.

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

7 years ago[DependenceAnalysis] Make sure base objects are the same when comparing GEPs
Brendon Cahoon [Wed, 5 Jul 2017 21:35:47 +0000 (21:35 +0000)]
[DependenceAnalysis] Make sure base objects are the same when comparing GEPs

The dependence analysis was returning incorrect information when using the GEPs
to compute dependences. The analysis uses the GEP indices under certain
conditions, but was doing it incorrectly when the base objects of the GEP are
aliases, but pointing to different locations in the same array.

This patch adds another check for the base objects. If the base pointer SCEVs
are not equal, then the dependence analysis should fall back on the path
that uses the whole SCEV for the dependence check. This fixes PR33567.

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

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

7 years agoAdded more info on silent master to the doc.
Galina Kistanova [Wed, 5 Jul 2017 20:45:44 +0000 (20:45 +0000)]
Added more info on silent master to the doc.

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

7 years ago[InstCombine] Use CmpInst::Predicate with m_Cmp instead of ICmpInst::Predicate. NFC
Craig Topper [Wed, 5 Jul 2017 20:31:00 +0000 (20:31 +0000)]
[InstCombine] Use CmpInst::Predicate with m_Cmp instead of ICmpInst::Predicate. NFC

There isn't really an ICmpInst version so we're just accessing the CmpInst version through inheritance.

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

7 years ago[WebAssembly] Fix types for address taken functions
Sam Clegg [Wed, 5 Jul 2017 20:25:08 +0000 (20:25 +0000)]
[WebAssembly] Fix types for address taken functions

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

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

7 years ago[tablegen] Avoid creating temporary strings
Alexander Shaposhnikov [Wed, 5 Jul 2017 20:14:54 +0000 (20:14 +0000)]
[tablegen] Avoid creating temporary strings

If a method / function returns a StringRef but the
variable is of type const std::string& a temporary string is
created (StringRef has a cast operator to std::string),
which is a suboptimal behavior.

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

Test plan: make check-all

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

7 years ago[WebAssembly] MC: Don't generate extra types for weak alias
Sam Clegg [Wed, 5 Jul 2017 20:09:26 +0000 (20:09 +0000)]
[WebAssembly] MC: Don't generate extra types for weak alias

Previously we were generating a void(void) function type
for a weak alias.  Update the weak-alias test case to
catch this.

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

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

7 years agoAdd a test for relocation addend on mips.
Rafael Espindola [Wed, 5 Jul 2017 19:31:07 +0000 (19:31 +0000)]
Add a test for relocation addend on mips.

An lld test found a bug in a llvm patch I am working on. It is better
to have test coverage for that in llvm too.

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

7 years agoRevert "Revert "Replace trivial use of external rc.exe by writing our own .res file.""
Eric Beckmann [Wed, 5 Jul 2017 19:04:48 +0000 (19:04 +0000)]
Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file.""

This reverts commit 8c8dce3b8f15d6ebaefc35ce88f15a85c8cdbd6e.

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

7 years agoRevert "Revert "Switch external cvtres.exe for llvm's own resource library.""
Eric Beckmann [Wed, 5 Jul 2017 19:04:33 +0000 (19:04 +0000)]
Revert "Revert "Switch external cvtres.exe for llvm's own resource library.""

This reverts commit 165e578e47f1cd38191120aad23a9020fb5476dd.

Forgot to run tests on this.

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