OSDN Git Service

android-x86/external-llvm.git
7 years ago[Outliner] Remove unused lambda capture.
Jessica Paquette [Thu, 23 Mar 2017 22:17:20 +0000 (22:17 +0000)]
[Outliner] Remove unused lambda capture.

Remove an unused lambda capture that made some bots unhappy.

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

7 years ago[PDB] Use two DBs when dumping the IPI stream
Reid Kleckner [Thu, 23 Mar 2017 21:36:25 +0000 (21:36 +0000)]
[PDB] Use two DBs when dumping the IPI stream

Summary:
When dumping these records from an object file section, we should use
only one type database. However, when dumping from a PDB, we should use
two: one for the type stream and one for the IPI stream.

Certain type records that normally live in the .debug$T object file
section get moved over to the IPI stream of the PDB file and they get
new indices.

So far, I've noticed that the MSVC linker always moves these records
into IPI:
- LF_FUNC_ID
- LF_MFUNC_ID
- LF_STRING_ID
- LF_SUBSTR_LIST
- LF_BUILDINFO
- LF_UDT_MOD_SRC_LINE

These records have index fields that can point into TPI or IPI. In
particular, LF_SUBSTR_LIST and LF_BUILDINFO point to LF_STRING_ID
records to describe compilation command lines.

I've modified the dumper to have an optional pointer to the item DB, and
to do type name lookup of these fields in that DB. See printItemIndex.
The result is that our pdbdump-headers.test is more faithful to the PDB
contents and the output is less confusing.

Reviewers: ruiu

Subscribers: amccarth, zturner, llvm-commits

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

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

7 years ago[Outliner] Fix compile-time overhead for candidate choice
Jessica Paquette [Thu, 23 Mar 2017 21:27:38 +0000 (21:27 +0000)]
[Outliner] Fix compile-time overhead for candidate choice

The old candidate collection method in the outliner caused some very large
regressions in compile time on large tests. For MultiSource/Benchmarks/7zip it
caused a 284.07 s or 1156% increase in compile time. On average, using the
SingleSource/MultiSource tests, it caused an average increase of 8 seconds in
compile time (something like 1000%).

This commit replaces that candidate collection method with a new one which
only visits each node in the tree once. This reduces the worst compile time
increase (still 7zip) to a 0.542 s overhead (22%) and the average compile time
increase on SingleSource and MultiSource to 0.018 s (4%).

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

7 years agoDisable loop unrolling and icp in SamplePGO ThinLTO compile phase
Dehao Chen [Thu, 23 Mar 2017 21:20:05 +0000 (21:20 +0000)]
Disable loop unrolling and icp in SamplePGO ThinLTO compile phase

Summary:
loop unrolling and icp will make the sample profile annotation much harder in the backend. So disable these 2 optimization in the ThinLTO compile phase.
Will add a test in cfe in a separate patch.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: mehdi_amini, llvm-commits, Prazek

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

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

7 years agoRemove unnecessary use of std::result_of, which is deprecated in C++17.
Richard Smith [Thu, 23 Mar 2017 21:02:31 +0000 (21:02 +0000)]
Remove unnecessary use of std::result_of, which is deprecated in C++17.

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

7 years ago[InstCombine] Remove some code from visitAnd that dealt with trying to reduce the...
Craig Topper [Thu, 23 Mar 2017 21:00:13 +0000 (21:00 +0000)]
[InstCombine] Remove some code from visitAnd that dealt with trying to reduce the LHS of a sub to 0. This should now be fully handled by SimplifyDemandedInstructionBits now.

Now that we call ShrinkDemandedConstant on the RHS of sub this should be taken care of. This code doesn't trigger on any in tree regressions, but did before ShrinkDemandedConstant was added to the RHS.

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

7 years agoLLVM Changes for alloc_align
Erich Keane [Thu, 23 Mar 2017 20:38:34 +0000 (20:38 +0000)]
LLVM Changes for alloc_align

GCC has the alloc_align attribute, which is similar to assume_aligned, except the attribute's parameter is the index of the integer parameter that needs aligning to.

This is the required LLVM changes to make this happen.

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

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

7 years agoZero-Initialize PrevInstBB when entering a new MachineFunction.
Adrian Prantl [Thu, 23 Mar 2017 20:23:42 +0000 (20:23 +0000)]
Zero-Initialize PrevInstBB when entering a new MachineFunction.

It is not guaranteed that the memory used for MachineBasicBlocks in
the previous MachineFunction hasn't been freed, so holding on to a
pointer to the last function's isn't correct. Particularly I have
observed the sret.ll testcase failing because the first BasicBlock in
the new function happened to be allocated to the exact same memory as
the previously saved and (deleted) PrevInstBB.

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

7 years ago[LV] Add regression test for r297610
Gil Rapaport [Thu, 23 Mar 2017 20:02:23 +0000 (20:02 +0000)]
[LV] Add regression test for r297610

The new test asserts that scalarized memory operations get memcheck metadata
added even if the loop is only unrolled.

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

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

7 years ago[LVIPrinterPass] Print LVI info for function arguments
Anna Thomas [Thu, 23 Mar 2017 20:00:54 +0000 (20:00 +0000)]
[LVIPrinterPass] Print LVI info for function arguments

Using AssemblyAnnotationWriter for LVI printer prints
for instructions and basic blocks.
So, we explicitly need to print LVI info for the arguments of the function (these
are values and not instructions).

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

7 years ago[ThinLTO] Add support for emitting minimized bitcode for thin link
Teresa Johnson [Thu, 23 Mar 2017 19:47:39 +0000 (19:47 +0000)]
[ThinLTO] Add support for emitting minimized bitcode for thin link

Summary:
The cumulative size of the bitcode files for a very large application
can be huge, particularly with -g. In a distributed build environment,
all of these files must be sent to the remote build node that performs
the thin link step, and this can exceed size limits.

The thin link actually only needs the summary along with a bitcode
symbol table. Until we have a proper bitcode symbol table, simply
stripping the debug metadata results in significant size reduction.

Add support for an option to additionally emit minimized bitcode
modules, just for use in the thin link step, which for now just strips
all debug metadata. I plan to add a cc1 option so this can be invoked
easily during the compile step.

However, care must be taken to ensure that these minimized thin link
bitcode files produce the same index as with the original bitcode files,
as these original bitcode files will be used in the backends.

Specifically:
1) The module hash used for caching is typically produced by hashing the
written bitcode, and we want to include the hash that would correspond
to the original bitcode file. This is because we want to ensure that
changes in the stripped portions affect caching. Added plumbing to emit
the same module hash in the minimized thin link bitcode file.
2) The module paths in the index are constructed from the module ID of
each thin linked bitcode, and typically is automatically generated from
the input file path. This is the path used for finding the modules to
import from, and obviously we need this to point to the original bitcode
files. Added gold-plugin support to take a suffix replacement during the
thin link that is used to override the identifier on the MemoryBufferRef
constructed from the loaded thin link bitcode file. The assumption is
that the build system can specify that the minimized bitcode file has a
name that is similar but uses a different suffix (e.g. out.thinlink.bc
instead of out.o).

Added various tests to ensure that we get identical index files out of
the thin link step.

Reviewers: mehdi_amini, pcc

Subscribers: Prazek, llvm-commits

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

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

7 years agoKill some trailing whitespace to make some new changes a bit easier.
Eric Christopher [Thu, 23 Mar 2017 19:41:10 +0000 (19:41 +0000)]
Kill some trailing whitespace to make some new changes a bit easier.

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

7 years ago[X86] Fix Stale SDNode use in X86ISelDAGtoDAG
Nirav Dave [Thu, 23 Mar 2017 18:25:17 +0000 (18:25 +0000)]
[X86] Fix Stale SDNode use in X86ISelDAGtoDAG

Summary: Fixes pr32329.

Reviewers: spatel, craig.topper

Subscribers: llvm-commits

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

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

7 years agoModel ashr(shl(x, n), m) as mul(x, 2^(n-m)) when n > m
Zhaoshi Zheng [Thu, 23 Mar 2017 18:06:09 +0000 (18:06 +0000)]
Model ashr(shl(x, n), m) as mul(x, 2^(n-m)) when n > m

Given below case:

  %y = shl %x, n
  %z = ashr %y, m

when n = m, SCEV models it as sext(trunc(x)). This patch tries to handle
the case where n > m by using sext(mul(trunc(x), 2^(n-m)))) as the SCEV
expression.

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

7 years agorevert test commit r298629
Zhaoshi Zheng [Thu, 23 Mar 2017 17:52:20 +0000 (17:52 +0000)]
revert test commit r298629

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

7 years agotest commit
Zhaoshi Zheng [Thu, 23 Mar 2017 17:38:47 +0000 (17:38 +0000)]
test commit

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

7 years agoRemove the subtarget argument from LowerFP_TO_INT since there's one
Eric Christopher [Thu, 23 Mar 2017 17:35:08 +0000 (17:35 +0000)]
Remove the subtarget argument from LowerFP_TO_INT since there's one
stored on X86TargetLowering.

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

7 years agoRemove unused X86Subtarget argument from getOnesVector.
Eric Christopher [Thu, 23 Mar 2017 17:35:06 +0000 (17:35 +0000)]
Remove unused X86Subtarget argument from getOnesVector.

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

7 years agoSomehow this still breaks because of ANSI color codes in test output on Linux.
Adrian McCarthy [Thu, 23 Mar 2017 17:18:50 +0000 (17:18 +0000)]
Somehow this still breaks because of ANSI color codes in test output on Linux.
Reverting until I can figure out the root cause.

Revert "Re-land:  Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"

This reverts commit f461a70cc376f0f91c8b4917be79479cc86330a5.

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

7 years agoFix build break after r298623
Adrian McCarthy [Thu, 23 Mar 2017 16:57:53 +0000 (16:57 +0000)]
Fix build break after r298623

Use the -color-output option explicitly to eliminate the ANSI color codes in
pdb-native-summary.test.  (The default should have done this.)

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

7 years ago[ARM] Fix computeKnownBits for ARMISD::CMOV
Pirama Arumuga Nainar [Thu, 23 Mar 2017 16:47:47 +0000 (16:47 +0000)]
[ARM] Fix computeKnownBits for ARMISD::CMOV

Summary:
The true and false operands for the CMOV are operands 0 and 1.
ARMISelLowering.cpp::computeKnownBits was looking at operands 1 and 2
instead.  This can cause CMOV instructions to be incorrectly folded into
BFI if value set by the CMOV is another CMOV, whose known bits are
computed incorrectly.

This patch fixes the issue and adds a test case.

Reviewers: kristof.beyls, jmolloy

Subscribers: llvm-commits, aemerson, srhines, rengolin

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

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

7 years agoRe-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]
Adrian McCarthy [Thu, 23 Mar 2017 16:45:20 +0000 (16:45 +0000)]
Re-land:  Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]

The new test should pass on all platforms now that llvm-pdbdump has the
`-color-output` option.

This moves exe symbol-specific method implementations out of NativeRawSymbol
into a concrete subclass. Also adds implementations for hasCTypes and
hasPrivateSymbols and a simple test to ensure the native reader can access
the summary information for the executable from the PDB.

Original Differential Revision: https://reviews.llvm.org/D31059

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

7 years ago[LV] Vectorize GEPs
Matthew Simpson [Thu, 23 Mar 2017 16:29:58 +0000 (16:29 +0000)]
[LV] Vectorize GEPs

This patch adds support for vectorizing GEPs. Previously, we only generated
vector GEPs on-demand when creating gather or scatter operations. All GEPs from
the original loop were scalarized by default, and if a pointer was to be stored
to memory, we would have to build up the pointer vector with insertelement
instructions.

With this patch, we will vectorize all GEPs that haven't already been marked
for scalarization.

The patch refines collectLoopScalars to more exactly identify the scalar GEPs.
The function now more closely resembles collectLoopUniforms. And the patch
moves vector GEP creation out of vectorizeMemoryInstruction and into the main
vectorization loop. The vector GEPs needed for gather and scatter operations
will have already been generated before vectoring the memory accesses.

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

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

7 years ago[X86][SSE] Extract elements from narrower shuffle masks.
Simon Pilgrim [Thu, 23 Mar 2017 16:09:34 +0000 (16:09 +0000)]
[X86][SSE] Extract elements from narrower shuffle masks.

Add support for widening narrow shuffle masks so we can directly extract from the relevant input vector of the shuffle.

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

7 years ago[LV] Delete unneeded scalar GEP creation code
Matthew Simpson [Thu, 23 Mar 2017 16:07:21 +0000 (16:07 +0000)]
[LV] Delete unneeded scalar GEP creation code

The code for generating scalar base pointers in vectorizeMemoryInstruction is
not needed. We currently scalarize all GEPs and maintain the scalarized values
in VectorLoopValueMap. The GEP cloning in this unneeded code is the same as
that in scalarizeInstruction. The test cases that changed as a result of this
patch changed because we were able to reuse the scalarized GEP that we
previously generated instead of cloning a new one.

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

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

7 years ago[PPC] Add generated tests for all atomic operations
Tim Shen [Thu, 23 Mar 2017 16:02:47 +0000 (16:02 +0000)]
[PPC] Add generated tests for all atomic operations

Summary: Add tests for all atomic operations for powerpc64le, so that all changes can be easily examined.

Reviewers: kbarton, hfinkel, echristo

Subscribers: mehdi_amini, nemanjai, llvm-commits

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

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

7 years ago[WebAssembly] Fix import type to be signed LEBs
Derek Schuff [Thu, 23 Mar 2017 15:46:47 +0000 (15:46 +0000)]
[WebAssembly] Fix import type to be signed LEBs

This fix is a follow up a previous change with stored
value types as signed integers in memory.

In future, once the yaml<->wasm binary patche lands we
can add test coverage for this kind of thing.

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

Patch by Sam Clegg

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

7 years ago[x86] add memcmp tests, remove run
Sanjay Patel [Thu, 23 Mar 2017 15:38:22 +0000 (15:38 +0000)]
[x86] add memcmp tests, remove run

Add tests for vector lengths that could be handled without a libcall.

There's an explicit test for 'nobuiltin', so there's not much value
in a separate run that checks that same behavior over and over again.

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

7 years agoAdd option to control whether llvm-pdbdump outputs in color
Adrian McCarthy [Thu, 23 Mar 2017 15:28:15 +0000 (15:28 +0000)]
Add option to control whether llvm-pdbdump outputs in color

Adds -color-output option to llvm-pdbdump pretty commands that lets the user
specify whether the output should have color. The default depends on whether
the output is going to a TTY (per prior discussion in
https://reviews.llvm.org/D31246).

This will enable tests that pipe llvm-pdbdump output to FileCheck to work
across platforms without regard to the differences in ANSI codes.

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

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

7 years ago[GlobalISel][X86] Support G_STORE/G_LOAD operation
Igor Breger [Thu, 23 Mar 2017 15:25:57 +0000 (15:25 +0000)]
[GlobalISel][X86] Support G_STORE/G_LOAD operation

Summary:
1. Support pointer type as function argumnet and return value
2. G_STORE/G_LOAD - set legal action for i8/i16/i32/i64/f32/f64/vec128
3. RegisterBank - support typeless operations like G_STORE/G_LOAD, for scalar use GPR bank.
4. Support instruction selection for G_LOAD/G_STORE

Reviewers: zvi, rovka, ab, qcolombet

Reviewed By: rovka

Subscribers: llvm-commits, dberris, kristof.beyls, eladcohen, guyblank

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

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

7 years ago[SDAG] Fix zeroExtend assertion error
Nirav Dave [Thu, 23 Mar 2017 15:01:50 +0000 (15:01 +0000)]
[SDAG] Fix zeroExtend assertion error

Move CombineTo preventing deleted node from being returned in
visitZERO_EXTEND.

Fixes PR32284.

Reviewers: RKSimon, bogner

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

7 years agoDo not polute the source directory.
Vassil Vassilev [Thu, 23 Mar 2017 14:54:34 +0000 (14:54 +0000)]
Do not polute the source directory.

When a python script is run, by default it creates the bytecode file if the directory is writable, and this â€˜pollutes’ source folders.

From python's help:
-B Don’t write .py[co] files on import. See also PYTHONDONTWRITEBYTECODE.

Patch by Pere Mato (D30604)!

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

7 years agoDo not set branch weight if the branch weight annotation is present.
Dehao Chen [Thu, 23 Mar 2017 14:43:10 +0000 (14:43 +0000)]
Do not set branch weight if the branch weight annotation is present.

Summary: ThinLTO will annotate the CFG twice. If the branch weight is set by the first annotation, we should not set the branch weight again in the second annotation because the first annotation is more accurate as there is less optimization that could affect debug info accuracy.

Reviewers: tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: mehdi_amini, aprantl, llvm-commits

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

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

7 years agoX86FixupBWInsts: Minor cleanup. NFC
Zvi Rackover [Thu, 23 Mar 2017 14:08:26 +0000 (14:08 +0000)]
X86FixupBWInsts: Minor cleanup. NFC

Summary: Cleanup some remnants of code from when the X86FixupBWInsts pass did both forward liveness analysis and backward liveness analysis.

Reviewers: MatzeB, myatsina, DavidKreitzer

Reviewed By: MatzeB

Subscribers: llvm-commits

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

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

7 years ago[Mips] Emit the correct DINS variant
Strahinja Petrovic [Thu, 23 Mar 2017 13:40:07 +0000 (13:40 +0000)]
[Mips] Emit the correct DINS variant

This patch fixes emitting of correct variant of DINS instruction.

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

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

7 years ago[X86][SSE] Tidyup canWidenShuffleElements. NFCI.
Simon Pilgrim [Thu, 23 Mar 2017 13:33:03 +0000 (13:33 +0000)]
[X86][SSE] Tidyup canWidenShuffleElements. NFCI.

Pull out mask elements at the start, allowing us to make the widening pattern matching more readable.

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

7 years ago[Mips] Fix for decoding DINS instruction - disassembler
Strahinja Petrovic [Thu, 23 Mar 2017 13:19:04 +0000 (13:19 +0000)]
[Mips] Fix for decoding DINS instruction - disassembler

This patch fixes decoding of size and position for DINSM
and DINSU instructions.

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

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

7 years ago[X86][SSE] Add computeNumSignBits test for sitofp of (extended) i64 extracted element
Simon Pilgrim [Thu, 23 Mar 2017 13:18:09 +0000 (13:18 +0000)]
[X86][SSE] Add computeNumSignBits test for sitofp of (extended) i64 extracted element

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

7 years ago[GlobalISel][X86] clang-format. NFC
Igor Breger [Thu, 23 Mar 2017 12:13:29 +0000 (12:13 +0000)]
[GlobalISel][X86] clang-format. NFC

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

7 years ago[X86][TD][vpmovm2 ] New TD pattern for the vpmovm2 instruction
Michael Zuckerman [Thu, 23 Mar 2017 09:57:01 +0000 (09:57 +0000)]
[X86][TD][vpmovm2 ] New TD pattern for the vpmovm2 instruction

Up until now, vpmovm2 instruction described its destination operand size
by the source operand size. This patch adds new pattern for the vpmovm2
instruction. The node describes new expansion of the destination (from
{128|256} to 512).

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

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

7 years ago[ValueTracking] Use APInt::isNegative instead of using operator[BitWidth-1]. NFCI
Craig Topper [Thu, 23 Mar 2017 07:06:42 +0000 (07:06 +0000)]
[ValueTracking] Use APInt::isNegative instead of using operator[BitWidth-1]. NFCI

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

7 years ago[ValueTracking] Use setAllBits/setSignBit/setLowBits/setHighBits. NFCI
Craig Topper [Thu, 23 Mar 2017 07:06:39 +0000 (07:06 +0000)]
[ValueTracking] Use setAllBits/setSignBit/setLowBits/setHighBits. NFCI

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

7 years ago[IR] Use a binary search in DataLayout::getAlignmentInfo
Craig Topper [Thu, 23 Mar 2017 06:15:56 +0000 (06:15 +0000)]
[IR] Use a binary search in DataLayout::getAlignmentInfo

Summary:
We currently do a linear scan through all of the Alignments array entries anytime getAlignmentInfo is called. I noticed while profiling compile time on a -O2 opt run that this function can be called quite frequently and was showing about as about 1% of the time in callgrind.

This patch puts the Alignments array into a sorted order by type and then by bitwidth. We can then do a binary search. And use the sorted nature to handle the special cases for INTEGER_ALIGN. Some of this is modeled after the sorting/searching we do for pointers already.

This reduced the time spent in this routine by about 2/3 in the one compilation I was looking at.

We could maybe improve this more by using a DenseMap to cache the results, but just sorting was easy and didn't require extra data structure. And I think it made the integer handling simpler.

Reviewers: sanjoy, davide, majnemer, resistor, arsenm, mehdi_amini

Reviewed By: arsenm

Subscribers: arsenm, llvm-commits

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

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

7 years ago[IR] Mark Use::getUser and Use::getImpliedUse as LLVM_READONLY.
Craig Topper [Thu, 23 Mar 2017 05:25:25 +0000 (05:25 +0000)]
[IR] Mark Use::getUser and Use::getImpliedUse as LLVM_READONLY.

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

7 years ago[ARM] Reduce code duplication by factoring out in a lambda. NFCI.
Davide Italiano [Thu, 23 Mar 2017 01:34:45 +0000 (01:34 +0000)]
[ARM] Reduce code duplication by factoring out in a lambda. NFCI.

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

7 years ago[codeview] Move type index remapping logic to type merger
Reid Kleckner [Thu, 23 Mar 2017 00:14:23 +0000 (00:14 +0000)]
[codeview] Move type index remapping logic to type merger

Summary:
This removes the 'remapTypeIndices' method on every TypeRecord class. My
original idea was that this would be the beginning of some kind of
generic entry point that would enumerate all of the TypeIndices inside
of a TypeRecord, so that we could write generic graph algorithms for
them without duplicating the knowledge of which fields are type index
fields everywhere. This never happened, and nothing else uses this
method. I need to change the API to deal with merging into IPI streams,
so let's move it into the file that uses it first.

Reviewers: zturner, ruiu

Reviewed By: zturner, ruiu

Subscribers: mgorny, llvm-commits

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

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

7 years ago[AArch64] Drive-by cleanup, make this code shorter. NFCI.
Davide Italiano [Wed, 22 Mar 2017 23:37:58 +0000 (23:37 +0000)]
[AArch64] Drive-by cleanup, make this code shorter. NFCI.

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

7 years agoReapply r298417 "[ARM] Recommit the glueless lowering of addc/adde in Thumb1"
Artyom Skrobov [Wed, 22 Mar 2017 23:35:51 +0000 (23:35 +0000)]
Reapply r298417 "[ARM] Recommit the glueless lowering of addc/adde in Thumb1"

The UB in t2_so_imm_neg conversion has been addressed under D31242 / r298512

This reverts commit r298482.

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

7 years ago[AMDGPU] Do not emit isa info as code object metadata
Konstantin Zhuravlyov [Wed, 22 Mar 2017 23:27:09 +0000 (23:27 +0000)]
[AMDGPU] Do not emit isa info as code object metadata
  - It was decided to expose this information through other means (rocr)

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

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

7 years ago[ARM] simplifying t2_so_imm_neg as suggested by Eli Friedman in D31242 (NFC)
Artyom Skrobov [Wed, 22 Mar 2017 23:12:59 +0000 (23:12 +0000)]
[ARM] simplifying t2_so_imm_neg as suggested by Eli Friedman in D31242 (NFC)

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

7 years ago[AMDGPU] Emit kernel debug properties as code object metadata
Konstantin Zhuravlyov [Wed, 22 Mar 2017 23:10:46 +0000 (23:10 +0000)]
[AMDGPU] Emit kernel debug properties as code object metadata

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

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

7 years ago[AMDGPU] Emit kernel code properties as code object metadata
Konstantin Zhuravlyov [Wed, 22 Mar 2017 22:54:39 +0000 (22:54 +0000)]
[AMDGPU] Emit kernel code properties as code object metadata
  - These are not required for low level runtime

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

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

7 years agoClean up some Subtarget uses and casts in the X86 backend, removing unnecessary work...
Eric Christopher [Wed, 22 Mar 2017 22:44:52 +0000 (22:44 +0000)]
Clean up some Subtarget uses and casts in the X86 backend, removing unnecessary work or calls.

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

7 years ago[x86] improve tests, add tests, auto-generate checks; NFC
Sanjay Patel [Wed, 22 Mar 2017 22:39:17 +0000 (22:39 +0000)]
[x86] improve tests, add tests, auto-generate checks; NFC

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

7 years ago[AMDGPU] Restructure code object metadata creation
Konstantin Zhuravlyov [Wed, 22 Mar 2017 22:32:22 +0000 (22:32 +0000)]
[AMDGPU] Restructure code object metadata creation
  - Rename runtime metadata -> code object metadata
  - Make metadata not flow
  - Switch enums to use ScalarEnumerationTraits
  - Cleanup and move AMDGPUCodeObjectMetadata.h to AMDGPU/MCTargetDesc
  - Introduce in-memory representation for attributes
  - Code object metadata streamer
  - Create metadata for isa and printf during EmitStartOfAsmFile
  - Create metadata for kernel during EmitFunctionBodyStart
  - Finalize and emit metadata to .note during EmitEndOfAsmFile
  - Other minor improvements/bug fixes

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

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

7 years ago[AMDGPU] Fix bug 31610
Konstantin Zhuravlyov [Wed, 22 Mar 2017 21:48:18 +0000 (21:48 +0000)]
[AMDGPU] Fix bug 31610

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

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

7 years agoc++filt: support COFF import thunks
Saleem Abdulrasool [Wed, 22 Mar 2017 21:15:19 +0000 (21:15 +0000)]
c++filt: support COFF import thunks

The synthetic thunk for the import is prefixed with __imp_.  Attempt to
undecorate the names when they begin with the __imp_ prefix.

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

7 years ago[libFuzzer] add two experimental flags to make corpus merging more scalable: -save_co...
Kostya Serebryany [Wed, 22 Mar 2017 20:32:44 +0000 (20:32 +0000)]
[libFuzzer] add two experimental flags to make corpus merging more scalable: -save_coverage_summary/-load_coverage_summary. This is still WIP, the documentation will come later if these flags survive

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

7 years ago[LVI] Add an LVI printer pass to capture test LVI cache after transformations
Anna Thomas [Wed, 22 Mar 2017 19:27:12 +0000 (19:27 +0000)]
[LVI] Add an LVI printer pass to capture test LVI cache after transformations

Summary:
Adding a printer pass for printing the LVI cache values after transformations
that use LVI.
This will help us in identifying cases where LVI
invariants are violated, or transforms that leave LVI in an incorrect state.
Right now, I have added two test cases to show that the printer pass is working.
I will be adding more test cases in a later change, once this change is
checked in upstream.

Reviewers: reames, dberlin, sanjoy, apilipenko

Subscribers: llvm-commits

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

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

7 years agoPreserve nonnull metadata on Loads through SROA & mem2reg.
Luqman Aden [Wed, 22 Mar 2017 19:16:39 +0000 (19:16 +0000)]
Preserve nonnull metadata on Loads through SROA & mem2reg.

Summary:
https://llvm.org/bugs/show_bug.cgi?id=31142 :

SROA was dropping the nonnull metadata on loads from allocas that got optimized out. This patch simply preserves nonnull metadata on loads through SROA and mem2reg.

Reviewers: chandlerc, efriedma

Reviewed By: efriedma

Subscribers: hfinkel, spatel, efriedma, arielb1, davide, llvm-commits

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

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

7 years agoIPO: Const correctness for summaries passed into passes.
Peter Collingbourne [Wed, 22 Mar 2017 18:22:59 +0000 (18:22 +0000)]
IPO: Const correctness for summaries passed into passes.

Pass const qualified summaries into importers and unqualified summaries into
exporters. This lets us const-qualify the summary argument to thinBackend.

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

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

7 years agoIR: Fix a race condition in type id clients of ModuleSummaryIndex.
Peter Collingbourne [Wed, 22 Mar 2017 18:04:39 +0000 (18:04 +0000)]
IR: Fix a race condition in type id clients of ModuleSummaryIndex.

Add a const version of the getTypeIdSummary accessor that avoids
mutating the TypeIdMap.

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

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

7 years agoDocument the status quo of DIExpression semantics in LangRef.rst
Adrian Prantl [Wed, 22 Mar 2017 18:01:01 +0000 (18:01 +0000)]
Document the status quo of DIExpression semantics in LangRef.rst

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

7 years agoRename helper functions in DwarfExpression to be less misleading (NFC)
Adrian Prantl [Wed, 22 Mar 2017 17:19:55 +0000 (17:19 +0000)]
Rename helper functions in DwarfExpression to be less misleading (NFC)

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

7 years agoFix testcase on windows.
Adrian Prantl [Wed, 22 Mar 2017 17:15:03 +0000 (17:15 +0000)]
Fix testcase on windows.

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

7 years ago[InstCombine] canonicalize insertelement of scalar constant ahead of insertelement...
Sanjay Patel [Wed, 22 Mar 2017 17:10:44 +0000 (17:10 +0000)]
[InstCombine] canonicalize insertelement of scalar constant ahead of insertelement of variable

insertelement (insertelement X, Y, IdxC1), ScalarC, IdxC2 -->
insertelement (insertelement X, ScalarC, IdxC2), Y, IdxC1

As noted in the code comment and seen in the test changes, the motivation is that by pulling
constant insertion up, we may be able to constant fold some insertelement instructions.

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

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

7 years agoFix PR32298 by adding an early exit to getFrameIndexExprs().
Adrian Prantl [Wed, 22 Mar 2017 16:50:16 +0000 (16:50 +0000)]
Fix PR32298 by adding an early exit to getFrameIndexExprs().

Also add an assertion for the case that there are multiple FI
expressions with a DW_OP_LLVM_fragment; which should violate internal
constraints in DbgVariable.

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

7 years agoMake the home_directory test a little more resilient.
Zachary Turner [Wed, 22 Mar 2017 16:30:06 +0000 (16:30 +0000)]
Make the home_directory test a little more resilient.

It's possible (albeit strange) for $HOME to intentionally
point somewhere other than the user's home directory as
reported by the password database.  Our test shouldn't fail
in this case.  This patch updates the test to pull directly
from the password database before unsetting $HOME, rather
than comparing the return value of home_directory() to the
original value of the environment variable.

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

7 years agoMake home_directory look in the password database in addition to $HOME.
Zachary Turner [Wed, 22 Mar 2017 15:24:59 +0000 (15:24 +0000)]
Make home_directory look in the password database in addition to $HOME.

This is something of an edge case, but when the $HOME environment
variable is not set, we can still look in the password database
to get the current user's home directory.

Added a test for this by getting the value of $HOME, then unsetting
it, then calling home_directory() and verifying that it succeeds
and that the value is the same as what we originally read from
the environment.

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

7 years ago[ARM] t2_so_imm_neg had a subtle bug in the conversion, and could trigger UB by negat...
Artyom Skrobov [Wed, 22 Mar 2017 15:09:30 +0000 (15:09 +0000)]
[ARM] t2_so_imm_neg had a subtle bug in the conversion, and could trigger UB by negating (int)-2147483648. By pure luck, none of the pre-existing tests triggered this; so I'm adding one.

Summary: Thanks to Vitaly Buka for helping catch this.

Reviewers: rengolin, jmolloy, efriedma, vitalybuka

Subscribers: llvm-commits, aemerson

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

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

7 years agoAdd default typo to .tbss.*
Rafael Espindola [Wed, 22 Mar 2017 14:04:19 +0000 (14:04 +0000)]
Add default typo to .tbss.*

This matches gas behavior and is part of pr31888.

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

7 years agoSet the default type for .bss.foo.
Rafael Espindola [Wed, 22 Mar 2017 13:57:16 +0000 (13:57 +0000)]
Set the default type for .bss.foo.

This matches gas and is part of pr31888.

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

7 years agoProduce INIT_ARRAY for sections named .init_array.*
Rafael Espindola [Wed, 22 Mar 2017 13:35:41 +0000 (13:35 +0000)]
Produce INIT_ARRAY for sections named .init_array.*

These sections are merged together by the linker, so they should have
the same time.

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

7 years ago[AMDGPU][MC] Fix for Bug 28204 + LIT tests
Dmitry Preobrazhensky [Wed, 22 Mar 2017 13:31:01 +0000 (13:31 +0000)]
[AMDGPU][MC] Fix for Bug 28204 + LIT tests

Fixed v_mad_i64_i32/u64_u32 encoding

Reviewers: artem.tamazov

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

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

7 years ago[CMake] Use variable interpolation instead of string concatenation
Serge Pavlov [Wed, 22 Mar 2017 12:06:11 +0000 (12:06 +0000)]
[CMake] Use variable interpolation instead of string concatenation

String concatenation used in r298336 allowed to get rid of extra spaces
but also resulted in lost delimiter spaces, so use previous method.

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

7 years ago[X86] Add multiply by constant tests (PR28513)
Simon Pilgrim [Wed, 22 Mar 2017 12:03:56 +0000 (12:03 +0000)]
[X86] Add multiply by constant tests (PR28513)

As discussed on PR28513, add tests for constant multiplication by constants between 1 to 32

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

7 years agor286814 resulted that CallPenalty can be subtracted twice:
Evgeny Astigeevich [Wed, 22 Mar 2017 12:01:57 +0000 (12:01 +0000)]
r286814 resulted that CallPenalty can be subtracted twice:
- First time, during calculation of the cost in InlineCost.cpp
- Second time, during calculation of the cost in Inliner.cpp

This patches fixes this.

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

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

7 years ago[X86] Remove unnecessary duplicate code (PR30649). NFCI.
Simon Pilgrim [Wed, 22 Mar 2017 11:23:49 +0000 (11:23 +0000)]
[X86] Remove unnecessary duplicate code (PR30649). NFCI.

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

7 years agoRevert "[ScalarEvolution] Predicate implication from operations"
Max Kazantsev [Wed, 22 Mar 2017 07:50:33 +0000 (07:50 +0000)]
Revert "[ScalarEvolution] Predicate implication from operations"

This reverts commit rL298481

Fails clang-with-lto-ubuntu build.

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

7 years ago[ValueTracking] Make sure we keep range metadata information when calculating known...
Craig Topper [Wed, 22 Mar 2017 07:22:49 +0000 (07:22 +0000)]
[ValueTracking] Make sure we keep range metadata information when calculating known bits for calls to bitreverse intrinsic.

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

7 years ago[ValueTracking] use setLowBits/setHighBits/setBitsFrom to replace |= getHighBits...
Craig Topper [Wed, 22 Mar 2017 06:19:37 +0000 (06:19 +0000)]
[ValueTracking] use setLowBits/setHighBits/setBitsFrom to replace |= getHighBits/getLowBits. NFCI

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

7 years ago[X86] Remove an unused function from release builds. Reported by gccs unused function...
Craig Topper [Wed, 22 Mar 2017 06:07:58 +0000 (06:07 +0000)]
[X86] Remove an unused function from release builds. Reported by gccs unused function warning.

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

7 years ago[SystemZ] Don't drop any operands in expandZExtPseudo()
Jonas Paulsson [Wed, 22 Mar 2017 06:03:32 +0000 (06:03 +0000)]
[SystemZ]  Don't drop any operands in expandZExtPseudo()

Make sure that any operands, e.g. of an implicit def of a super reg is
transferred to the new instruction.

Review: Ulrich Weigand

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

7 years agoRevert "[ARM] Recommit the glueless lowering of addc/adde in Thumb1, including the...
Vitaly Buka [Wed, 22 Mar 2017 05:07:44 +0000 (05:07 +0000)]
Revert "[ARM] Recommit the glueless lowering of addc/adde in Thumb1, including the amended (no UB anymore) fix for adding/subtracting -2147483648."

Fails check-llvm with ubsan

This reverts commit r298417.

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

7 years ago[ScalarEvolution] Predicate implication from operations
Max Kazantsev [Wed, 22 Mar 2017 04:48:46 +0000 (04:48 +0000)]
[ScalarEvolution] Predicate implication from operations

This patch allows SCEV predicate analysis to prove implication of some expression predicates
from context predicates related to arguments of those expressions.
It introduces three new rules:

For addition:
  (A >X && B >= 0) || (B >= 0 && A > X) ===> (A + B) > X.

For division:
  (A > X) && (0 < B <= X + 1) ===> (A / B > 0).
  (A > X) && (-B <= X < 0) ===> (A / B >= 0).

Using these rules, SCEV is able to prove facts like "if X > 1 then X / 2 > 0".
They can also be combined with the same context, to prove more complex expressions like
"if X > 1 then X/2 + 1 > 1".

Diffirential Revision: https://reviews.llvm.org/D30887

Reviewed by: sanjoy

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

7 years agolit: remove python2-isms
Brian Gesiak [Wed, 22 Mar 2017 04:23:01 +0000 (04:23 +0000)]
lit: remove python2-isms

Summary:
`assert.assertItemEqual` went away in Python 3. Seeing how lists
are ordered, comparing a list against each other should work just
as well.

Patch by @jbergstroem (Johan Bergström).

Reviewers: modocache, gparker42

Reviewed By: modocache

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

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

7 years ago[InstCombine] Teach SimplifyDemandedUseBits to shrink Constants on the left side...
Craig Topper [Wed, 22 Mar 2017 04:03:53 +0000 (04:03 +0000)]
[InstCombine] Teach SimplifyDemandedUseBits to shrink Constants on the left side of subtracts

Summary: Subtracts can have constants on the left side, but we don't shrink them based on demanded bits. This patch fixes that to match the right hand side.

Reviewers: davide, majnemer, spatel, sanjoy, hfinkel

Reviewed By: spatel

Subscribers: llvm-commits

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

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

7 years ago[codeview] Use separate records for LF_SUBSTR_LIST and LF_ARGLIST
Reid Kleckner [Wed, 22 Mar 2017 01:37:38 +0000 (01:37 +0000)]
[codeview] Use separate records for LF_SUBSTR_LIST and LF_ARGLIST

They are structurally the same, but now we need to distinguish them
because one record lives in the IPI stream and the other lives in TPI.

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

7 years ago[GlobalISel]: Create VREGs for ConstantInt args
Aditya Nandakumar [Wed, 22 Mar 2017 01:16:39 +0000 (01:16 +0000)]
[GlobalISel]: Create VREGs for ConstantInt args

This patch changes the behavior of IRTranslating intrinsics where we
now create VREG + G_CONSTANT for ConstantInt values. We already do this
for FloatingPoint values. This makes it easier for the backends to
select code and it won't have to de-duplicate creation+selection of
constants.

Reviewed by: ab

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

7 years agoDon't compose DWARF expressions with multiple subregisters.
Adrian Prantl [Wed, 22 Mar 2017 01:16:01 +0000 (01:16 +0000)]
Don't compose DWARF expressions with multiple subregisters.

If a register location can only be described by a complex expression
(i.e., multiple subregisters) it doesn't safely compose with another
complex expression. For example, it is not possible to apply a
DW_OP_deref operation to multiple DW_OP_pieces.

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

7 years agoDwarfExpression: Defer emitting DWARF register operations
Adrian Prantl [Wed, 22 Mar 2017 01:15:57 +0000 (01:15 +0000)]
DwarfExpression: Defer emitting DWARF register operations
until the rest of the expression is known.

This is still an NFC refactoring in preparation of a subsequent bugfix.

This reapplies r298388 with a bugfix for non-physical frame registers.

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

7 years agoMake test more robust
Adam Nemet [Tue, 21 Mar 2017 23:50:52 +0000 (23:50 +0000)]
Make test more robust

Set the flags on FAdd locally rather than assuming nothing will change it from
way earlier in the test.

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

7 years agoResubmit "Improve StringMap iterator support."
Zachary Turner [Tue, 21 Mar 2017 23:45:03 +0000 (23:45 +0000)]
Resubmit "Improve StringMap iterator support."

The issue was trying to advance past the end of the iterator
when computing the end() iterator.

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

7 years ago[GlobalISel] Update DBG_VALUEs referencing DCE'd instructions.
Ahmed Bougacha [Tue, 21 Mar 2017 23:42:54 +0000 (23:42 +0000)]
[GlobalISel] Update DBG_VALUEs referencing DCE'd instructions.

Quentin points out that r298358 would cause us to emit different code
with debug info.  That's a big no-no; also erase the instructions that
only live thanks to DBG_VALUE users.

Adrian explained how this is an existing problem and an OK thing to do:
clang has allocas for all variables so shouldn't be affected at -O0, but
swift uses a bit of inlineasm to explicitly keep values live for the
purpose of debug info quality.  I'm not sure there is a better scheme.

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

7 years ago[GlobalISel] Don't translate br to layout successor.
Ahmed Bougacha [Tue, 21 Mar 2017 23:42:50 +0000 (23:42 +0000)]
[GlobalISel] Don't translate br to layout successor.

MI can represent fallthrough to layout successor blocks, and our
post-isel representation uses that extensively.

We might as well use it too, to avoid translating and carrying along
unnecessary branches.

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

7 years ago[IR] Remove validAlignment and validPointer methods DataLayout as they aren't used.
Craig Topper [Tue, 21 Mar 2017 23:04:23 +0000 (23:04 +0000)]
[IR] Remove validAlignment and validPointer methods DataLayout as they aren't used.

I don't think validAlignment has been used since r34358 in 2007. I think validPointer was copied from validAlignment some time later, but it definitely wasn't used in the first commit that contained it.

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

7 years agoAMDGPU: Remove hasSideEffects from SI_RETURN_TO_EPILOG
Matt Arsenault [Tue, 21 Mar 2017 22:28:48 +0000 (22:28 +0000)]
AMDGPU: Remove hasSideEffects from SI_RETURN_TO_EPILOG

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

7 years agoGlobalISel: respect BooleanContents when extending i1.
Tim Northover [Tue, 21 Mar 2017 22:22:05 +0000 (22:22 +0000)]
GlobalISel: respect BooleanContents when extending i1.

The world isn't just x86 & ARM, some targets need to store -1 into the byte
when legalizing a bool store.

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

7 years agoAMDGPU: Rename SI_RETURN
Matt Arsenault [Tue, 21 Mar 2017 22:18:10 +0000 (22:18 +0000)]
AMDGPU: Rename SI_RETURN

This is used for a specific type of return to a shader part's
epilog code. Rename to try avoiding confusion from a true
call's return.

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

7 years agoSplitKit: Fix subreg copy related problems
Matthias Braun [Tue, 21 Mar 2017 21:58:08 +0000 (21:58 +0000)]
SplitKit: Fix subreg copy related problems

Fix two problems related to r298025:
- SplitKit would create duplicate VNIs in some cases leading to crashs
  when hoisting copies.
- VirtRegMap could fail expanding copies at the beginning of a basic
  block.

This fixes http://llvm.org/PR32353

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