90574 Commits

Author SHA1 Message Date
George Rimar
c9c693751f [llvm-mc] - Teach llvm-mc to generate compressed debug sections in zlib style.
Before this patch llvm-mc generated zlib-gnu styled sections. 
That means no SHF_COMPRESSED flag was set, magic 'zlib' signature
was used in combination with full size field. Sections were renamed to "*.z*".
This patch reimplements the compression style to zlib one as zlib-gnu looks
to be depricated everywhere.

Differential revision: http://reviews.llvm.org/D20331

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 15:08:31 +00:00
Chad Rosier
ae7c8ddf94 [AArch64 ] Generate a BFXIL from 'or (and X, Mask0Imm),(and Y, Mask1Imm)'.
Mask0Imm and ~Mask1Imm must be equivalent and one of the MaskImms is a shifted
mask (e.g., 0x000ffff0).  Both 'and's must have a single use.

This changes code like:

  and w8, w0, #0xffff000f
  and w9, w1, #0x0000fff0
  orr w0, w9, w8

into

  lsr w8, w1, #4
  bfi w0, w8, #4, #12

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 14:19:47 +00:00
Ranjeet Singh
8f225b96ad Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270056 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:44:39 +00:00
Artem Tamazov
d8bb9ecd8c [AMDGPU][llvm-mc] Fixes to support buffer atomics.
Fixes for MUBUF_Atomic instructions to make operand list valid:
 - For RTN insns, make a copy of $vdata_in operand as $vdata.
 - Do not add operand for GLC, it is hardcoded and comes as a token.
Workaround to avoid adding multiple default optional operands.
Tests added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:22:39 +00:00
Zoran Jovanovic
785d7f7fbf ps][microMIPS] Add R_MICROMIPS_PC21_S1 relocation
Differential Revision: http://reviews.llvm.org/D15526


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 12:20:40 +00:00
Daniel Sanders
7b27dc2e11 [mips][mips16] Fix ZERO is not a CPU16Regs register error from the machine verifier.
Summary: Partially fixes PR27458

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 10:42:14 +00:00
Andrey Turetskiy
7e9b79653d [X86] Enable RRL part of the LEA optimization pass for -O2.
Enable "Remove Redundant LEAs" part of the LEA optimization pass for -O2.
This gives 6.4% performance improve on Broadwell on nnet benchmark from Coremark-pro.
There is no significant effect on other benchmarks (Geekbench, Spec2000, Spec2006).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 10:18:29 +00:00
Zlatko Buljan
f68477089e [mips][microMIPS] Implement BC1EQZC, BC1NEZC, BC2EQZC and BC2NEZC instructions
Differential Revision: http://reviews.llvm.org/D18352


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 07:31:28 +00:00
Craig Topper
ad8832da71 [X86] Generalize and combine some similar type constraints and node types. No changes to the isel table size so the separation wasn't buying us anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 06:13:58 +00:00
Craig Topper
ac890c2769 [X86] Simplify some type constraints by removing parts that were already implied.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 06:13:48 +00:00
Peter Collingbourne
28f667b461 CodeGen: Make the global-merge pass independently testable, and add a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 04:38:56 +00:00
Vedant Kumar
c77570e062 Retry^3 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"
Transition InstrProf and Coverage over to the stricter Error/Expected
interface.

Changes since the initial commit:
- Fix error message printing in llvm-profdata.
- Check errors in loadTestingFormat() + annotateAllFunctions().
- Defer error handling in InstrProfIterator to InstrProfReader.
- Remove the base ProfError class to work around an MSVC ICE.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 03:54:45 +00:00
Sanjoy Das
658bddf628 [GuardWidening] Use getEquivalentICmp to fold constant compares
`ConstantRange::getEquivalentICmp` is more general, and better
factored.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 03:53:17 +00:00
Sanjoy Das
15c62f945a [ConstantRange] Add an getEquivalentICmp helper
Currently only its unit test uses it, but this will be used in a later
change to simplify some logic in the GuardWidening pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 03:53:06 +00:00
Dan Gohman
62dec0fa6b [WebAssembly] Update WebAssembly target for r269988.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 03:00:05 +00:00
Craig Topper
ab2007fdaa [X86] Remove some type constraint classes and use already existing stricter classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 02:05:58 +00:00
Craig Topper
2928467217 [AVX512] Strengthen type constraints for VFIXUPIMM patterns and combine the type constraints for vector and scalar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 02:05:55 +00:00
Sanjay Patel
c40c117dfc reduce indentation; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 00:33:07 +00:00
Chad Rosier
d6995c8dcf [AArch64] Push comment into function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 23:51:17 +00:00
Matt Arsenault
221ed41e35 AMDGPU: Fix verifier error when spilling undef subreg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 23:35:53 +00:00
Matt Arsenault
44aaff08ed AMDGPU: Fix promote alloca for pointer loads
If the load has a pointer type, we don't want to change
its type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 23:20:24 +00:00
Sanjoy Das
9dbb32236a [LowerGuards] Rename variable; NFC
PredicatePassProbability is a better name for what LikelyBranchWeight
was trying to express.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 23:16:27 +00:00
Sanjoy Das
0266d5e92a New pass: guard widening
Summary:
Implement guard widening in LLVM. Description from GuardWidening.cpp:

The semantics of the `@llvm.experimental.guard` intrinsic lets LLVM
transform it so that it fails more often that it did before the
transform.  This optimization is called "widening" and can be used hoist
and common runtime checks in situations like these:

```
%cmp0 = 7 u< Length
call @llvm.experimental.guard(i1 %cmp0) [ "deopt"(...) ]
call @unknown_side_effects()
%cmp1 = 9 u< Length
call @llvm.experimental.guard(i1 %cmp1) [ "deopt"(...) ]
...
```

to

```
%cmp0 = 9 u< Length
call @llvm.experimental.guard(i1 %cmp0) [ "deopt"(...) ]
call @unknown_side_effects()
...
```

If `%cmp0` is false, `@llvm.experimental.guard` will "deoptimize" back
to a generic implementation of the same function, which will have the
correct semantics from that point onward.  It is always _legal_ to
deoptimize (so replacing `%cmp0` with false is "correct"), though it may
not always be profitable to do so.

NB! This pass is a work in progress.  It hasn't been tuned to be
"production ready" yet.  It is known to have quadriatic running time and
will not scale to large numbers of guards

Reviewers: reames, atrick, bogner, apilipenko, nlewycky

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:55:34 +00:00
Dehao Chen
8458fdbf49 Follow-up patch of http://reviews.llvm.org/D19948 to handle missing profiles when simplifying CFG.
Summary: Set default branch weight to 1:1 if one of the branch has profile missing when simplifying CFG.

Reviewers: spatel, davidxl

Subscribers: danielcdh, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269995 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:41:03 +00:00
Haicheng Wu
7a03ff405d [MBP] Remove a redundant skipFunction(). NFC.
skipFunction() is called twice.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:34:45 +00:00
Richard Smith
cf44b366f9 Work around a glibc bug: backtrace() spuriously fails if
- glibc is dynamically linked, and
 - libgcc_s is unavailable (for instance, another library is being used to
   provide the compiler runtime or libgcc is statically linked), and
 - the target is x86_64.

If we run backtrace() and it fails to find any stack frames, try using
_Unwind_Backtrace instead if available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269992 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:26:36 +00:00
Sanjay Patel
7aae44e690 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:05:28 +00:00
Rafael Espindola
ac8db59598 Delete Reloc::Default.
Having an enum member named Default is quite confusing: Is it distinct
from the others?

This patch removes that member and instead uses Optional<Reloc> in
places where we have a user input that still hasn't been maped to the
default value, which is now clear has no be one of the remaining 3
options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:04:49 +00:00
Jacques Pienaar
57380a7dcf [lanai] Change the way flag setting instructions are checked.
isReturn() was returning different values with and without -g which led to
different code being generated. Change isFlagSettingInstruction to query
an instruction's effect on SR instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 21:31:37 +00:00
Michael Zolotukhin
6e6d60d000 [LoopUnrollAnalyzer] Take into account cost of instructions controlling branches, along with their operands.
Previously, we didn't add their and their operands cost, which could've
resulted in unrolling loops for no actual benefit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 21:20:12 +00:00
Dan Gohman
b3b1972f26 [WebAssembly] Disable the MachineScheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 20:19:02 +00:00
Dehao Chen
279b28ea43 clang-format SimplifyCFG.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 19:44:21 +00:00
Jan Vesely
c8ee6f35bc AMDGPU: Fix incorrect simm check
Use signed division otherwise all back jumps fail the check
Fixes regression introduced in r269951

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 19:07:58 +00:00
Krzysztof Parzyszek
fa30381518 When looking for a spill slot in reg scavenger, find one that matches RC
When looking for an available spill slot, the register scavenger would stop
after finding the first one with no register assigned to it. That slot may
have size and alignment that do not meet the requirements of the register
that is to be spilled. Instead, find an available slot that is the closest
in size and alignment to one that is needed to spill a register from RC.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269969 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 18:16:00 +00:00
Chad Rosier
de2a437afc [AArch64] Minor refactoring. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 17:43:11 +00:00
Sanjay Patel
7d1364e974 clean up; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 17:23:38 +00:00
Rui Ueyama
17e3d064b5 pdbdump: Print out section offsets in the publics stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:24:16 +00:00
Chris Bieneman
7ec0ea16b7 Re-apply: [obj2yaml] [yaml2obj] Support MachO section and section_64
This re-applies r269845, r269846, and r269850 with an included fix for a crash reported by zturner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:17:23 +00:00
Matt Arsenault
76e32dfbc0 AMDGPU: Error if branch distance exceeds limit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:10:24 +00:00
Matt Arsenault
3cd52aec7c AMDGPU: Other sizes of popcnt are fast
We can chain bcnt instructions together, so
any width popcnt is pretty fast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:10:19 +00:00
Hans Wennborg
a9355d3c68 Re-commit r269828 "X86: Avoid using _chkstk when lowering WIN_ALLOCA instructions"
with an additional fix to make RegAllocFast ignore undef physreg uses. It would
previously get confused about the "push %eax" instruction's use of eax. That
method for adjusting the stack pointer is used in X86FrameLowering::emitSPUpdate
as well, but since that runs after register-allocation, we didn't run into the
RegAllocFast issue before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:10:17 +00:00
Matt Arsenault
5d9f8fb9d4 AMDGPU: Fix assert when erroring on a call
For some reason an assert is now hit when a valid chain
is not returned, so return the entry chain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:10:11 +00:00
Rafael Espindola
c023b23341 Trivial cleanups.
This just clang formats and cleans comments in an area I am about to
post a patch for review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:00:24 +00:00
Matt Arsenault
41cf920df5 AMDGPU: Handle alloca promoting with null operands
If the second pointer in a multi-pointer instruction is
a constant, we can replace the type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:57:21 +00:00
Matt Arsenault
39107ccf80 AMDGPU: Don't run passes that aren't useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:41:07 +00:00
Matt Arsenault
71a492ec1e AMDGPU: Fix assert on ttmp registers
Use register class that does not include them when looking
for unallocated registers.

This is hit by the udiv v8i64 test in the opencl integer
conformance test, and takes a few seconds to compile in
a debug build so no test included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:19:50 +00:00
Davide Italiano
d77d4c07fb [PM] Port per-function SCCP to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 15:18:25 +00:00
Krzysztof Parzyszek
8b8fb6b298 [Hexagon] Recognize "q" and "v" in inline-asm as register constraints
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 14:34:51 +00:00
Dan Gohman
da38a6d070 [WebAssembly] Don't expand divisions by constants.
Don't expand divisions by constants if it would require multiple instructions.
The current assumption is that engines will perform the desired optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 14:29:42 +00:00
Bryan Chan
5137cfa191 [SystemZ] Fix register ordering for BinaryRRF instructions
Summary:
The ordering of registers in BinaryRRF instructions are wrong, and
affects the copysign instruction (CPSDR). This results in the wrong
magnitude and sign being set.

Author: zhanjunl

Reviewers: kbarton, uweigand

Subscribers: llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 13:24:57 +00:00