Commit Graph

203713 Commits

Author SHA1 Message Date
Peter Collingbourne 2ed4c8f55d COFF: Add some error checking to SymbolTable::addCombinedLTOObject().
llvm-svn: 240511
2015-06-24 00:12:34 +00:00
Ahmed Bougacha dd5da3e7ed [X86] Don't generate vbroadcasti128 for v4i64 splats from memory.
We used to erroneously match:
    (v4i64 shuffle (v2i64 load), <0,0,0,0>)

Whereas vbroadcasti128 is more like:
    (v4i64 shuffle (v2i64 load), <0,1,0,1>)

This problem doesn't exist for vbroadcastf128, which kept matching
the intrinsic after r231182.  We should perhaps re-introduce the
intrinsic here as well, but that's a separate issue still being
discussed.

While there, add some proper vbroadcastf128 tests.  We don't currently
match those, like for loading vbroadcastsd/ss on AVX (the reg-reg
broadcasts where added in AVX2).

Fixes PR23886.

llvm-svn: 240488
2015-06-24 00:07:16 +00:00
Peter Collingbourne c7b685d997 COFF: Ignore debug symbols.
Differential Revision: http://reviews.llvm.org/D10675

llvm-svn: 240487
2015-06-24 00:05:50 +00:00
Pete Cooper a272f7fca9 Remove unused GlobalVariable::replaceUsesOfWithOnConstant. NFC.
The only caller of this method is Value::replaceAllUsesWith which
explicitly checks that we are not a GlobalValue.  So replace the
body with an unreachable to ensure that we never call it.

The unreachable itself is moved to GlobalValue not GlobalVariable
as that is the base class of all the globals we don't want to call
this method on.

Note, this patch is short lived as i'll soon refactor all callers
of this method.

llvm-svn: 240486
2015-06-24 00:05:07 +00:00
Ahmed Bougacha 89ae9a1e28 [X86] update_llc_test_checks vector-shuffle-*. NFC.
Some of them had gone stale.

llvm-svn: 240485
2015-06-24 00:03:48 +00:00
Rui Ueyama 6a60be7749 COFF: Add names for logging/debugging to COMDAT chunks.
Chunks are basically unnamed chunks of bytes, and we don't like
to give them names. However, for logging or debugging, we want to
know symbols names of functions for COMDAT chunks. (For example,
we want to print out "we have removed unreferenced COMDAT section
which contains a function FOOBAR.")

This patch is to do that.

llvm-svn: 240484
2015-06-24 00:00:52 +00:00
Rui Ueyama 0d2e999050 COFF: Make link order compatible with MSVC link.exe.
Previously, we added files in directive sections to the symbol
table as we read the sections, so the link order was depth-first.
That's not compatible with MSVC link.exe nor the old LLD.

This patch is to queue files so that new files are added to the
end of the queue and processed last. Now addFile() doesn't parse
files nor resolve symbols. You need to call run() to process
queued files.

llvm-svn: 240483
2015-06-23 23:56:39 +00:00
Alex Lorenz 240fc1e0aa MIR Serialization: Serialize immediate machine operands.
Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 240481
2015-06-23 23:42:28 +00:00
Sanjay Patel 6a24811d87 fix typo; NFC
llvm-svn: 240480
2015-06-23 23:26:22 +00:00
Richard Smith 1be4940a1c Fix test failure if this value doesn't end up named %0.
llvm-svn: 240479
2015-06-23 23:13:31 +00:00
Sanjay Patel 9b7e6776a1 don't repeat function names in comments; NFC
llvm-svn: 240478
2015-06-23 23:05:08 +00:00
Petar Jovanovic 280e562072 Add "-mcpu=" option to llvm-rtdyld
This patch adds the -mcpu= option to llvm-rtdyld. With this option, one
can test relocations for different types of CPUs (e.g. Mips64r6).

Patch by Vladimir Radosavljevic.

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

llvm-svn: 240477
2015-06-23 22:52:19 +00:00
Douglas Katzman 51fe7bf227 Use range-based loops when handling OPT_print_search_dirs.
llvm-svn: 240476
2015-06-23 22:43:50 +00:00
Alex Lorenz 51af160f4c MIR Parser: Use correct source locations for machine instruction diagnostics.
This commit translates the source locations for MIParser diagnostics from
the locations in the machine instruction string to the locations in the
MIR file.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 240474
2015-06-23 22:39:23 +00:00
Peter Collingbourne adbde27d2d Update SafeStack TODO in the safestack.cc
This patch clarifies the TODO note at the top of safestack.cc and brings
it more in sync with what we (the CPI team) actually plan to work on in
the future.

Patch by Volodymyr Kuznetsov!

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

llvm-svn: 240473
2015-06-23 22:26:48 +00:00
Peter Collingbourne 7ce9199a57 SafeStack documentation improvements
This patch makes the following improvements to the SafeStack documentation:

Explicitly states the security guarantees of the SafeStack
Clarifies which of the security guarantees are probabilistic
Re-orders security limitations to put the most severe ones first
Explains how `__attribute__((no_sanitize("safe-stack")))` works and how to use it safely
Explains that SafeStack should be combined with a forward-edge protection mechanism, such as CPI, IFCC or others
Multiple readability and stylistic improvements

Patch by Volodymyr Kuznetsov!

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

llvm-svn: 240472
2015-06-23 22:24:45 +00:00
Pete Cooper 86dd4cf5a1 Devirtualize Constant::destroyConstant.
This reorganizes destroyConstant and destroyConstantImpl.

Now there is only destroyConstant in Constant itself, while
subclasses are required to implement destroyConstantImpl.

destroyConstantImpl no longer calls delete but is instead only
responsible for removing the constant from any maps in which it
is contained.

Reviewed by Duncan Exon Smith.

llvm-svn: 240471
2015-06-23 21:55:11 +00:00
Chris Bieneman f1ba141041 Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

Darwin doesn't have _Unwind_VRS_Get, instead use _Unwind_GetIP directly.

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

llvm-svn: 240470
2015-06-23 21:39:57 +00:00
Chris Bieneman d1a1444c1a Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

This change ifdefs out headers and functionality that aren't available on iOS, and adds support for iOS and the iOS simulator to as an.

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: glider, kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, zaks.anna, llvm-commits

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

llvm-svn: 240469
2015-06-23 21:39:54 +00:00
Chris Bieneman 04f0643a76 Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

This change ifdefs out headers and functionality that aren't available on iOS.

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: glider, kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

llvm-svn: 240468
2015-06-23 21:39:52 +00:00
Chris Bieneman e13272a008 Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

This change does the following:
- Don't include crt_externs on iOS (it isn't available)
- Support ARM thread state objects

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: glider, kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, aemerson, llvm-commits

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

llvm-svn: 240467
2015-06-23 21:39:49 +00:00
Greg Clayton 0b90be1c4f Implement the "qSymbol" packet in order to be able to read queue information in debugserver and return the info in the stop reply packets.
A "qSymbol::" is sent when shared libraries have been loaded by hooking into the Process::ModulesDidLoad() function from within ProcessGDBRemote. This function was made virtual so that the ProcessGDBRemote version is called, which then first calls the Process::ModulesDidLoad(), and then it queries for any symbol lookups that the remote GDB server might want to do.

This allows debugserver to request the "dispatch_queue_offsets" symbol so that it can read the queue name, queue kind and queue serial number and include this data as part of the stop reply packet. Previously each thread would have to do 3 memory reads in order to read the queue name.

This is part of reducing the number of packets that are sent between LLDB and the remote GDB server.

<rdar://problem/21494354>

llvm-svn: 240466
2015-06-23 21:27:50 +00:00
Simon Pilgrim a0d5c5924a [X86][SSE] Added full set of 128-bit vector shift tests.
Removed some old duplicate tests.

llvm-svn: 240465
2015-06-23 21:18:15 +00:00
Benjamin Kramer 452695e08a [Driver] Give GnuTool LLVM_LIBRARY_VISIBILITY.
This is consistent with all other classes in Tools.h.

llvm-svn: 240464
2015-06-23 21:15:15 +00:00
Bob Wilson 0c6ed3d29b Improve error handling for PR22560.
The ARM _MoveToCoprocessor and _MoveFromCoprocessor builtins require
integer constants for most arguments, but clang was not checking that.
With this change, we now report meaningful errors instead of crashing
in the backend.

llvm-svn: 240463
2015-06-23 21:10:24 +00:00
Bob Wilson 09aa90bbe1 PR22560: Fix argument order for ARM _MoveToCoprocessor builtins.
The Microsoft-extension _MoveToCoprocessor and _MoveToCoprocessor2
builtins take the register value to be moved as the first argument,
but the corresponding mcr and mcr2 LLVM intrinsics expect that value
to be the third argument. Handle this as a special case, while still
leaving those intrinsics as generic MSBuiltins. I considered the
alternative of handling these in EmitARMBuiltinExpr, but that does
not work well for the follow-up change that I'm going to make to improve
the error handling for PR22560 -- we need the GetBuiltinType() checks
for ICEArguments, and the ARM version of that code is only used for
Neon intrinsics where the last argument is special and not
checked in the normal way.

llvm-svn: 240462
2015-06-23 21:10:15 +00:00
Jim Ingham 60c915e96a Fix the handling of the run lock in cases where you needed to run
a hand-called function from the private state thread.  The problem 
was that on the way out of the private state thread, we try to drop
the run lock.  That is appropriate for the main private state thread,
but not the secondary private state thread.  Only the thread that 
spawned them can know whether this is an appropriate thing to do or
not.

<rdar://problem/21375352>

llvm-svn: 240461
2015-06-23 21:02:45 +00:00
Alexey Samsonov 19ffcb900f Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.
Currently some users of this function do this explicitly, and all the
rest forget to do this.

ThreadSanitizer was one of such users, and had missing debug
locations for calls into TSan runtime handling atomic operations,
eventually leading to poorly symbolized stack traces and malfunctioning
suppressions.

This is another change relevant to PR23837.

llvm-svn: 240460
2015-06-23 21:00:08 +00:00
Evgeniy Stepanov 5bd81f3264 Pass 2 more variables to lit tests.
Pass ADB and ADB_SERIAL environment variables to lit tests.
This would allow running Android tests in compiler-rt when
there is more than one device attached to the host.

llvm-svn: 240459
2015-06-23 20:57:26 +00:00
Tobias Grosser a608569856 Replace srem by function call in nonaffine test cases
This makes the test cases nonaffine even if Polly some days gains support for
the srem instruction, an instruction which is currently not modeled but which
can clearly be modeled statically. A call to a function without definition
will always remain non-affine, as there is just insufficient static information
for it to be modeled more precisely.

llvm-svn: 240458
2015-06-23 20:55:05 +00:00
Tobias Grosser 6ca162e6e0 Add git patch files to .gitignore
llvm-svn: 240457
2015-06-23 20:55:01 +00:00
Marshall Clow 052085e6e0 Mark a couple of features as 'in progress'
llvm-svn: 240456
2015-06-23 20:48:55 +00:00
Douglas Katzman 9535429270 Pedantically rename all Tool subclasses to be nouns, not verbs. NFC
Classes in Tools.h inherit ultimately from Tool, which is a noun,
but subclasses of Tool were named for their operation, such as "Compile",
wherein the constructor call "Compile(args...)" could be misconstrued
as actually causing a compile to happen.

Likewise various other methods were not harmonious with their effect,
in that "BuildLinker()" returned a "new namespace::Link(...)"
instead of a "new namespace::Linker(...)" which it now does.

Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names.
And there is no particulary great way to name the "Lipo-er" and a few others.

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

llvm-svn: 240455
2015-06-23 20:42:09 +00:00
Lang Hames 49047039b0 [lld] Add MachO thread-local storage support.
This allows LLD to correctly link MachO objects that use thread-local storage.

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

llvm-svn: 240454
2015-06-23 20:35:31 +00:00
David Majnemer 08ef2ba113 [MS ABI] Account for the virtual inheritance quirk when mangling
Virtual inheritance member pointers are always relative to the vbindex,
even when the member pointer doesn't point into a virtual base.  This is
corrected by adjusting the non-virtual offset backwards from the vbptr
back to the top of the most derived class.  While we performed this
adjustment when manifesting member pointers as constants or when
performing conversions, we didn't perform the adjustment when mangling
them.

llvm-svn: 240453
2015-06-23 20:34:18 +00:00
Justin Bogner e44dd6dbd0 InstrProf: Fix a crash when an implicit def appears in a macro
llvm-svn: 240452
2015-06-23 20:29:09 +00:00
Jim Ingham c917a381f8 Remove a few uses of lldb.target, which is not valid
in a scripted command.

llvm-svn: 240451
2015-06-23 20:26:45 +00:00
Pirama Arumuga Nainar 4a39e80809 Fix incorrect truncation at the overflow boundary
Summary:
This patch fixes incorrect truncation when the input wider value is
exactly 2^dstBits.  For that value, the overflow to infinity is not
correctly handled.  The fix is to replace a strict '>' with '>='.

Currently,
__truncdfsf2(340282366900000000000000000000000000000.0) returns infinity
__truncdfsf2(340282366920938463463374607431768211456.0) returns 0
__truncdfsf2(400000000000000000000000000000000000000.0) returns infinity

Likewise, __truncdfhf2 and __truncsfhf2 (and consequently gnu_f2h_ieee)
are discontinuous at 65536.0.

This patch adds tests for all three cases, along with adding a missing
header include to fp_test.h.

Reviewers: joerg, ab, srhines

Subscribers: llvm-commits

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

llvm-svn: 240450
2015-06-23 20:24:53 +00:00
Jay Foad 2aec6216cb [msan] Mark one test as only supported on x86
Summary: This test uses x86 intrinsics, so it can't work on other platforms.

Reviewers: garious, eugenis, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 240449
2015-06-23 20:17:45 +00:00
Sanjoy Das 3f1bc3b2bb Revert "[FaultMaps] Move FaultMapParser to Object/"
This reverts commit r240364 (git c49542e5bb186).  The issue r240364 was
trying to fix was fixed independently in r240362.

llvm-svn: 240448
2015-06-23 20:09:03 +00:00
Peter Collingbourne bf0aa08bba COFF: Fix null pointer dereference.
llvm-svn: 240447
2015-06-23 20:02:31 +00:00
Benjamin Kramer cfacc9d3e6 [MachO] Initialize all fields of NormalizedFile.
The ObjectFileYAML.roundTrip serializes a default-constructed
NormalizedFile to YAML, triggering uninitialized memory reads.

While there use in-class member initializers.

llvm-svn: 240446
2015-06-23 19:55:04 +00:00
Benjamin Kramer 44b0723069 Add missing dependencies for the CMake shared lld build.
llvm-svn: 240445
2015-06-23 19:54:57 +00:00
Dawn Perchik 06ffe15adf Fix FIXME comments in MiBreakTestCase.test_lldbmi_break_insert_settings as suggested by abidh (MI)
llvm-svn: 240444
2015-06-23 19:21:44 +00:00
Kaelyn Takata 72d16a581b Make the typo resolution in r240441 apply to all function calls.
Regular function calls (such as to cabs()) run into the same problem
with handling dependent exprs, not just builtins with custom type
checking.

Fixes PR23775.

llvm-svn: 240443
2015-06-23 19:13:17 +00:00
Steven Wu df2eb7777d Adding the missing LTO API to lto.exports
Summary:
lto_codegen_set_should_embed_uselists is introduced in r235943 but not
added to lto.exports. Add to export list to expose the API.

Reviewers: dexonsmith

Subscribers: rafael, llvm-commits

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

llvm-svn: 240442
2015-06-23 18:56:48 +00:00
Kaelyn Takata e53f0f9019 Ensure delayed typos have been corrected in calls to builtins before
checking those calls when not in C++ mode, since those code paths can't
handle dependent exprs.

Fixes PR23740.

llvm-svn: 240441
2015-06-23 18:42:21 +00:00
Dawn Perchik dc975670c1 Add support for displaying the language in the frame-format string.
Enable ${language} to be specified in the frame-format string to see
the current frame's compile unit language in "frame info".

Test Plan:
debug a C++ program, run to main, and run the lldb commands:
    settings set frame-format "frame lang=${language}\n"
    frame info
you should see:
    frame lang=c++
test case added in:
    ./dotest.py --executable lldb -f SettingsCommandTestCase.test_set_frame_format
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10561

llvm-svn: 240440
2015-06-23 18:35:31 +00:00
Rafael Espindola ae3ac08326 Don't pass a 32 bit value to "%08" PRIx64.
Should fix the arm bots.

llvm-svn: 240439
2015-06-23 18:34:25 +00:00
Mark Heffernan 9b536a640b This change fixes three bugs in loop unswitching. This change causes an 81% speed-up on a benchmark that is based on EigenConvolutionKernel2D from Eigen3, where the lack of loop unswitching blocks hoisting of loads out of a nested loop (see bug 23816 for how loop unswitching and load hoisting are related).
Change 1: Unswitching on trivial conditions should always happen regardless of the computed unswitching cost, as really the cost is zero. While there is code to make that happen, the logic that checks the unswitching cost against a threshold was moved to an earlier point (revision 147935) than the point where trivial unswitching is detected, so trivial unswitching is currently blocked by the cost threshold. This change fixes that.

Change 2: Before revision 147935 (from 2012-01-11), the threshold parameter was a per-loop threshold. So an unswitching happened only if the cost of the unswitching was less than the threshold. In an indirect way (and I believe unintentionally), the logic for this since then has been that the threshold is an over-all budget across all loops for all loop unswitching done by a given LoopUnswitch loop pass object. So if an unswitching with cost 100 happens in one function, that in effect reduces the threshold from 100 to 0 for the loops even in another function. This persists for the lifetime of that loop pass object. This makes no difference for most small examples but it is important for large examples. This revision fixes that.

Change 3: The cost is currently calculated as std::min(NumInstructions, 5 * NumBlocks). So a loop with 2 blocks and a million instructions will have an unswitching cost of 10. I changed this to just NumInstructions, as it were before revision 147935, though I'm open to e.g. instead replacing std::min with std::max.

I've tried to make the change minimally invasive while staying with what I think was the original intent of the code.
Submitted on behalf of broune@.

llvm-svn: 240438
2015-06-23 18:26:50 +00:00