OSDN Git Service

android-x86/external-llvm.git
6 years agoHardware-assisted AddressSanitizer (llvm part).
Evgeniy Stepanov [Sat, 9 Dec 2017 00:21:41 +0000 (00:21 +0000)]
Hardware-assisted AddressSanitizer (llvm part).

Summary:
This is LLVM instrumentation for the new HWASan tool. It is basically
a stripped down copy of ASan at this point, w/o stack or global
support. Instrumenation adds a global constructor + runtime callbacks
for every load and store.

HWASan comes with its own IR attribute.

A brief design document can be found in
clang/docs/HardwareAssistedAddressSanitizerDesign.rst (submitted earlier).

Reviewers: kcc, pcc, alekseyshl

Subscribers: srhines, mehdi_amini, mgorny, javed.absar, eraman, llvm-commits, hiraditya

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

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

6 years agoFix out-of-order stepping behavior in programs with sunk instructions.
Paul Robinson [Sat, 9 Dec 2017 00:17:01 +0000 (00:17 +0000)]
Fix out-of-order stepping behavior in programs with sunk instructions.

MachineSink attempts to place instructions near the basic blocks where
they are needed.  Once an instruction has been sunk, its location
relative to other instructions no longer is consistent with the
original source code. In order to ensure correct stepping in the
debugger, the debug location for sunk instructions is either merged
with the insertion point or erased if the target successor block is
empty.

Originally submitted as r318679, revised to fix sanitizer failure and
improve testing.

Patch by Matthew Voss!

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

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

6 years agodwarfdump: Add support for the --diff option.
Adrian Prantl [Fri, 8 Dec 2017 23:32:47 +0000 (23:32 +0000)]
dwarfdump: Add support for the --diff option.

--diff      Emit the output in a diff-friendly way by omitting offsets and
            addresses.

<rdar://problem/34502625>

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

6 years ago[X86][Mips] Remove unused method declaration from the X86 and Mips AsmPrinters.
Craig Topper [Fri, 8 Dec 2017 23:30:03 +0000 (23:30 +0000)]
[X86][Mips] Remove unused method declaration from the X86 and Mips AsmPrinters.

Both had a declaration of EmitXRayTable, but there is no method defined in either with that name. There is a emitXRayTable in the base class with a lower case 'e' and they both call that.

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

6 years ago[CodeGen] Move printing MO_Immediate operands to MachineOperand::print
Francis Visoiu Mistrih [Fri, 8 Dec 2017 22:53:21 +0000 (22:53 +0000)]
[CodeGen] Move printing MO_Immediate operands to MachineOperand::print

Work towards the unification of MIR and debug output by refactoring the
interfaces.

Add support for operand subreg index as an immediate to debug printing
and use ::print in the MIRPrinter.

Differential Review: https://reviews.llvm.org/D40965

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

6 years agoRevert part of "Cleanup some GraphTraits iteration code"
Duncan P. N. Exon Smith [Fri, 8 Dec 2017 22:42:43 +0000 (22:42 +0000)]
Revert part of "Cleanup some GraphTraits iteration code"

This reverts part of r300656, which caused a regression in
propagateMassToSuccessors by counting edges n^2 times, where n is the
number of edges from the source basic block to the same successor basic
block. The result was both incorrect and very slow to compute for large
values of n (e.g. switches with multiple cases that go to the same basic
block).

Patch by Andrew Scheidecker!

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

6 years agoAvoid constructing an out-of-range value for an enumeration (which results in UB).
Richard Smith [Fri, 8 Dec 2017 22:32:35 +0000 (22:32 +0000)]
Avoid constructing an out-of-range value for an enumeration (which results in UB).

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

6 years ago[AArch64] Rename AArch64VecorByElementOpt.cpp into AArch64SIMDInstrOpt.cpp to reflect...
Abderrazek Zaafrani [Fri, 8 Dec 2017 22:04:13 +0000 (22:04 +0000)]
[AArch64] Rename AArch64VecorByElementOpt.cpp into AArch64SIMDInstrOpt.cpp to reflect the recently added features.

The name change is dicsussed in https://reviews.llvm.org/D38196

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

6 years agoGeneralize llvm::replaceDbgDeclare and actually support the use-case that
Adrian Prantl [Fri, 8 Dec 2017 21:58:18 +0000 (21:58 +0000)]
Generalize llvm::replaceDbgDeclare and actually support the use-case that
is mentioned in the documentation (inserting a deref before the plus_uconst).

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

6 years ago[Debugify] Add a pass to test debug info preservation
Vedant Kumar [Fri, 8 Dec 2017 21:57:28 +0000 (21:57 +0000)]
[Debugify] Add a pass to test debug info preservation

The Debugify pass synthesizes debug info for IR. It's paired with a
CheckDebugify pass which determines how much of the original debug info
is preserved. These passes make it easier to create targeted tests for
debug info preservation.

Here is the Debugify algorithm:

  NextLine = 1
  for (Instruction &I : M)
    attach DebugLoc(NextLine++) to I

  NextVar = 1
  for (Instruction &I : M)
    if (canAttachDebugValue(I))
      attach dbg.value(NextVar++) to I

The CheckDebugify pass expects contiguous ranges of DILocations and
DILocalVariables. If it fails to find all of the expected debug info, it
prints a specific error to stderr which can be FileChecked.

This was discussed on llvm-dev in the thread:
"Passes to add/validate synthetic debug info"

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

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

6 years ago[CodeExtractor] Add debug locations for new call and branch instrs.
Florian Hahn [Fri, 8 Dec 2017 21:49:03 +0000 (21:49 +0000)]
[CodeExtractor] Add debug locations for new call and branch instrs.

Summary:
If a partially inlined function has debug info, we have to add debug
locations to the call instruction calling the outlined function.
We use the debug location of the first instruction in the outlined
function, as the introduced call transfers control to this statement and
there is no other equivalent line in the source code.

We also use the same debug location for the branch instruction added
to jump from artificial entry block for the outlined function, which just
jumps to the first actual basic block of the outlined function.

Reviewers: davide, aprantl, rriddle, dblaikie, danielcdh, wmi

Reviewed By: aprantl, rriddle, danielcdh

Subscribers: eraman, JDevlieghere, llvm-commits

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

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

6 years ago[WebAssembly] Reapply r319186: "Support bitcasted function addresses with varargs."
Dan Gohman [Fri, 8 Dec 2017 21:27:00 +0000 (21:27 +0000)]
[WebAssembly] Reapply r319186: "Support bitcasted function addresses with varargs."

This puts the functionality under control of a command-line option which is
off by default to avoid breaking existing setups.

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

6 years ago[WebAssemby] Re-apply r320041: "Support main functions with alternate signatures."
Dan Gohman [Fri, 8 Dec 2017 21:18:21 +0000 (21:18 +0000)]
[WebAssemby] Re-apply r320041: "Support main functions with alternate signatures."

This includes a fix so that it doesn't transform declarations, and it
puts the functionality under control of a command-line option which is off
by default to avoid breaking existing setups.

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

6 years ago[AArch64] Add Exynos to host detection
Evandro Menezes [Fri, 8 Dec 2017 21:09:59 +0000 (21:09 +0000)]
[AArch64] Add Exynos to host detection

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

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

6 years agoAMDGPU/GCN: Bring processors in sync with AMDGPUUsage
Konstantin Zhuravlyov [Fri, 8 Dec 2017 20:52:28 +0000 (20:52 +0000)]
AMDGPU/GCN: Bring processors in sync with AMDGPUUsage

  - Add gfx704
    - Change bonaire to gfx704
  - Remove gfx804
  - Remove gfx901
  - Remove gfx903

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

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

6 years ago[X86] CMOV pseudo instructions shouldn't need scheduling info as they should be lower...
Simon Pilgrim [Fri, 8 Dec 2017 20:42:35 +0000 (20:42 +0000)]
[X86] CMOV pseudo instructions shouldn't need scheduling info as they should be lowered early

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

6 years ago[X86][X87] Tag x87 load/store instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 20:31:48 +0000 (20:31 +0000)]
[X86][X87] Tag x87 load/store instructions scheduler classes

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

6 years ago[X86] Teach lowering to only let through (insert_subvector (vXi1 zeros), subvec,...
Craig Topper [Fri, 8 Dec 2017 20:10:33 +0000 (20:10 +0000)]
[X86] Teach lowering to only let through (insert_subvector (vXi1 zeros), subvec, 0) for vector sizes that have native KSHIFT support.

For narrow sizes we'll widen the zero vector and widen the insert. Then do an extract_subvector to get back down to correct size.

This allows us to remove some patterns from the isel table that had to COPY_TO_REGCLASS to an oversized register, do the shift and then COPY_TO_REGCLASS back to the narrow register. Now this is represented explicitly in the DAG.

This seems to have perturbed the register allocation in one of the tests, but the number of instructions didn't change.

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

6 years ago[X86][X87] Tag x87 float compare instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 20:10:31 +0000 (20:10 +0000)]
[X86][X87] Tag x87 float compare instructions scheduler classes

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

6 years agoAMDGPU: Set IntrReadMem on memtime intrinsics
Matt Arsenault [Fri, 8 Dec 2017 20:01:02 +0000 (20:01 +0000)]
AMDGPU: Set IntrReadMem on memtime intrinsics

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

6 years agoAMDGPU: image_getlod and image_getresinfo do not read memory
Matt Arsenault [Fri, 8 Dec 2017 20:00:57 +0000 (20:00 +0000)]
AMDGPU: image_getlod and image_getresinfo do not read memory

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

6 years agoAMDGPU: Preserve MMO in adjustWritemask
Matt Arsenault [Fri, 8 Dec 2017 20:00:45 +0000 (20:00 +0000)]
AMDGPU: Preserve MMO in adjustWritemask

Follow up to r319705. Currently the MMO is
produced after this in the custom inserter,
so this doesn't change anything yet.

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

6 years ago[llvm] Add install-distribution-stripped
Shoaib Meenai [Fri, 8 Dec 2017 19:44:45 +0000 (19:44 +0000)]
[llvm] Add install-distribution-stripped

This is identical to the install-distribution target, except that it
strips the installed binaries.

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

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

6 years ago[cmake] Only pass CMAKE_SYSROOT if non-empty
Shoaib Meenai [Fri, 8 Dec 2017 19:42:47 +0000 (19:42 +0000)]
[cmake] Only pass CMAKE_SYSROOT if non-empty

In my build environment (cmake 3.6.1 and gcc 4.8.5 on CentOS 7), having
an empty CMAKE_SYSROOT in the cache results in --sysroot="" being passed
to all compile commands, and then the compiler errors out because of the
empty sysroot. Only set CMAKE_SYSROOT if non-empty to avoid this.

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

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

6 years ago[runtimes] Add install-*-stripped targets
Shoaib Meenai [Fri, 8 Dec 2017 19:42:46 +0000 (19:42 +0000)]
[runtimes] Add install-*-stripped targets

These should be the only remaining missing install-*-stripped targets.
They're modeled after the existing install targets.

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

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

6 years agoRevert r320104: infinite loop profiling bug fix
Xinliang David Li [Fri, 8 Dec 2017 19:38:07 +0000 (19:38 +0000)]
Revert r320104: infinite loop profiling bug fix

Causes unexpected memory issue with New PM this time.
The new PM invalidates BPI but not BFI, leaving the
reference to BPI from BFI invalid.

Abandon this patch.  There is a more general solution
which also handles runtime infinite loop (but not statically).

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

6 years ago[JumpThreading] Minor comment cleanup. NFC. (test commit)
Brian M. Rzycki [Fri, 8 Dec 2017 19:36:32 +0000 (19:36 +0000)]
[JumpThreading] Minor comment cleanup. NFC. (test commit)

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

6 years ago[X86][MPX] Tag TSX/HLE/SGX instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 19:26:22 +0000 (19:26 +0000)]
[X86][MPX] Tag TSX/HLE/SGX instructions scheduler classes

Currently tagged these as system instructions.

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

6 years agoAMDGPU: Report Arg's Value name in metadata if kernel_arg_name metadata is not available
Konstantin Zhuravlyov [Fri, 8 Dec 2017 19:22:12 +0000 (19:22 +0000)]
AMDGPU: Report Arg's Value name in metadata if kernel_arg_name metadata is not available

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

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

6 years agoReverting r320166 to fix test failures.
Michael Trent [Fri, 8 Dec 2017 19:09:26 +0000 (19:09 +0000)]
Reverting r320166 to fix test failures.

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

6 years ago[X86][MPX] Tag MPX instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 19:03:42 +0000 (19:03 +0000)]
[X86][MPX] Tag MPX instructions scheduler classes

Currently tagged these as system instructions, once we have uses for them (ASAN?) and they are faster we will need to improve on this.

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

6 years ago[x86] use hasAVX2() rather than hasInt256(); NFC
Sanjay Patel [Fri, 8 Dec 2017 18:35:51 +0000 (18:35 +0000)]
[x86] use hasAVX2() rather than hasInt256(); NFC

These are aliases, but the thing we're checking here is that the target has
vpsllv*, not that the data type is 256-bit. Those instructions exist for
128-bit vectors too...but sadly, not for all element sizes.

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

6 years ago[X86] Tag move immediate instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 18:35:40 +0000 (18:35 +0000)]
[X86] Tag move immediate instructions scheduler classes

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

6 years agoUpdated llvm-objdump to display local relocations in Mach-O binaries
Michael Trent [Fri, 8 Dec 2017 17:51:04 +0000 (17:51 +0000)]
Updated llvm-objdump to display local relocations in Mach-O binaries

Summary:
llvm-objdump's Mach-O parser was updated in r306037 to display external
relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O
parser to display local relocations for MH_PRELOAD files. When used with
the -macho option relocations will be displayed in a historical format.

rdar://35778019

Reviewers: enderby

Reviewed By: enderby

Subscribers: llvm-commits

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

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

6 years ago[DebugInfo] Use llc instead of llc_dwarf to fix this test.
Davide Italiano [Fri, 8 Dec 2017 17:15:50 +0000 (17:15 +0000)]
[DebugInfo] Use llc instead of llc_dwarf to fix this test.

We work around the fact that some platforms add a triple when
they expand llc_dwarf in lit.

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

6 years ago[X86][SHA] Tag SHA instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 16:38:41 +0000 (16:38 +0000)]
[X86][SHA] Tag SHA instructions scheduler classes

Put these under VecIMul itinerary classes for now - seems to be a good average value

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

6 years ago[X86] Tag VIA PadLock crypto instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 16:06:40 +0000 (16:06 +0000)]
[X86] Tag VIA PadLock crypto instructions scheduler classes

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

6 years ago[X86] Tag PKU/INVPCID/RDPID/SMAP/SMX/PTWRITE system instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 15:48:37 +0000 (15:48 +0000)]
[X86] Tag PKU/INVPCID/RDPID/SMAP/SMX/PTWRITE system instructions scheduler classes

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

6 years ago[InstCombine] PR35354: Convert store(bitcast, load bitcast (select (Cond, &V1, &V2...
Alexey Bataev [Fri, 8 Dec 2017 15:32:10 +0000 (15:32 +0000)]
[InstCombine] PR35354: Convert store(bitcast, load bitcast (select (Cond, &V1, &V2))  --> store (, load (select(Cond, load &V1, load &V2)))

Summary:
If we have the code like this:
```
float a, b;
a = std::max(a ,b);
```
it is converted into something like this:
```
%call = call dereferenceable(4) float* @_ZSt3maxIfERKT_S2_S2_(float* nonnull dereferenceable(4) %a.addr, float* nonnull dereferenceable(4) %b.addr)
%1 = bitcast float* %call to i32*
%2 = load i32, i32* %1, align 4
%3 = bitcast float* %a.addr to i32*
store i32 %2, i32* %3, align 4
```
After inlinning this code is converted to the next:
```
%1 = load float, float* %a.addr
%2 = load float, float* %b.addr
%cmp.i = fcmp fast olt float %1, %2
%__b.__a.i = select i1 %cmp.i, float* %a.addr, float* %b.addr
%3 = bitcast float* %__b.__a.i to i32*
%4 = load i32, i32* %3, align 4
%5 = bitcast float* %arrayidx to i32*
store i32 %4, i32* %5, align 4

```
This pattern is not recognized as minmax pattern.
Patch solves this problem by converting sequence
```
store (bitcast, (load bitcast (select ((cmp V1, V2), &V1, &V2))))
```
to a sequence
```
store (,load (select((cmp V1, V2), &V1, &V2)))
```
After this the code is recognized as minmax pattern.

Reviewers: RKSimon, spatel

Subscribers: llvm-commits

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

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

6 years ago[X86][AVX512] Tag CLWB instruction to CLFLUSH/PREFETCH scheduler class
Simon Pilgrim [Fri, 8 Dec 2017 15:19:10 +0000 (15:19 +0000)]
[X86][AVX512] Tag CLWB instruction to CLFLUSH/PREFETCH scheduler class

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

6 years ago[PatternMatch] Add matcher for LoadInst, NFC.
Alexey Bataev [Fri, 8 Dec 2017 15:17:37 +0000 (15:17 +0000)]
[PatternMatch] Add matcher for LoadInst, NFC.

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

6 years ago[X86][AVX512] Tag AVX512_512_SEXT_MASK_* instructions scheduler classes
Simon Pilgrim [Fri, 8 Dec 2017 15:17:32 +0000 (15:17 +0000)]
[X86][AVX512] Tag AVX512_512_SEXT_MASK_* instructions scheduler classes

Match VPTERNLOG which these pseudos will eventually alias to

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

6 years ago[AMDGPU] add labels to +DumpCode output
Tim Renouf [Fri, 8 Dec 2017 14:09:34 +0000 (14:09 +0000)]
[AMDGPU] add labels to +DumpCode output

Summary:
+DumpCode is a hack to embed disassembly in the ELF file. This commit
fixes it to include labels, to make it slightly more useful.

Reviewers: arsenm, kzhuravl

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

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

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

6 years ago[NFC] Rename variable from Cond to Pred to make it more sound
Max Kazantsev [Fri, 8 Dec 2017 12:54:32 +0000 (12:54 +0000)]
[NFC] Rename variable from Cond to Pred to make it more sound

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

6 years ago[SCEV] Fix predicate usage in computeExitLimitFromICmp
Max Kazantsev [Fri, 8 Dec 2017 12:19:45 +0000 (12:19 +0000)]
[SCEV] Fix predicate usage in computeExitLimitFromICmp

In this method, we invoke `SimplifyICmpOperands` which takes the `Cond` predicate
by reference and may change it along with `LHS` and `RHS` SCEVs. But then we invoke
`computeShiftCompareExitLimit` with Values from which the SCEVs have been derived,
these Values have not been modified while `Cond` could be.

One of possible outcomes of this is that we may falsely prove that an infinite loop ends
within some finite number of iterations.

In this patch, we save the original `Cond` and pass it along with original operands.
This logic may be removed in future once `computeShiftCompareExitLimit` works
with SCEVs instead of value operands.

Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D40953

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

6 years ago[CodeGen] Move printing MO_MachineBasicBlock operands to MachineOperand::print
Francis Visoiu Mistrih [Fri, 8 Dec 2017 11:48:02 +0000 (11:48 +0000)]
[CodeGen] Move printing MO_MachineBasicBlock operands to MachineOperand::print

Work towards the unification of MIR and debug output by refactoring the
interfaces.

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

6 years ago[CodeGen] Move printing MO_CImmediate operands to MachineOperand::print
Francis Visoiu Mistrih [Fri, 8 Dec 2017 11:40:06 +0000 (11:40 +0000)]
[CodeGen] Move printing MO_CImmediate operands to MachineOperand::print

Work towards the unification of MIR and debug output by refactoring the
interfaces.

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

6 years ago[cmake] Make setting of CMAKE_C(XX)_COMPILER flags overridable for cross-builds
Pavel Labath [Fri, 8 Dec 2017 09:59:48 +0000 (09:59 +0000)]
[cmake] Make setting of CMAKE_C(XX)_COMPILER flags overridable for cross-builds

Summary:
r319898 made it possible to override these variables via the
CROSS_TOOLCHAIN_FLAGS setting, but this only worked if one explicitly
specifies these variables there. If, instead, one uses
CROSS_TOOLCHAIN_FLAGS to specify a toolchain file (as our internal
builds do, to point cmake to a checked-in toolchain), the
CMAKE_C(XX)_COMPILER flags would still win over the ones specified by
the toolchain file.

To fix is to make the mere presence of these flags overridable. I do
this by putting them as a default value for the CROSS_TOOLCHAIN_FLAGS
setting, so they can be overridden at cmake configuration time.

Reviewers: hintonda, beanz

Subscribers: bogner, llvm-commits, mgorny

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

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

6 years ago[X86][Haswell]: Updating the scheduling information for the Haswell subtarget.
Gadi Haber [Fri, 8 Dec 2017 09:48:44 +0000 (09:48 +0000)]
[X86][Haswell]: Updating the scheduling information for the Haswell subtarget.

Updated the scheduling information for the Haswell subtarget with the following changes:

Regrouped the instructions after adding appropriate load + store latencies.
Added scheduling for missing instructions such as the GATHER instrs.
The changes were made after revisiting the latencies impact of all memory uOps.

Reviewers: RKSimon, zvi, craig.topper, apilipenko
Differential Revision: https://reviews.llvm.org/D40021

Change-Id: Iaf6c1f5169add1552845a8a566af4e5a359217a7

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

6 years ago[FuzzMutate] Correctly insert sinks and sources around invoke instructions
Igor Laevsky [Fri, 8 Dec 2017 08:53:16 +0000 (08:53 +0000)]
[FuzzMutate] Correctly insert sinks and sources around invoke instructions

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

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

6 years ago[X86] Always consider inserting a vXi1 vector into the lsbs of a zero vector to be...
Craig Topper [Fri, 8 Dec 2017 08:10:58 +0000 (08:10 +0000)]
[X86] Always consider inserting a vXi1 vector into the lsbs of a zero vector to be legal during lowering. Add isel patterns to emit shifts.

Previously we only allowed these through if the subvector came from a compare or test instruction which we would again check for during isel.

With this change we only check for the compare and test instructions during isel and have fallback patterns that emit the shifts if needed.

I noticed that in a lot of cases we don't actually see the compare during lowering and rely on an odd legalization of concat_vectors with a zero vector as the second argument. This keeps the concat_vectors around long enough for a later dag combine to expose the compare then we re-legalize the concat_vectors and catch the compare.

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

6 years ago[AArch64] Avoid SIMD interleaved store instruction for Exynos.
Abderrazek Zaafrani [Fri, 8 Dec 2017 00:58:49 +0000 (00:58 +0000)]
[AArch64] Avoid SIMD interleaved store instruction for Exynos.

Replace interleaved store instructions by equivalent and more efficient instructions based on latency cost model.
Https://reviews.llvm.org/D38196

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

6 years agoRevert "[WebAssemby] Support main functions with alternate signatures."
Derek Schuff [Fri, 8 Dec 2017 00:39:54 +0000 (00:39 +0000)]
Revert "[WebAssemby] Support main functions with alternate signatures."

This reverts commit 959e37e669b0c3cfad4cb9f1f7c9261ce9f5e9ae.
That commit doesn't handle the case where main is declared rather than defined,
in particular the even-more special case where main is a prototypeless
declaration (which is of course the one actually used by musl currently).

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

6 years ago[X86] Handle alls version of vXi1 insert_vector_elt with a constant index without...
Craig Topper [Fri, 8 Dec 2017 00:16:09 +0000 (00:16 +0000)]
[X86] Handle alls version of vXi1 insert_vector_elt with a constant index without falling back to shuffles.

We previously only supported inserting to the LSB or MSB where it was easy to zero to perform an OR to insert.

This change effectively extracts the old value and the new value, xors them together and then xors that single bit with the correct location in the original vector. This will cancel out the old value in the first xor leaving the new value in the position.

The way I've implemented this uses 3 shifts and two xors and uses an additional register. We can avoid the additional register at the cost of another shift.

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

6 years ago[X86] Fix indentation. NFC
Craig Topper [Fri, 8 Dec 2017 00:15:57 +0000 (00:15 +0000)]
[X86] Fix indentation. NFC

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

6 years ago[ORC] Mark SymbolStringPool methods as inline to avoid linkage errors, add a
Lang Hames [Thu, 7 Dec 2017 23:32:11 +0000 (23:32 +0000)]
[ORC] Mark SymbolStringPool methods as inline to avoid linkage errors, add a
less-than comparison to SymbolStringPtr and a corresponding unit test.

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

6 years ago[dump] Make LLVM_ENABLE_DUMP independent, and move to llvm-config.h
Don Hinton [Thu, 7 Dec 2017 22:55:40 +0000 (22:55 +0000)]
[dump] Make LLVM_ENABLE_DUMP independent, and move to llvm-config.h

Summary: Make LLVM_ENABLE_DUMP independent LLVM_ENABLE_ASSERTIONS,
move it to llvm-config.h, and update description.

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

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

6 years ago[PowerPC][asan] Update asan to handle changed memory layouts in newer kernels
Bill Seurer [Thu, 7 Dec 2017 22:53:33 +0000 (22:53 +0000)]
[PowerPC][asan] Update asan to handle changed memory layouts in newer kernels

In more recent Linux kernels with 47 bit VMAs the layout of virtual memory
for powerpc64 changed causing the address sanitizer to not work properly. This
patch adds support for 47 bit VMA kernels for powerpc64 and fixes up test
cases.

https://reviews.llvm.org/D40907

There is an associated patch for compiler-rt.

Tested on several 4.x and 3.x kernel releases.

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

6 years ago[DebugInfo] Fix register variables not showing up in pdb.
Zachary Turner [Thu, 7 Dec 2017 22:51:16 +0000 (22:51 +0000)]
[DebugInfo] Fix register variables not showing up in pdb.

Previously, when linking against libcmt from the MSVC runtime,
lld-link /verbose would show "Ignoring unknown symbol record
with kind 0x1006".  It turns out this was because
TypeIndexDiscovery did not handle S_REGISTER records, so these
records were not getting properly remapped.

Patch by: Alexnadre Ganea
Differential Revision: https://reviews.llvm.org/D40919

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

6 years ago[ModRefInfo] Make enum ModRefInfo an enum class [NFC].
Alina Sbirlea [Thu, 7 Dec 2017 22:41:34 +0000 (22:41 +0000)]
[ModRefInfo] Make enum ModRefInfo an enum class [NFC].

Summary:
Make enum ModRefInfo an enum class. Changes to ModRefInfo values should
be done using inline wrappers.
This should prevent future bit-wise opearations from being added, which can be more error-prone.

Reviewers: sanjoy, dberlin, hfinkel, george.burgess.iv

Subscribers: llvm-commits

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

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

6 years agoTemporarily revert "[PowerPC] Allow tail calls of fastcc functions from C CallingConv...
Eric Christopher [Thu, 7 Dec 2017 22:26:19 +0000 (22:26 +0000)]
Temporarily revert "[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions."

It is causing sanitizer failures on llvm tests in a bootstrapped compiler. No bot link since it's currently down, but following up to get the bot up.

This reverts commit r319218.

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

6 years ago[PGO] detect infinite loop and form MST properly
Xinliang David Li [Thu, 7 Dec 2017 22:23:28 +0000 (22:23 +0000)]
[PGO] detect infinite loop and form MST properly

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

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

6 years ago[MachineOutliner] Fix offset overflow check
Jessica Paquette [Thu, 7 Dec 2017 21:51:43 +0000 (21:51 +0000)]
[MachineOutliner] Fix offset overflow check

The offset overflow check before was incorrect. It would always give the
correct result, but it was comparing the SCALED potential fixed-up offset
against an UNSCALED minimum/maximum. As a result, the outliner was missing a
bunch of frame setup/destroy instructions that ought to have been safe to
outline. This fixes that, and adds an instruction to the .mir test that
failed the old test.

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

6 years ago[AMDGPU] Fix typo in Kernel Descriptor for GFX6-GFX9
Mark Searles [Thu, 7 Dec 2017 21:24:27 +0000 (21:24 +0000)]
[AMDGPU] Fix typo in Kernel Descriptor for GFX6-GFX9

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

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

6 years ago[AMDGPU] Revert "[AMDGPU] Add options for waitcnt pass debugging; add instr count...
Mark Searles [Thu, 7 Dec 2017 21:14:41 +0000 (21:14 +0000)]
[AMDGPU] Revert "[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output."

Patch caused a buildbot failure; http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/15733/steps/build_Lld/logs/stdio :
lib/Target/AMDGPU/SIInsertWaitcnts.cpp:396:11: error: private field 'InstCnt' is not used [-Werror,-Wunused-private-field]
  int32_t InstCnt = 0;
          ^
1 error generated.
"
This reverts commit 71627f79010aafe74fdcba901bba28dd7caa0869.

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

6 years ago[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output.
Mark Searles [Thu, 7 Dec 2017 20:36:39 +0000 (20:36 +0000)]
[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output.
-amdgpu-waitcnt-forcezero={1|0}  Force all waitcnt instrs to be emitted as s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-amdgpu-waitcnt-forceexp=<n>  Force emit a s_waitcnt expcnt(0) before the first <n> instrs
-amdgpu-waitcnt-forcelgkm=<n> Force emit a s_waitcnt lgkmcnt(0) before the first <n> instrs
-amdgpu-waitcnt-forcevm=<n>   Force emit a s_waitcnt vmcnt(0) before the first <n> instrs

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

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

6 years ago[AMDGPU] Add GCNHazardRecognizer::checkInlineAsmHazards() and GCNHazardRecognizer...
Mark Searles [Thu, 7 Dec 2017 20:34:25 +0000 (20:34 +0000)]
[AMDGPU] Add GCNHazardRecognizer::checkInlineAsmHazards() and GCNHazardRecognizer::checkVALUHazardsHelper(). checkInlineAsmHazards() checks INLINEASM for hazards that we particularly care about (so not exhaustive); this patch adds a check for INLINEASM that defs vregs that hold data-to-be stored by immediately preceding store of more than 8 bytes. If the instr were not within an INLINEASM, this scenario would be handled by checkVALUHazard(). Add checkVALUHazardsHelper(), which will be called by both checkVALUHazards() and checkInlineAsmHazards().

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

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

6 years ago[X86] Fix InsertBitToMaskVector to only issue KSHIFTS of native size so that upper...
Craig Topper [Thu, 7 Dec 2017 20:10:04 +0000 (20:10 +0000)]
[X86] Fix InsertBitToMaskVector to only issue KSHIFTS of native size so that upper bits are properly zeroed.

There's no v2i1 or v4i1 kshift, and v8i1 is only supported with AVXDQ. Isel has fake patterns to extend these types to native shifts, but makes no guarantees about the value of any bits shifted in when shifting right.

This patch promotes the vector to a type that supports a native shift first and only allows inserting into the msb of a native sized shift.

I've constructed this in a way that doesn't do the promotion if we're going to fallback to using a xmm/ymm/zmm shuffle. I think I have a plan to remove the shuffle fall back entirely. In which case we this can be simplified, but I wanted to fix the correctness issue first.

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

6 years ago[X86] Fix typo in variable name. NFC
Craig Topper [Thu, 7 Dec 2017 20:10:01 +0000 (20:10 +0000)]
[X86] Fix typo in variable name. NFC

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

6 years ago[X86] Make a couple helper lowering methods static.
Craig Topper [Thu, 7 Dec 2017 20:09:55 +0000 (20:09 +0000)]
[X86] Make a couple helper lowering methods static.

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

6 years ago[InstCombine] add tests for abs using bit hackery; NFC
Sanjay Patel [Thu, 7 Dec 2017 18:13:33 +0000 (18:13 +0000)]
[InstCombine] add tests for abs using bit hackery; NFC

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

6 years ago[X86] Replace tabs with spaces. NFCI.
Simon Pilgrim [Thu, 7 Dec 2017 17:55:19 +0000 (17:55 +0000)]
[X86] Replace tabs with spaces. NFCI.

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

6 years ago[X86] Tag BMI/BMI2/TBM instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 17:37:39 +0000 (17:37 +0000)]
[X86] Tag BMI/BMI2/TBM instructions scheduler classes

Put these under UNARY/BINOP ALU itinerary classes for now - seems to be a good average value

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

6 years ago[Hexagon] Generate HVX code for basic arithmetic operations
Krzysztof Parzyszek [Thu, 7 Dec 2017 17:37:28 +0000 (17:37 +0000)]
[Hexagon] Generate HVX code for basic arithmetic operations

Handle and, or, xor, add, sub, mul for vectors of i8, i16, and i32.

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

6 years ago[X86][TBM] Add TBM scheduling tests
Simon Pilgrim [Thu, 7 Dec 2017 17:23:00 +0000 (17:23 +0000)]
[X86][TBM] Add TBM scheduling tests

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

6 years ago[CodeGen] Fix index when printing tied machine operands
Francis Visoiu Mistrih [Thu, 7 Dec 2017 17:12:30 +0000 (17:12 +0000)]
[CodeGen] Fix index when printing tied machine operands

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

6 years ago[X86] Rename function in recently added test case to not be 'main' returning 'void...
Craig Topper [Thu, 7 Dec 2017 17:02:49 +0000 (17:02 +0000)]
[X86] Rename function in recently added test case to not be 'main' returning 'void'. NFC

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

6 years ago[DebugInfo] Move this test to X86/ now that it specifies a triple.
Davide Italiano [Thu, 7 Dec 2017 16:10:39 +0000 (16:10 +0000)]
[DebugInfo] Move this test to X86/ now that it specifies a triple.

Should bring back the arm/arm64 bots. Reported by Yvan Roux.

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

6 years ago[X86] Tag SALC instructions scheduler class
Simon Pilgrim [Thu, 7 Dec 2017 16:07:06 +0000 (16:07 +0000)]
[X86] Tag SALC instructions scheduler class

Treat these the same as LAHF/SAHF (although its not a x86_64 instruction)

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

6 years ago[X86] Add LAHF/SAHF scheduling test
Simon Pilgrim [Thu, 7 Dec 2017 16:04:20 +0000 (16:04 +0000)]
[X86] Add LAHF/SAHF scheduling test

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

6 years ago[X86][VMX] Tag VMX instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 15:57:32 +0000 (15:57 +0000)]
[X86][VMX] Tag VMX instructions scheduler classes

Tagged all as system instructions

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

6 years ago[X86] Add SALC scheduling test
Simon Pilgrim [Thu, 7 Dec 2017 15:46:58 +0000 (15:46 +0000)]
[X86] Add SALC scheduling test

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

6 years ago[X86] Tag LZCNT/TZCNT instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 15:24:14 +0000 (15:24 +0000)]
[X86] Tag LZCNT/TZCNT instructions scheduler classes

Tagged as IMUL instructions for a reasonable approximation (ALU tends to be a lot faster) - POPCNT is currently tagged as FAdd which I think should be replaced with IMUL as well

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

6 years ago[DAGCombiner] eliminate shuffle of insert element
Sanjay Patel [Thu, 7 Dec 2017 15:17:58 +0000 (15:17 +0000)]
[DAGCombiner] eliminate shuffle of insert element

I noticed this pattern in D38316 / D38388. We failed to combine a shuffle that is either
repeating a scalar insertion at the same position in a vector or translated to a different
element index.

Like the earlier patch, this could be an instcombine too, but since we opted to make this
a DAG transform earlier, I've made this one a DAG patch too.

We do not need any legality checking because the new insert is identical to the existing
insert except that it may have a different constant insertion operand.

The constant insertion test in test/CodeGen/X86/vector-shuffle-combining.ll was the
motivation for D38756.

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

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

6 years ago[InstCombine] Don't crash on out of bounds index in the insertelement
Igor Laevsky [Thu, 7 Dec 2017 15:00:52 +0000 (15:00 +0000)]
[InstCombine] Don't crash on out of bounds index in the insertelement

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

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

6 years ago[X86][FMA] Regenerate fma schedule tests
Simon Pilgrim [Thu, 7 Dec 2017 14:51:47 +0000 (14:51 +0000)]
[X86][FMA] Regenerate fma schedule tests

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

6 years ago[X86][SVM] Tag SVM instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 14:35:17 +0000 (14:35 +0000)]
[X86][SVM] Tag SVM instructions scheduler classes

Tagged all as system instructions

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

6 years ago[CodeGen] Use more getMFIfAvailable
Francis Visoiu Mistrih [Thu, 7 Dec 2017 14:32:15 +0000 (14:32 +0000)]
[CodeGen] Use more getMFIfAvailable

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

6 years ago[X86] Tag RDRAND/RDSEED instruction scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 14:18:48 +0000 (14:18 +0000)]
[X86] Tag RDRAND/RDSEED instruction scheduler classes

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

6 years ago[X86][X87] X87 math binop pseudo instructions don't need scheduling info
Simon Pilgrim [Thu, 7 Dec 2017 14:07:18 +0000 (14:07 +0000)]
[X86][X87] X87 math binop pseudo instructions don't need scheduling info

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

6 years ago[X86][SSE42] SSE42 string pseudo instructions don't need scheduling info
Simon Pilgrim [Thu, 7 Dec 2017 13:52:07 +0000 (13:52 +0000)]
[X86][SSE42] SSE42 string pseudo instructions don't need scheduling info

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

6 years ago[X86] Regenerate RDTSC codegen tests
Simon Pilgrim [Thu, 7 Dec 2017 13:50:29 +0000 (13:50 +0000)]
[X86] Regenerate RDTSC codegen tests

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

6 years ago[WebAssemby] Support main functions with alternate signatures.
Dan Gohman [Thu, 7 Dec 2017 13:49:27 +0000 (13:49 +0000)]
[WebAssemby] Support main functions with alternate signatures.

WebAssembly requires caller and callee signatures to match, so the usual
C runtime trick of calling main and having it just work regardless of
whether main is defined as '()' or '(int argc, char *argv[])' doesn't
work. Extend the FixFunctionBitcasts pass to rewrite main to use the
latter form.

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

6 years ago[X86][RDSEED] Add rdseed scheduling tests
Simon Pilgrim [Thu, 7 Dec 2017 13:47:17 +0000 (13:47 +0000)]
[X86][RDSEED] Add rdseed scheduling tests

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

6 years ago[X86][RDRAND] Add rdrand scheduling tests
Simon Pilgrim [Thu, 7 Dec 2017 13:46:47 +0000 (13:46 +0000)]
[X86][RDRAND] Add rdrand scheduling tests

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

6 years ago[RISCV] MC layer support for the jump/branch instructions of the RVC extension
Alex Bradbury [Thu, 7 Dec 2017 13:19:57 +0000 (13:19 +0000)]
[RISCV] MC layer support for the jump/branch instructions of the RVC extension

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

Patch by Shiva Chen.

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

6 years ago[RISCV] MC layer support for load/store instructions of the C (compressed) extension
Alex Bradbury [Thu, 7 Dec 2017 12:50:32 +0000 (12:50 +0000)]
[RISCV] MC layer support for load/store instructions of the C (compressed) extension

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

Patch by Shiva Chen.

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

6 years ago[RISCV][NFC] Use TargetRegisterClass::hasSubClassEq in storeRegToStackSlot/loadReadFr...
Alex Bradbury [Thu, 7 Dec 2017 12:45:05 +0000 (12:45 +0000)]
[RISCV][NFC] Use TargetRegisterClass::hasSubClassEq in storeRegToStackSlot/loadReadFromStackSlot

Simply checking for register class equality will break once additional
register classes are added (as is done for the RVC instruction set extension).

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

6 years ago[Nios2] final infrastructure to provide compilation of a return from a function
Nikolai Bozhenov [Thu, 7 Dec 2017 12:35:02 +0000 (12:35 +0000)]
[Nios2] final infrastructure to provide compilation of a return from a function

This patch includes all missing functionality needed to provide first
compilation of a simple program that just returns from a function.
I've added a test case that checks for "ret" instruction printed in assembly
output.

Patch by Andrei Grischenko (andrei.l.grischenko@intel.com)
Differential revision: https://reviews.llvm.org/D39688

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

6 years agoAdd proper BTVER2 sched support for MOV instr.
Andrew V. Tischenko [Thu, 7 Dec 2017 11:19:49 +0000 (11:19 +0000)]
Add proper BTVER2 sched support for MOV instr.
Differential Revision: https://reviews.llvm.org/D40345

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