122432 Commits

Author SHA1 Message Date
Alexei Starovoitov
49cdd6c3d1 [bpf] Avoid extra pointer arithmetic for stack access
For the program like below
struct key_t {
  int pid;
  char name[16];
};
extern void test1(char *);
int test() {
  struct key_t key = {};
  test1(key.name);
  return 0;
}
For key.name, the llc/bpf may generate the below code:
  R1 = R10  // R10 is the frame pointer
  R1 += -24 // framepointer adjustment
  R1 |= 4   // R1 is then used as the first parameter of test1
OR operation is not recognized by in-kernel verifier.

This patch introduces an intermediate FI_ri instruction and
generates the following code that can be properly verified:
  R1 = R10
  R1 += -20

Patch by Yonghong Song <yhs@plumgrid.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249371 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 04:00:53 +00:00
Craig Topper
50bf4331f4 [X86] Teach constant hoisting that ANDs with 64-bit immediates in the range 0x80000000-0xffffffff can be handled cheaply and don't need to be hoisted.
Most importantly, this keeps constant hoisting from preventing instruction selections ability to turn an AND with 0xffffffff into a move into a 32-bit subregister.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249370 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 02:50:24 +00:00
Craig Topper
a1a1f2a090 [X86] Remove unnecessary AddComplexity directive. The instruction is already wrapped in the equivalent earlier. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249369 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 02:50:21 +00:00
Dan Gohman
2d3e3ef1c7 [WebAssembly] Switch to a more traditional assembly syntax
This new syntax is built around putting each instruction on its own line
in a "mnemonic op, op, op" like syntax. It also uses conventional data
section directives like ".byte" and so on rather than requiring everything
to be in hierarchical S-expression format. This is a more natural syntax
for a ".s" file format from the perspective of LLVM MC and related tools,
while remaining easy to translate into other forms as needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 00:27:55 +00:00
Adrian Prantl
fce2219764 dsymutil: Don't prune forward declarations inside of an imported TAG_module
if there exists not definition for the type.
For this to work, we need to clone the imported modules before building
the decl context chains of the DIEs in the non-skeleton CUs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249362 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 23:11:20 +00:00
Benjamin Kramer
080c92b40d Move helper classes into an anonymous namespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 21:20:26 +00:00
Diego Novillo
d6ac66492e Remove AutoFDO profile handling for GCC's LIPO. NFC.
Given the work we are doing on ThinLTO, we will never need to support
module groups and working sets in GCC's implementation of LIPO. These
are currently dead code, and will continue to be so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 21:08:05 +00:00
David Majnemer
6212b4d0b8 [WinEH] Update CATCHRET's operand to match its successor
The CATCHRET operand did not match the MachineFunction's CFG.  This
mismatch happened because FrameLowering created a new MachineBasicBlock
and updated the CFG but forgot to update the CATCHRET operand.

Let's make sure this doesn't happen again by strengthing the funclet
membership analysis: it can now reason about the membership of all basic
blocks, not just those inside of funclets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249344 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 20:09:16 +00:00
Jakub Staszak
15c2d43e8b Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 18:53:30 +00:00
Hans Wennborg
613c526225 ReleaseNotes: note the new Windows version requirement
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 18:38:49 +00:00
Evgeniy Stepanov
3f77b12639 [msan] Correct a typo in poison stack pattern command line description.
Patch by Jon Eyolfson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 18:01:17 +00:00
Tom Stellard
d0c6de8696 AMDGPU/SI: Add a helper for creating aliases for the _e32 instructions
Summary:
We are currently only using these aliases for VOPC instructions,
but this helper will make it easier to use them everywhere.

These aliases allow for the automatic matching of instructions
with forced 32-bit encoding.  Eventually, we should be able to remove
the custom C++ logic we have for this in the assembler.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 17:57:39 +00:00
Arnold Schwaighofer
01cf7ec623 MergeFunctions: Clear GlobalNumbers ValueMap
Otherwise, the map will observe changes as long as MergeFunctions is alive. This
is bad because follow-up passes could replace-all-uses-with on the key of an
entry in the map. The value handle callback of ValueMap however asserts that the
key type matches.

rdar://22971893

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 17:26:36 +00:00
Scott Douglass
ab6273be70 [ARM] Modify codegen for memcpy intrinsic to prefer LDM/STM.
We were previously codegen'ing memcpy as regular load/store operations and
hoping that the register allocator would allocate registers in ascending order
so that we could apply an LDM/STM combine after register allocation. According
to the commit that first introduced this code (r37179), we planned to teach the
register allocator to allocate the registers in ascending order. This never got
implemented, and up to now we've been stuck with very poor codegen.

A much simpler approach for achieving better codegen is to create MEMCPY pseudo
instructions, attach scratch virtual registers to them and then, post register
allocation, expand the MEMCPYs into LDM/STM pairs using the scratch registers.
The register allocator will have picked arbitrary registers which we sort when
expanding the MEMCPY. This approach also avoids the need to repeatedly calculate
offsets which ultimately ought to be eliminated pre-RA in order to decrease
register pressure.

Fixes PR9199 and PR23768.

[This is based on Peter Collingbourne's r238473 which was reverted.]

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

Change-Id: I727543c2e94136e0f80b8e22d5642d7b9ee5b458
Author: Peter Collingbourne <peter@pcc.me.uk>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 14:49:54 +00:00
Benjamin Kramer
60fe48f866 Make test resilient against windows path separators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 14:15:13 +00:00
Zoran Jovanovic
d0b3d6159d [mips][microMIPS] Implement JALRC16, JRCADDIUSP and JRC16 instructions
Differential Revision: http://reviews.llvm.org/D11219


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249317 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 14:00:09 +00:00
Alexandros Lamprineas
82e78e2e9d [MC layer][AArch64] llvm-mc accepts 4-bit immediate values for
"msr pan, #imm", while only 1-bit immediate values should be valid.
Changed encoding and decoding for msr pstate instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249313 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 13:42:31 +00:00
Daniel Sanders
fbdf2017ea [mips] Changed the way symbols are handled in dla and la instructions to allow simple expressions.
Summary:
An instruction like "(d)la $5, symbol+8" previously would have crashed the
assembler as it contains an expression. This is now fixed.
A few tests cases have also been changed to reflect these changes, however
these should only be syntax changes. Some new test cases have also been
added.

Patch by Scott Egerton.

Reviewers: vkalintiris, dsanders

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249311 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 13:19:29 +00:00
Benjamin Kramer
9fdd48c184 [Support] Add a version of fs::make_absolute with a custom CWD.
This will be used soon from clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249309 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 13:02:43 +00:00
Alexandros Lamprineas
966b579475 Added missing test for [ARM] AttributeParser. Check that build attribute
Tag_Advanced_SIMD_arch is set correctly when targeting v8.1-a NEON.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249304 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 12:13:29 +00:00
Rafael Espindola
0eba49c22e Fix pr24486.
This extends the work done in r233995 so that now getFragment (in addition to
getSection) also works for variable symbols.

With that the existing logic to decide if a-b can be computed works even if
a or b are variables. Given that, the expression evaluation can avoid expanding
variables as aggressively and that in turn lets the relocation code see the
original variable.

In order for this to work with the asm streamer, there is now a dummy fragment
per section. It is used to assign a section to a symbol when no other fragment
exists.

This patch is a joint work by Maxim Ostapenko andy myself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 12:07:05 +00:00
NAKAMURA Takumi
deb80b5397 Reformat partially.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249288 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:46:30 +00:00
NAKAMURA Takumi
9ad5c5f1f8 Reformat 3 files in llvm/include/llvm/CodeGen/.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:44:18 +00:00
NAKAMURA Takumi
cc43180d94 Trailing whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249286 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:44:08 +00:00
NAKAMURA Takumi
b2700222ec Prune trailing whitespaces in comment lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249285 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:43:57 +00:00
NAKAMURA Takumi
dc0de228e2 Reformat blank lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05 04:43:48 +00:00
David Majnemer
c31176a608 [SelectionDAGBuilder] Remove dead code
We already check for LandingPadInst two lines above.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 18:44:47 +00:00
Teresa Johnson
5b23a6406f Remove unused private field introduced by r249270.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 15:00:55 +00:00
Teresa Johnson
b97baa5fe5 Support for function summary index bitcode sections and files.
Summary:
The bitcode format is described in this document:
  https://drive.google.com/file/d/0B036uwnWM6RWdnBLakxmeDdOeXc/view
For more info on ThinLTO see:
  https://sites.google.com/site/llvmthinlto

The first customer is ThinLTO, however the data structures are designed
and named more generally based on prior feedback. There are a few
comments regarding how certain interfaces are used by ThinLTO, and the
options added here to gold currently have ThinLTO-specific names as the
behavior they provoke is currently ThinLTO-specific.

This patch includes support for generating per-module function indexes,
the combined index file via the gold plugin, and several tests
(more are included with the associated clang patch D11908).

Reviewers: dexonsmith, davidxl, joker.eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 14:33:43 +00:00
Simon Pilgrim
ea978bb563 [X86][SSE4A] Added shuffle decode tests for 'special case' SSE4A EXTRQI/INSERTQI ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 10:12:53 +00:00
Joerg Sonnenberger
58b865b86c [SPARCv9] Add support for the rdpr/wrpr instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249262 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 09:11:22 +00:00
Igor Breger
295b19789d AVX512: Implemented encoding and intrinsics for VPERMILPS/PD instructions.
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249261 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 07:20:41 +00:00
David Majnemer
492f1cfa37 [WinEH] Permit branch folding in the face of funclets
Track which basic blocks belong to which funclets.  Permit branch
folding to fire but only if it can prove that doing so will not cause
code in one funclet to be reused in another.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249257 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 02:22:52 +00:00
Jeroen Ketema
9636baa291 Fix typo in README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249253 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04 00:46:16 +00:00
Simon Pilgrim
f36dfdfd26 [DAGCombiner] Generalize FADD constant combines to work with vectors
Updated the FADD combines to work with vectors as well as scalars.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249251 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 22:06:06 +00:00
Sanjay Patel
4fbecfeb5a add test cases that demonstrate bad behavior
These are based on PR25016 and likely caused by a bug in
MachineCombiner's definition of improvesCriticalPathLen().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249249 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 20:52:55 +00:00
Sanjay Patel
61134d719a include equal sign in debug equations; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249248 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 20:45:01 +00:00
Davide Italiano
3cd5d8c094 [llvm-size] Attempt to fix a test failure on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249247 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 20:20:28 +00:00
Davide Italiano
982ae9e22d [llvm-size] Fix time to check if time of use bug.
This was the last tool relying on this pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 19:44:06 +00:00
Simon Pilgrim
3e07e8cf77 [X86] Lower SEXTLOAD using SIGN_EXTEND_VECTOR_INREG. NCI.
The custom lowering in LowerExtendedLoad is doing the equivalent shuffle, so make use of existing lowering code to reduce duplication.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249243 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 18:55:43 +00:00
Rafael Espindola
26585cfcaa Remove unnecessary includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249242 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 18:38:50 +00:00
Rafael Espindola
8e4f570760 Move registerSection out of line and reduce #includes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249241 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 18:28:40 +00:00
Simon Pilgrim
58d1cc109a [X86][SSE] Add FADD combine tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 18:17:43 +00:00
Simon Pilgrim
eae7090e1c [DAGCombiner] Merge SIGN_EXTEND_INREG vector constant folding methods. NCI.
visitSIGN_EXTEND_INREG calls SelectionDAG::getNode to constant fold scalar constants but handles vector constants itself, despite getNode being capable of dealing with them.

This required a minor change to the getNode implementation to actually deal with cases where the scalars of a BUILD_VECTOR were wider integers than the vector type - which was the only extra ability of the visitSIGN_EXTEND_INREG implementation.

No codegen intended and all existing tests remain the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249236 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 16:26:52 +00:00
Kostya Serebryany
2e700c9bf6 [libFuzzer] trying to fix at-exit hang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249231 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 07:02:05 +00:00
Dan Gohman
645be3e5fe [WebAssembly] Implement the remaining conversion operations.
This is a temporary assembly syntax that will likely evolve along with
broader upcoming syntax changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249225 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 02:10:28 +00:00
Rafael Espindola
4a2dc8f082 Use early return. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249224 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 00:57:12 +00:00
Sanjoy Das
7db865a9ea Try to appease MSVC, NFCI.
This time by lifting the lambda's in `createNodeFromSelectLikePHI` to
the file scope.  Looks like there are differences in capture rules
between clang and MSVC?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249222 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 00:34:19 +00:00
Tom Stellard
8da370d30b AMDGPU/SI: Remove unused tablegen multiclass
Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249221 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 00:29:50 +00:00
Rafael Espindola
ac4ccbae9f Disallow assigning symbol a null section.
They are constructed without one and they can't go back, so this was
effectively dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249220 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 00:18:14 +00:00