Commit Graph

123583 Commits

Author SHA1 Message Date
Peter Collingbourne
dcbcd42f5c Fix Kaleidoscope example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252222 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 22:18:31 +00:00
Peter Collingbourne
5f220beefc DI: Reverse direction of subprogram -> function edge.
Previously, subprograms contained a metadata reference to the function they
described. Because most clients need to get or set a subprogram for a given
function rather than the other way around, this created unneeded inefficiency.

For example, many passes needed to call the function llvm::makeSubprogramMap()
to build a mapping from functions to subprograms, and the IR linker needed to
fix up function references in a way that caused quadratic complexity in the IR
linking phase of LTO.

This change reverses the direction of the edge by storing the subprogram as
function-level metadata and removing DISubprogram's function field.

Since this is an IR change, a bitcode upgrade has been provided.

Fixes PR23367. An upgrade script for textual IR for out-of-tree clients is
attached to the PR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252219 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 22:03:56 +00:00
Tim Northover
cc5dc01d7f Remove windows line endings introduced by r252177. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 21:54:58 +00:00
Alexey Samsonov
f17835b5ce [ASan] Disable instrumentation for inalloca variables.
inalloca variables were not treated as static allocas, therefore didn't
participate in regular stack instrumentation. We don't want them to
participate in dynamic alloca instrumentation as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252213 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 21:18:41 +00:00
Alexander Kornienko
f3e49f53a8 Refactor: Simplify boolean conditional return statements in lib/llvm/ExecutionEngine/Orc
Patch by Richard Thomson!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252212 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 21:18:09 +00:00
Reid Kleckner
100773aba1 [WinEH] Fix funclet prologues with stack realignment
We already had a test for this for 32-bit SEH catchpads, but those don't
actually create funclets. We had a bug that only appeared in funclet
prologues, where we would establish EBP and ESI as our FP and BP, and
then downstream prologue code would overwrite them.

While I was at it, I fixed Win64+funclets+stackrealign. This issue
doesn't come up as often there due to the ABI requring 16 byte stack
alignment, but now we can rest easy that AVX and WinEH will work well
together =P.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 21:09:49 +00:00
Alexander Kornienko
981f1796e0 Refactor: Simplify boolean conditional return statements in llvm/lib/Analysis
Patch by Richard Thomson!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252209 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 21:07:12 +00:00
Dan Gohman
e6d3aa4a49 [WebAssembly] Fix copypasta.
Noticed by dschff in http://reviews.llvm.org/rL252203


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 20:59:49 +00:00
Dan Gohman
154081af53 [WebAssembly] Rename Immediate instructions to Const.
This more closely reflects the naming convention in the spec.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252204 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 20:44:29 +00:00
Dan Gohman
651ccf4012 [WebAssembly] Add AsmString strings for most instructions.
Mangling type information into MachineInstr opcode names was a temporary
measure, and it's starting to get hairy. At the same time, the MC instruction
printer wants to use AsmString strings for printing. This patch takes the
first step, starting the process of adding AsmStrings for instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 20:42:30 +00:00
Dan Gohman
ae31b98bc3 [WebAssembly] Update wasm builtin functions to match spec changes.
The page_size operator has been removed from the spec, and the resize_memory
operator has been changed to grow_memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252202 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 20:16:59 +00:00
Sanjay Patel
834952e4f1 replace MachineCombinerPattern namespace and enum with enum class; NFCI
Also, remove an enum hack where enum values were used as indexes into an array.

We may want to make this a real class to allow pattern-based queries/customization (D13417).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 19:34:57 +00:00
Dan Gohman
251dff3d1b [WebAssembly] Add WebAssemblyMCInstLower.cpp.
This isn't used yet; it's just a start towards eventually using MC to
do instruction printing, and eventually binary encoding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252194 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 19:28:16 +00:00
Kevin Enderby
268709a810 Reapply r250906 with many suggested updates from Rafael Espindola.
The needed lld matching changes to be submitted immediately next,
but this revision will cause lld failures with this alone which is expected.

This removes the eating of the error in Archive::Child::getSize() when the characters
in the size field in the archive header for the member is not a number.  To do this we
have all of the needed methods return ErrorOr to push them up until we get out of lib.
Then the tools and can handle the error in whatever way is appropriate for that tool.

So the solution is to plumb all the ErrorOr stuff through everything that touches archives.
This include its iterators as one can create an Archive object but the first or any other
Child object may fail to be created due to a bad size field in its header.

Thanks to Lang Hames on the changes making child_iterator contain an
ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add
operator overloading for * and -> .

We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash”
and using report_fatal_error() to move the error checking will cause the program to
stop, neither of which are really correct in library code. There are still some uses of
these that should be cleaned up in this library code for other than the size field.

The test cases use archives with text files so one can see the non-digit character,
in this case a ‘%’, in the size field.

These changes will require corresponding changes to the lld project.  That will be
committed immediately after this change.  But this revision will cause lld failures
with this alone which is expected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 19:24:56 +00:00
Davide Italiano
c18c3b8a30 [SimplifyLibCalls] Use hasFloatVersion(). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 19:18:23 +00:00
Oleg Ranevskyy
101c5b096f [DebugInfo] Fix ARM/AArch64 prologue_end position. Related to D11268.
Summary:
This review is related to another review request http://reviews.llvm.org/D11268, does the same and merely fixes a couple of issues with it.

D11268 is quite old and has merge conflicts against the current trunk.
This request 
 - rebases D11268 onto the new trunk;
 - resolves the merge conflicts;
 - fixes the prologue_end tests, which do not pass due to the subprogram definitions not marked as distinct.

Reviewers: echristo, rengolin, kubabrecka

Subscribers: aemerson, rengolin, jyknight, dsanders, llvm-commits, asl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 17:50:17 +00:00
Petar Jovanovic
00e29ad54f Add cfi instr for CFA calculation when movpc is expanded to call and pop
This fixes the issue of wrong CFA calculation in the following case:

0x08048400 <+0>:	push   %ebx
0x08048401 <+1>:	sub    $0x8,%esp
0x08048404 <+4>:	**call   0x8048409 <test+9>**
0x08048409 <+9>:	**pop    %eax**
0x0804840a <+10>:	add    $0x1bf7,%eax
0x08048410 <+16>:	mov    %eax,%ebx
0x08048412 <+18>:	call   0x80483f0 <bar>
0x08048417 <+23>:	add    $0x8,%esp
0x0804841a <+26>:	pop    %ebx
0x0804841b <+27>:	ret

The highlighted instructions are a product of movpc instruction. The call
instruction changes the stack pointer, and pop instruction restores its
value. However, the rule for computing CFA is not updated and is wrong on
the pop instruction. So, e.g. backtrace in gdb does not work when on the pop
instruction. This adds cfi instructions for both call and pop instructions.

cfi_adjust_cfa_offset** instruction is used with the appropriate offset for
setting the rules to calculate CFA correctly.

Patch by Violeta Vukobrat.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 17:19:59 +00:00
Derek Schuff
f284162906 [WebAssembly] Rename ior operator to or to match the spec
Summary: The spec uses "or" for inclusive-or and "xor" for exclusive-or

Reviewers: sunfish

Subscribers: jfb, llvm-commits, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 17:08:11 +00:00
Silviu Baranga
dcc5220c3a Update comment to LoopAccessInfo after r251800. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 15:55:41 +00:00
James Molloy
ccdfbf603c [ARM] Compute known bits for ARMISD::CMOV
We can conservatively know that CMOV's known bits are the intersection of known bits for each of its operands. This helps PerformCMOVToBFICombine find more opportunities.

I tried hard to create a testcase for this and failed - we have to sufficiently confuse DAG.computeKnownBits which can see through all the cheap tricks I tried to narrow my larger testcase down :(

This code is actually exercised in CodeGen/ARM/bfi.ll, there's just no functional difference because DAG.computeKnownBits gets the right answer in that case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 15:21:58 +00:00
Aaron Ballman
0ef0b3e881 Fix a signed/unsigned mismatch warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252164 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 14:22:56 +00:00
Asaf Badouh
4283d55d7d revert rev. 252153 due to build failure on ubuntu
[X86][AVX512] add comi with Sae



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252154 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 08:55:54 +00:00
Asaf Badouh
1de7587fc4 [X86][AVX512] add comi with Sae
add builtin_ia32_vcomisd and builtin_ia32_vcomisd

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252153 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 08:45:06 +00:00
James Molloy
a3bdb086c7 [SimplifyCFG] Tweak heuristic for merging conditional stores
We were correctly skipping dbginfo intrinsics and terminators, but the initial bailout wasn't, causing it to bail out on almost any block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252152 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 08:40:19 +00:00
Asaf Badouh
b1b2c5a457 [X86][AVX512] small bugfix in VPBROADCASTM
VPBROADCASTMW2D and VPBROADCASTMB2Q

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 08:08:21 +00:00
Saleem Abdulrasool
c574acfe95 RuntimeDyld: fix -Wtype-limits
Adjust the casted type.  By casting to the same size rather than just the
signed-ness, we were asserting tautological statements.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252150 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 06:24:09 +00:00
Mehdi Amini
fe0b6a7f50 Fix LoopAccessAnalysis when potentially nullptr check are involved
Summary:
GetUnderlyingObjects() can return "null" among its list of objects,
we don't want to deduce that two pointers can point to the same
memory in this case, so filter it out.

Reviewers: anemet

Subscribers: dexonsmith, llvm-commits

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 05:49:43 +00:00
NAKAMURA Takumi
f8bc54d013 MCStreamer.h: Prune \return, corresponding to r252102. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252148 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 05:47:46 +00:00
Xinliang David Li
1a497c68b8 Fix a bug exposed by uses in CFE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252146 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 05:45:06 +00:00
Matt Arsenault
26c74838a7 AMDGPU: Also track whether SGPRs were spilled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 05:27:10 +00:00
Matt Arsenault
35a96b82c1 AMDGPU: Print number user SGPRs
This doesn't quite match how SC prints it, which doesn't put it in a
comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252144 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 05:27:07 +00:00
Matt Arsenault
944e560063 AMDGPU: Disallow s[102:103] on VI in assembler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 03:11:27 +00:00
Sanjoy Das
8e56fac5c1 [FunctionAttrs] Remove a loop, NFC refactor
Summary:
Remove the loop over the uses of the CallSite in ArgumentUsesTracker.
Since we have the `Use *` for actual argument operand, we can just use
pointer subtraction.

The time complexity remains the same though (except for a vararg
argument) -- `std::advance` is O(UseIndex) for the ArgumentList
iterator.

The real motivation is to make a later change adding support for operand
bundles simpler.

Reviewers: reames, chandlerc, nlewycky

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 03:04:40 +00:00
Matt Arsenault
76b6b15dcd AMDGPU: Fix assert when legalizing atomic operands
The operand layout is slightly different for the atomic
opcodes from the usual MUBUF loads and stores.

This should only fix it on SI/CI. VI is still broken
because it still emits the addr64 replacement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252140 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 02:46:56 +00:00
Matt Arsenault
1c18f49544 AMDGPU: Make addr64 atomic operand order consistent
vaddr comes before srsrc in every other MUBUF instruction,
and is the order it is printed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252139 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 02:46:53 +00:00
Mehdi Amini
2d4640d60d Fix OSX build after r252118 (missing parameter for findModulesAndOffsets())
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 02:29:57 +00:00
Mehdi Amini
e91ef29f2a Remove empty lines
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 02:29:53 +00:00
Joseph Tremoulet
b0d280a588 [WinEH] Fix establisher param reg in CLR funclets
Summary:
The CLR's personality routine passes the pointer to the establisher frame
in RCX, not RDX.

Reviewers: pgavlin, majnemer, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252135 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 02:20:07 +00:00
Sanjoy Das
4ae094a851 [IR] Add bounds checking to dataOperandHasImpliedAttr
This is similar to the bounds check added to paramHasAttr in r252073.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252130 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 01:53:26 +00:00
Kostya Serebryany
331a8c8a87 [libFuzzer] print a bit fewer lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252123 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 01:19:42 +00:00
Rafael Espindola
df00d95573 Go back to producing relocations for out of range symbols.
This brings back the behavior from before r252090 for out of range symbols.

Should bring some arm bots back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252119 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 01:10:15 +00:00
Reid Kleckner
25a4bbe592 [Windows] Symbolize with llvm-symbolizer instead of dbghelp in a self-host
Summary:
llvm-symbolizer understands both PDBs and DWARF, so it is more likely to
succeed at symbolization. If llvm-symbolizer is unavailable, we will
fall back to dbghelp. This also makes our crash traces more similar
between Windows and Linux.

Reviewers: Bigcheese, zturner, chapuni

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252118 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 01:07:54 +00:00
Matt Arsenault
ecbecea873 AMDGPU: Add missing v2f64 fadd tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252117 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 01:03:11 +00:00
Matt Arsenault
f605f93174 AMDGPU: Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252116 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 01:03:08 +00:00
Xinliang David Li
0bf62648ad [PGO] Use template file to define runtime structures
With this change, instrumentation code and reader/write
code related to profile data structs are kept strictly
in-sync. THis will be extended to cfe and compile-rt 
references as well.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 00:47:26 +00:00
Mehdi Amini
8d079d54a3 Fix Abbrev emission in WriteIdentificationBlock
This Abbrev was not emitted and basically unused, just leacking there.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252110 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 00:25:03 +00:00
Rafael Espindola
11431b640c Fix pr24832.
It is pretty simple now that the yak is shaved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252105 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 00:10:08 +00:00
Rafael Espindola
5ff5bdb1d8 Simplify now that emitValueToOffset always returns false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252102 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04 23:59:18 +00:00
Rafael Espindola
036ec43e83 Simplify .org processing and make it a bit more powerful.
We now always create the fragment, which lets us handle things like .org after
a .align.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252101 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04 23:50:29 +00:00
Xinliang David Li
83b18356e6 Define portable macros for packed struct definitions:
1. A macro with argument: LLVM_PACKED(StructDefinition)
 2. A pair of macros defining scope of region with packing:
    LLVM_PACKED_START
     struct A { ... };
     struct B { ... };
    LLVM_PACKED_END

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252099 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04 23:42:56 +00:00