Reid Kleckner [Thu, 23 Apr 2015 18:34:01 +0000 (18:34 +0000)]
Revert "[SEH] Remove the old __C_specific_handler code now that WinEHPrepare works"
We still have some "uses remain after removal" issues in -O0 builds.
This reverts commit r235557.
llvm-svn: 235617
Hal Finkel [Thu, 23 Apr 2015 18:30:38 +0000 (18:30 +0000)]
[PowerPC] Enable printing instructions using aliases
TableGen had been nicely generating code to print a number of instructions using
shorter aliases (and PowerPC has plenty of short mnemonics), but we were not
calling it. For some of the aliases we support in the parser, TableGen can't
infer the "inverse" alias relationship, so there is still more to do.
Thus, after some hours of updating test cases...
llvm-svn: 235616
Chaoren Lin [Thu, 23 Apr 2015 18:28:04 +0000 (18:28 +0000)]
Fix TestFdLeak on Linux.
Summary:
LLGS leaks pipes (when launched by lldb), sockets (when launched by platform),
and/or log file to the inferior. This should prevent all possible leaks.
Reviewers: vharron, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9211
llvm-svn: 235615
Richard Smith [Thu, 23 Apr 2015 18:18:26 +0000 (18:18 +0000)]
[modules] Determine the set of macros exported by a submodule at the end of that submodule.
Previously we'd defer this determination until writing the AST, which doesn't
allow us to use this information when building other submodules of the same
module. This change also allows us to use a uniform mechanism for writing
module macro records, independent of whether they are local or imported.
llvm-svn: 235614
Reid Kleckner [Thu, 23 Apr 2015 18:07:13 +0000 (18:07 +0000)]
Don't emit lifetime markers when msan is enabled
In r235553, Clang started emitting lifetime markers more often. This
caused false negative in MSan, because MSan only poisons all allocas
once at function entry. Eventually, MSan should poison allocas at
lifetime start and probably also lifetime end, but until then, let's not
emit markers that aren't going to be useful.
llvm-svn: 235613
Zachary Turner [Thu, 23 Apr 2015 17:37:47 +0000 (17:37 +0000)]
Move DIContext.h to common DebugInfo location.
This will enable us to create a PDBContext so as to expose some
amount of debug info functionality through a common interace.
Differential Revision: http://reviews.llvm.org/D9205
Reviewed by: Alexey Samsonov
llvm-svn: 235612
Philip Reames [Thu, 23 Apr 2015 17:36:48 +0000 (17:36 +0000)]
Move Value.isDereferenceablePointer to ValueTracking [NFC]
Move isDereferenceablePointer function to Analysis. This function recursively tracks dereferencability over a chain of values like other functions in ValueTracking.
This refactoring is motivated by further changes to support dereferenceable_or_null attribute (http://reviews.llvm.org/D8650). isDereferenceablePointer will be extended to perform context-sensitive analysis and IR is not a good place to have such functionality.
Patch by: Artur Pilipenko <apilipenko@azulsystems.com>
Differential Revision: reviews.llvm.org/D9075
llvm-svn: 235611
Pirama Arumuga Nainar [Thu, 23 Apr 2015 17:32:25 +0000 (17:32 +0000)]
[AArch64] Add nvcast patterns for v4f16 and v8f16
Summary:
Constant stores of f16 vectors can create NvCast nodes from various
operand types to v4f16 or v8f16 depending on patterns in the stored
constants. This patch adds nvcast rules with v4f16 and v8f16 values.
AArchISelLowering::LowerBUILD_VECTOR has the details on which constant
patterns generate the nvcast nodes.
Reviewers: jmolloy, srhines, ab
Subscribers: rengolin, aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D9201
llvm-svn: 235610
Pirama Arumuga Nainar [Thu, 23 Apr 2015 17:16:27 +0000 (17:16 +0000)]
[AArch64] Handle vec4, vec8, vec16 *itofp for half
Summary:
Set operation action for SINT_TO_FP and UINT_TO_FP nodes with v4i32,
v8i8, v8i16 inputs to allow promotion of v4f16 results.
Add tests for sitofp and uitofp for vec4, vec8, vec16, and i8, i16, i32,
and i64 vectors. Only missing tests are for v16i8 and v16i16 as the
shift operations are too complicated to write a proper check sequence.
The conversions from v4i64 to v4f16 do not depend on this patch - v4i64
is split and the conversion gets handled while lowering v2i64. I am
adding a test here for completeness.
Reviewers: aemerson, rengolin, ab, jmolloy, srhines
Subscribers: rengolin, aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D9166
llvm-svn: 235609
Hans Wennborg [Thu, 23 Apr 2015 16:45:24 +0000 (16:45 +0000)]
Re-commit r235560: Switch lowering: extract jump tables and bit tests before building binary tree (PR22262)
Third time's the charm. The previous commit was reverted as a
reverse for-loop in SelectionDAGBuilder::lowerWorkItem did 'I--'
on an iterator at the beginning of a vector, causing asserts
when using debugging iterators. This commit fixes that.
llvm-svn: 235608
Marshall Clow [Thu, 23 Apr 2015 16:45:08 +0000 (16:45 +0000)]
Fixed an 'extra tokens at end of #endif directive' warning in experimental/ratio
llvm-svn: 235607
Aaron Ballman [Thu, 23 Apr 2015 16:14:19 +0000 (16:14 +0000)]
Extend format specifier checking to include field function pointers in addition to variable function pointers. Addresses PR21082.
llvm-svn: 235606
Aaron Ballman [Thu, 23 Apr 2015 16:12:42 +0000 (16:12 +0000)]
Diagnose variadic main() as an extension; addresses PR17905.
llvm-svn: 235605
Sanjay Patel [Thu, 23 Apr 2015 16:07:50 +0000 (16:07 +0000)]
use update_llc_test_checks.py to tighten checking; remove unnecessary CPU param
llvm-svn: 235604
Krzysztof Parzyszek [Thu, 23 Apr 2015 16:05:39 +0000 (16:05 +0000)]
[Hexagon] Shrink-wrap stack frame (Hexagon-specific)
llvm-svn: 235603
Krzysztof Parzyszek [Thu, 23 Apr 2015 15:12:49 +0000 (15:12 +0000)]
[Hexagon] Add testcases for stack alignment and variable-sized objects
llvm-svn: 235602
Toma Tabacu [Thu, 23 Apr 2015 14:48:38 +0000 (14:48 +0000)]
[mips] [IAS] Move NOP emission after pseudo-instruction expansion. NFC.
As suggested in the review for http://reviews.llvm.org/D8537.
llvm-svn: 235601
Daniel Jasper [Thu, 23 Apr 2015 13:58:40 +0000 (13:58 +0000)]
clang-format: Properly detect variable declarations with ObjC.
Before:
LoooooooooooooooooooooooooooooooooooooooongType
LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
After:
LoooooooooooooooooooooooooooooooooooooooongType
LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
llvm-svn: 235599
Aidan Dodds [Thu, 23 Apr 2015 13:57:30 +0000 (13:57 +0000)]
Replace use of %zu with PRIu64 in DYDL logging message.
llvm-svn: 235598
Aaron Ballman [Thu, 23 Apr 2015 13:41:59 +0000 (13:41 +0000)]
Revert r235560; this commit was causing several failed assertions in Debug builds using MSVC's STL. The iterator is being used outside of its valid range.
llvm-svn: 235597
Filipe Cabecinhas [Thu, 23 Apr 2015 13:38:21 +0000 (13:38 +0000)]
Be more strict about the operand for the array type in BitcodeReader
Summary: Bug found with AFL fuzz.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9016
llvm-svn: 235596
Filipe Cabecinhas [Thu, 23 Apr 2015 13:25:35 +0000 (13:25 +0000)]
Verify sizes when trying to read a BitcodeAbbrevOp
Summary:
Make sure the abbrev operands are valid and that we can read/skip them
afterwards.
Bug found with AFL fuzz.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9030
llvm-svn: 235595
Daniel Sanders [Thu, 23 Apr 2015 13:23:21 +0000 (13:23 +0000)]
[asan] debug_mapping.cc should also pass when the leading digit of SHADOW_SCALE is hexadecimal.
Summary:
Previously the CHECK directive for SHADOW_SCALE only matched decimal digits
causing it to match '7' on x86_64 instead of the whole value.
This fixes a failure on mips-linux-gnu targets where the leading digit is 'a'.
Reviewers: kcc, sagar, timurrrr
Reviewed By: timurrrr
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9199
llvm-svn: 235594
Timur Iskhodzhanov [Thu, 23 Apr 2015 13:18:50 +0000 (13:18 +0000)]
[Sanitizer coverage] Print out the error number if OpenFile fails
llvm-svn: 235593
Daniel Jasper [Thu, 23 Apr 2015 12:59:09 +0000 (12:59 +0000)]
clang-format: Allow splitting "= default" and "= delete".
Otherwise, this can violate the column limit.
llvm-svn: 235592
Timur Iskhodzhanov [Thu, 23 Apr 2015 12:58:11 +0000 (12:58 +0000)]
[ASan/Win] Initialize sandbox-related stuff when asked to
llvm-svn: 235591
Timur Iskhodzhanov [Thu, 23 Apr 2015 12:57:29 +0000 (12:57 +0000)]
[ASan/Win] Don't forget to set *last_error if OpenFile fails
llvm-svn: 235590
Ilia K [Thu, 23 Apr 2015 12:48:42 +0000 (12:48 +0000)]
MI fix allowing multiple logging instances of lldb-mi to run simultaneously.
Summary:
Currently if two instances of lldb-mi are running with logging enabled using '--log' the log file conflicts. This produces the following error
MI: Error: File Handler. Error Permission denied opening 'C:\Users\Ewan\LLVM\build\Debug\bin\lldb-mi-log.txt'
Fixed in this patch by renaming lldb-mi-log.txt based on the date, e.g. lldb-mi-log.txt-
20150316163631.log, and moving the file into the temp directory by using the --log-dir option.
Regrading previous review comments the P_tmpdir macro is defined in Windows but always points to "\", which doesn't help much. Also when using the Windows API for GetTempPath() dynamic memory seems much more messy.
Patch from ewan@codeplay.com
Reviewers: abidh, EwanCrawford
Subscribers: zturner, lldb-commits, deepak2427
Differential Revision: http://reviews.llvm.org/D9054
llvm-svn: 235589
Tobias Grosser [Thu, 23 Apr 2015 12:23:56 +0000 (12:23 +0000)]
JScoP Import/Export: Ensure parameters have the same isl_id
When reading parameters from a JSON file parameters with identical names
may be related to different isl_ids, which then causes isl to treat them
as differnet objects. This does not cause issues at the moment, but has
shown problematic in subsequent schedule tree changes.
This commit will be tested by the following changes.
llvm-svn: 235588
Tamas Berghammer [Thu, 23 Apr 2015 10:56:51 +0000 (10:56 +0000)]
Update cpsr register in BLX instruction emulation
Write the new cpsr value into the cpsr register if the BL or the BLX
instruction change the instruction set on arm.
Differential revision: http://reviews.llvm.org/D9188
llvm-svn: 235585
Tamas Berghammer [Thu, 23 Apr 2015 10:54:27 +0000 (10:54 +0000)]
Fix test expectation in TestNoreturnUnwind
The test case lookinhg for the abort function in the stack trace.
Previously it lookd for a function which ends with "abort" but on some
system there are multiple such functions (e.g.: on android abort calls
__libc_android_abort) what made the test fail. This CL change the
behaviour to look for the abort function based on a fix list of names.
llvm-svn: 235584
Daniel Jasper [Thu, 23 Apr 2015 10:23:53 +0000 (10:23 +0000)]
clang-format: Don't add unwanted space when creating new arrays.
Before:
char** newargv = new char* [argc];
After:
char** newargv = new char*[argc];
llvm-svn: 235583
Daniel Jasper [Thu, 23 Apr 2015 09:54:10 +0000 (09:54 +0000)]
clang-format: [Proto] Don't linewrap top-level options.
They are very similar to import statements.
llvm-svn: 235582
Dmitry Vyukov [Thu, 23 Apr 2015 09:33:27 +0000 (09:33 +0000)]
tsan: support setuid call
Currently the call hangs because the background thread
does not handle SIGSETXID signal.
llvm-svn: 235581
Daniel Jasper [Thu, 23 Apr 2015 09:23:17 +0000 (09:23 +0000)]
clang-format: Support nested block formatting with ColumnLimit=0.
llvm-svn: 235580
Pavel Labath [Thu, 23 Apr 2015 09:04:35 +0000 (09:04 +0000)]
[NativeProcessLinux] Fix race condition during inferior thread creation
The following situation occured if we were stopping a process (due to breakpoint, watchpoint, ...
hit) while a new thread was being created.
- process has two threads: A and B.
- thread A hits a breakpoint: we send a STOP signal to thread B and register a callback with
ThreadStateCoordinator to send a stop notification after the thread stops.
- thread B stops, but not due to the SIGSTOP, but on a thread creation event (of a new thread C).
We are unaware of our desire to stop, so we queue ThreadStopped and RequestResume operations
with TSC, so the thread can continue running.
- TSC receives the ThreadStopped event, sees that all threads are stopped and fires the delayed
stop notification.
- immediately after that TSC gets the RequestResume operation, so it resumes the thread.
At this point the state is inconsistent because LLDB thinks the process is stopped and will start
issuing commands to it, but one of the threads is in fact running. Things eventually break.
I address this problem by omitting the two TSC events altogether and Resuming the thread B
directly. This way the short stop is invisible to the TSC and the delayed notification will not
fire. We will fire the notification when we actually process the SIGSTOP on thread B.
When we get the initial SIGSTOP for thread C, we also resume the thread and send a
ThreadWasCreated message (is_stopped = false) to the TSC. This way, the TSC can stop the thread
on its own and handle the stop event later. This way the state of the new thread is correctly
handled as well (thanks Chaoren for the idea).
This patch also removes the synchronisation between the thread creation notifications on threads
B and C. The need for this synchronisation is unclear (the comments seem to hint that the new
thread is "fully created" only after we process both events, but I have noticed no regressions in
treating it as "created" even after just processing the initial C event), but it is a source for
many kinds of obscure races, since it introduces a new thread state "Launching" and the rest of
the code does not handle this state at all (what happens if we get a resume request from LLDB
while this thread is launching? what happens if we get a stop request? etc.).
This fixes the "spurious $O packet" problem in TestPrintStackTraces.py. However, the test remains
disabled on i386 due to the VDSO issue.
Test Plan:
TestPrintStackTraces works on x86_64. No regressions in the rest of the test suite.
Reviewers: vharron, chaoren
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9145
llvm-svn: 235579
Simon Pilgrim [Thu, 23 Apr 2015 08:43:13 +0000 (08:43 +0000)]
[DAGCombiner] Remove extra bitcasts surrounding vector shuffles
Patch to remove extra bitcasts from shuffles, this is often a legacy of XformToShuffleWithZero being used to combine bitmaskings (of float vectors bitcast to integer vectors) into shuffles: bitcast(shuffle(bitcast(s0),bitcast(s1))) -> shuffle(s0,s1)
Differential Revision: http://reviews.llvm.org/D9097
llvm-svn: 235578
Karthik Bhat [Thu, 23 Apr 2015 08:29:20 +0000 (08:29 +0000)]
Move common loop utility function isInductionPHI into LoopUtils.cpp
This patch refactors the definition of common utility function "isInductionPHI" to LoopUtils.cpp.
This fixes compilation error when configured with -DBUILD_SHARED_LIBS=ON
llvm-svn: 235577
Alexey Bataev [Thu, 23 Apr 2015 07:56:25 +0000 (07:56 +0000)]
[OPENMP] Fix for failed tests for 'omp atomic write' construct.
llvm-svn: 235576
David Majnemer [Thu, 23 Apr 2015 07:42:08 +0000 (07:42 +0000)]
[MS ABI] Add support for mangling VLA types
Treat a VLA type like an incomplete array type.
llvm-svn: 235575
Mohit K. Bhakkad [Thu, 23 Apr 2015 06:36:20 +0000 (06:36 +0000)]
[LLDB][MIPS] Add MIPS32 and MIPS64 core revisions
Patch by Jaydeep Patil
Added MIPS32 and MIPS64 core revisions. This would be followed by register context and emulate-instruction for MIPS32.
DYLDRendezvous.cpp:
On Linux link map struct does not contain extra load offset field.
Reviewers: clayborg
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D9190
llvm-svn: 235574
Alexey Bataev [Thu, 23 Apr 2015 06:35:10 +0000 (06:35 +0000)]
[OPENMP] Codegen for 'atomic capture'.
Adds codegen for 'atomic capture' constructs with the following forms of expressions/statements:
v = x binop= expr;
v = x++;
v = ++x;
v = x--;
v = --x;
v = x = x binop expr;
v = x = expr binop x;
{v = x; x = binop= expr;}
{v = x; x++;}
{v = x; ++x;}
{v = x; x--;}
{v = x; --x;}
{x = x binop expr; v = x;}
{x binop= expr; v = x;}
{x++; v = x;}
{++x; v = x;}
{x--; v = x;}
{--x; v = x;}
{x = x binop expr; v = x;}
{x = expr binop x; v = x;}
{v = x; x = expr;}
If x and expr are integer and binop is associative or x is a LHS in a RHS of the assignment expression, and atomics are allowed for type of x on the target platform atomicrmw instruction is emitted.
Otherwise compare-and-swap sequence is emitted.
Update of 'v' is not required to be be atomic with respect to the read or write of the 'x'.
bb:
...
atomic load <x>
cont:
<expected> = phi [ <x>, label %bb ], [ <new_failed>, %cont ]
<desired> = <expected> binop <expr>
<res> = cmpxchg atomic &<x>, desired, expected
<new_failed> = <res>.field1;
br <res>field2, label %exit, label %cont
exit:
atomic store <old/new x>, <v>
...
Differential Revision: http://reviews.llvm.org/D9049
llvm-svn: 235573
David Majnemer [Thu, 23 Apr 2015 05:21:20 +0000 (05:21 +0000)]
[MS ABI] Treat ConstantArrayType like IncompleteArrayType in args
Type backreferences for arguments use the DecayedType's original type.
Because of this, arguments with the same canonical type with the same
mangling would not backreference each other if one was a
ConstantArrayType while the other was an IncompleteArrayType. Solve
this by canonicalizing the ConstantArrayType to a suitable
IncompleteArrayType.
This fixes PR23325.
llvm-svn: 235572
Karthik Bhat [Thu, 23 Apr 2015 04:51:44 +0000 (04:51 +0000)]
Add support to interchange loops with reductions.
This patch enables interchanging of tightly nested loops with reductions.
Differential Revision: http://reviews.llvm.org/D8314
llvm-svn: 235571
Richard Smith [Thu, 23 Apr 2015 04:13:52 +0000 (04:13 +0000)]
[modules] Actually allocate the extra space we use for the tail-allocated array
in this class.
llvm-svn: 235570
Alexey Samsonov [Thu, 23 Apr 2015 01:50:56 +0000 (01:50 +0000)]
[UBSan] Unify the way we report overflow in increment/decrement operator.
llvm-svn: 235569
Alexey Samsonov [Thu, 23 Apr 2015 01:50:45 +0000 (01:50 +0000)]
Unify the way we report overflow in increment/decrement operator.
Summary:
Make sure signed overflow in "x--" is checked with
llvm.ssub.with.overflow intrinsic and is reported as:
"-
2147483648 - 1 cannot be represented in type 'int'"
instead of:
"-
2147483648 + -1 cannot be represented in type 'int'"
, like we do for unsigned overflow.
Test Plan: clang + compiler-rt regression test suite
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D8236
llvm-svn: 235568
Alexey Samsonov [Thu, 23 Apr 2015 01:08:31 +0000 (01:08 +0000)]
[UBSan] Make sure proper error summary is printed for -fsanitize=float-cast-overflow.
float-cast-overflow handler doesn't have source location provided by the
compiler, but we still have *some* source location if we have a
symbolizer.
llvm-svn: 235567
Andrew Kaylor [Thu, 23 Apr 2015 00:38:22 +0000 (00:38 +0000)]
[WinEH] Removing seh-filter.ll until I can determine its validity
llvm-svn: 235566
Justin Bogner [Thu, 23 Apr 2015 00:31:16 +0000 (00:31 +0000)]
InstrProf: Fix a shadowing error that would break length of profile names
We try to use the member variable "FuncName" here, but we've also used
that name as a parameter. This ends with us getting the length of the
function name wrong when we generate the coverage data.
llvm-svn: 235565
Jim Ingham [Thu, 23 Apr 2015 00:28:25 +0000 (00:28 +0000)]
Missed one piece when committing r235538.
llvm-svn: 235564
Andrew Kaylor [Thu, 23 Apr 2015 00:20:44 +0000 (00:20 +0000)]
[WinEH] Don't skip landing pads that end with an unreachable instruction.
llvm-svn: 235563
Reid Kleckner [Wed, 22 Apr 2015 23:39:15 +0000 (23:39 +0000)]
[WinEH] Don't emit an exceptional cleanup for llvm.eh.endcatch
These extra endcatch markers aren't helping identify regions to outline,
so let's get rid of them. LLVM outlines (more or less) from begincatch
to endcatch. Any unwind edge from an enclosed invoke is a transition to
a new exception handler, which has it's own outlining markers.
llvm-svn: 235562
Hans Wennborg [Wed, 22 Apr 2015 23:14:56 +0000 (23:14 +0000)]
Switch lowering: extract jump tables and bit tests before building binary tree (PR22262)
This is a re-commit of r235101, which also fixes the problems with the previous patch:
- Switches with only a default case and non-fallthrough were handled incorrectly
- The previous patch tickled a bug in PowerPC Early-Return Creation which is fixed here.
> This is a major rewrite of the SelectionDAG switch lowering. The previous code
> would lower switches as a binary tre, discovering clusters of cases
> suitable for lowering by jump tables or bit tests as it went along. To increase
> the likelihood of finding jump tables, the binary tree pivot was selected to
> maximize case density on both sides of the pivot.
>
> By not selecting the pivot in the middle, the binary trees would not always
> be balanced, leading to performance problems in the generated code.
>
> This patch rewrites the lowering to search for clusters of cases
> suitable for jump tables or bit tests first, and then builds the binary
> tree around those clusters. This way, the binary tree will always be balanced.
>
> This has the added benefit of decoupling the different aspects of the lowering:
> tree building and jump table or bit tests finding are now easier to tweak
> separately.
>
> For example, this will enable us to balance the tree based on profile info
> in the future.
>
> The algorithm for finding jump tables is quadratic, whereas the previous algorithm
> was O(n log n) for common cases, and quadratic only in the worst-case. This
> doesn't seem to be major problem in practice, e.g. compiling a file consisting
> of a 10k-case switch was only 30% slower, and such large switches should be rare
> in practice. Compiling e.g. gcc.c showed no compile-time difference. If this
> does turn out to be a problem, we could limit the search space of the algorithm.
>
> This commit also disables all optimizations during switch lowering in -O0.
>
> Differential Revision: http://reviews.llvm.org/D8649
llvm-svn: 235560
Zachary Turner [Wed, 22 Apr 2015 22:53:18 +0000 (22:53 +0000)]
Use the debugginess of the python interpreter when symlinking _lldb.pyd.
Previously we would pass an argument to finishSwigWrapperClasses.py which
specified whether this was a debug or a release build. But sometimes
CMAKE_BUILD_TYPE would not be set to anything, causing this argument
to be empty when passed in. The only purpose of this argument was to
determine whether or not to append _d to the extension module when
creating the symlink. This is only necessary when doing a debug
build of LLDB on Windows, which implies a debug interpreter, so we
replace this with a check to see if the running interpreter is a debug
one, and append _d if so.
llvm-svn: 235559
David Majnemer [Wed, 22 Apr 2015 22:42:05 +0000 (22:42 +0000)]
[InstCombine] Use a more targeted fix instead of r235544
Only clear out the NSW/NUW flags if we are optimizing 'add'/'sub' while
taking advantage that the sign bit is not set. We do this optimization
to further shrink the mask but shrinking the mask isn't NSW/NUW
preserving in this case.
llvm-svn: 235558
Reid Kleckner [Wed, 22 Apr 2015 22:13:09 +0000 (22:13 +0000)]
[SEH] Remove the old __C_specific_handler code now that WinEHPrepare works
This removes the -sehprepare flag and makes __C_specific_handler
functions always to use WinEHPrepare.
This was tested by building all of chromium_builder_tests and running a
few tests that use SEH, but if something breaks, we can revert this.
llvm-svn: 235557
Krzysztof Parzyszek [Wed, 22 Apr 2015 21:41:24 +0000 (21:41 +0000)]
Unxfail passing test on Hexagon
llvm-svn: 235556
Reid Kleckner [Wed, 22 Apr 2015 21:39:55 +0000 (21:39 +0000)]
Fix another test broken by r235537
llvm-svn: 235555
Lang Hames [Wed, 22 Apr 2015 21:38:37 +0000 (21:38 +0000)]
[RuntimeDyld][COFF] Add external symbol resolution support to RuntimeDyldCOFF.
Patch by Andy Ayers. Thanks Andy!
llvm-svn: 235554
David Majnemer [Wed, 22 Apr 2015 21:38:15 +0000 (21:38 +0000)]
Revert "Revert r234581, it might have caused a few miscompiles in Chromium."
This reverts commit r234700. It turns out that the lifetime markers
were not the cause of Chromium failing but a bug which was uncovered by
optimizations exposed by the markers.
llvm-svn: 235553
Krzysztof Parzyszek [Wed, 22 Apr 2015 21:17:00 +0000 (21:17 +0000)]
[Hexagon] Some cleanup of instruction selection code
llvm-svn: 235552
Reid Kleckner [Wed, 22 Apr 2015 21:14:25 +0000 (21:14 +0000)]
Fix test failure caused by r235537. It does not run on Windows due to REQUIRES: shell
llvm-svn: 235551
Reid Kleckner [Wed, 22 Apr 2015 21:05:21 +0000 (21:05 +0000)]
[WinEH] Demote values and phis live across exception handlers up front
In particular, this handles SSA values that are live *out* of a handler.
The existing code only handles values that are live *in* to a handler.
It also handles phi nodes in the block where normal control should
resume after the end of a catch handler. When EH return points have phi
nodes, we need to split the return edge. It is impossible for phi
elimination to emit copies in the previous block if that block gets
outlined. The indirectbr that we leave in the function is only notional,
and is eliminated from the MachineFunction CFG early on.
Reviewers: majnemer, andrew.w.kaylor
Differential Revision: http://reviews.llvm.org/D9158
llvm-svn: 235545
David Majnemer [Wed, 22 Apr 2015 20:59:28 +0000 (20:59 +0000)]
[InstCombine] Clear out nsw/nuw if we modify computation in the chain
An nsw/nuw operation relies on the values feeding into it to not
overflow if 'poison' is not to be produced. This means that
optimizations which make modifications to the bottom of a chain (like
SimplifyDemandedBits) must strip out nsw/nuw if they cannot ensure that
they will be preserved.
This fixes PR23309.
llvm-svn: 235544
Lang Hames [Wed, 22 Apr 2015 20:58:34 +0000 (20:58 +0000)]
[Kaleidoscope] Fix incorrect use of reinterpret_cast.
Thanks to Dave Blaikie for catching this.
llvm-svn: 235543
Reid Kleckner [Wed, 22 Apr 2015 20:56:42 +0000 (20:56 +0000)]
[Allocator] Remove memory poisoning before deallocation
I added the poisoning back in r76891 (2009) because of some bugs in
Unladen Swallow, and then Evan Cheng added the setRangeWritable() call
in r81308. Profiling a Release+Asserts build on Windows shows that this
memory protection call is actually very expensive. 4 seconds of a 70
second Clang compilation are spent in VirtualQuery. These days we have
more reliable tools like ASan to find these kinds of bugs, so we can go
ahead and retire these checks.
llvm-svn: 235542
Lang Hames [Wed, 22 Apr 2015 20:41:34 +0000 (20:41 +0000)]
[Kaleidoscope] Remove RTTI use from chapters 7 and 8.
llvm-svn: 235541
Alexey Samsonov [Wed, 22 Apr 2015 20:30:19 +0000 (20:30 +0000)]
[ASan] Print global registration site in init-order-checker reports.
llvm-svn: 235540
Alexey Samsonov [Wed, 22 Apr 2015 20:30:15 +0000 (20:30 +0000)]
[ASan] Refactor functions searching/describing globals. NFC.
llvm-svn: 235539
Jim Ingham [Wed, 22 Apr 2015 19:42:18 +0000 (19:42 +0000)]
This is some groundwork for filtering the language Exception
breakpoints, for instance on the class of the thrown object.
This change doesn't actually make that work, the part where we
extract the thrown object type from the throw site isn't done yet.
This provides a general programmatic "precondition" that you can add
to breakpoints to give them the ability to do filtering on the LLDB
side before we pass the stop on to the user-provided conditions &
callbacks.
llvm-svn: 235538
Reid Kleckner [Wed, 22 Apr 2015 19:37:32 +0000 (19:37 +0000)]
Set normal LLVM function attributes on global initializer functions
Otherwise -fno-omit-frame-pointer and other flags like it aren't
applied.
Basic idea taken from Gao's patch, thanks!
Differential Revision: http://reviews.llvm.org/D9203
llvm-svn: 235537
Yaron Keren [Wed, 22 Apr 2015 18:49:59 +0000 (18:49 +0000)]
Another test to exercise APInt divide step D6.
This is divrem_big7 since divrem_big6 is used in Pawel upcoming patch.
llvm-svn: 235536
Krzysztof Parzyszek [Wed, 22 Apr 2015 18:25:53 +0000 (18:25 +0000)]
[Hexagon] Use A2_tfrsi for constant pool and jump table addresses
llvm-svn: 235535
David Blaikie [Wed, 22 Apr 2015 18:16:49 +0000 (18:16 +0000)]
Revert "[opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst"
This reverts commit r235458.
It looks like this might be breaking something LTO-ish. Looking into it
& will recommit with a fix/test case/etc once I've got more to go on.
llvm-svn: 235533
Pete Cooper [Wed, 22 Apr 2015 18:05:13 +0000 (18:05 +0000)]
[AArch64] Use MachineRegisterInfo instead of LiveIntervals to calculate liveness. NFC.
The CondOpt pass currently uses LiveIntervals to set the dead flag on a def. This patch uses MachineRegisterInfo::use_empty instead as that is equivalent to the def being dead.
This removes an instance of LiveIntervals in the pass manager pipeline and saves 3.8% of compile time on llc conpiled for AArch64.
Reviewed by Chad Rosier and Zhaoshi.
llvm-svn: 235532
Sanjay Patel [Wed, 22 Apr 2015 18:04:46 +0000 (18:04 +0000)]
don't repeat function names in comments; NFC
llvm-svn: 235531
Pirama Arumuga Nainar [Wed, 22 Apr 2015 18:04:12 +0000 (18:04 +0000)]
Fix correctness check for test_vec_fpextend_double
Summary:
Remove the CHECK-DAG calls introduced in r235341, and add a comment that
this test may break due to scheduling variations.
This patch completes the fix discussed in http://reviews.llvm.org/D8804
Reviewers: dsanders, srhines
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9178
llvm-svn: 235530
Krzysztof Parzyszek [Wed, 22 Apr 2015 17:51:26 +0000 (17:51 +0000)]
[Hexagon] Consider constant-extended offsets to be valid
llvm-svn: 235529
Pete Cooper [Wed, 22 Apr 2015 17:48:26 +0000 (17:48 +0000)]
Change MachineOperand::OpKind from unsigned char to a bitfield. NFC.
This causes OpKind and all the bitfields after it to use 32-bit load/stores instead of i24's for the existing bitfields.
Bugs will be filed to track whether clang and llvm could have generated the 32-bit operations in the front-end or optimizer.
Reviewed by Rafael.
llvm-svn: 235528
Jim Ingham [Wed, 22 Apr 2015 17:48:24 +0000 (17:48 +0000)]
Formatting fix.
llvm-svn: 235527
Luqman Aden [Wed, 22 Apr 2015 17:42:37 +0000 (17:42 +0000)]
Test commit: fix typo in comment.
llvm-svn: 235526
Krzysztof Parzyszek [Wed, 22 Apr 2015 17:19:44 +0000 (17:19 +0000)]
Fix Windows build break: use LLVM_FUNCTION_NAME instead of __func__.
llvm-svn: 235525
Matt Arsenault [Wed, 22 Apr 2015 17:10:44 +0000 (17:10 +0000)]
R600: Fix always inline pass breaking noinline functions
No test since calls are not actually supported yet.
llvm-svn: 235524
Ed Maste [Wed, 22 Apr 2015 17:06:48 +0000 (17:06 +0000)]
Add decorator for signal test failing on FreeBSD
llvm.org/pr23318
llvm-svn: 235523
Yaron Keren [Wed, 22 Apr 2015 16:43:56 +0000 (16:43 +0000)]
Recommit r235219, it's need for out-of-tree users of AlignOf.h.
llvm-svn: 235522
Krzysztof Parzyszek [Wed, 22 Apr 2015 16:43:53 +0000 (16:43 +0000)]
[Hexagon] Overhaul of stack object allocation
- Use static allocation for aligned stack objects.
- Simplify dynamic stack object allocation.
- Simplify elimination of frame-indices.
llvm-svn: 235521
David Blaikie [Wed, 22 Apr 2015 16:37:35 +0000 (16:37 +0000)]
[opaque pointer type] Use pointee type retrieved from asm, rather than accessing it via the pointer type
llvm-svn: 235520
Reid Kleckner [Wed, 22 Apr 2015 16:23:00 +0000 (16:23 +0000)]
[cmake] Quote the path to the target exports file, fixes PR23313
llvm-svn: 235519
Daniel Sanders [Wed, 22 Apr 2015 16:14:01 +0000 (16:14 +0000)]
[ubsan] Stop cast-overflow.cpp test leaking undefined behaviour into the exit code.
Summary:
ubsan was correctly catching the undefined behaviour but lit's shell was
failing the test anyway because the exit code was non-zero as a result of the
undefined behaviour.
This fixes the test on a mips-linux-gnu target.
Reviewers: samsonov
Reviewed By: samsonov
Subscribers: samsonov, llvm-commits, rsmith, sagar
Differential Revision: http://reviews.llvm.org/D9155
llvm-svn: 235518
Sanjay Patel [Wed, 22 Apr 2015 16:11:19 +0000 (16:11 +0000)]
[x86] Add store-folded memop patterns for vcvtps2ph
Differential Revision: http://reviews.llvm.org/D7296
llvm-svn: 235517
Krzysztof Parzyszek [Wed, 22 Apr 2015 15:47:35 +0000 (15:47 +0000)]
[Hexagon] Treat CFI as solo instructions
llvm-svn: 235516
Ilia K [Wed, 22 Apr 2015 15:43:43 +0000 (15:43 +0000)]
MI Refactor CMIUtilSystemWindows::GetExecutablesPath()
Summary:
My understanding of the Windows API call GetLastError() is that it should only be checked when ::GetModuleFileName() returns 0 on error.
Otherwise GetExecutablesPath() could return an error despite nLen being valid if GetLastError() was inconsistent.
Patch updates function to only call GetOSLastError() when nLen == 0
Patch from ewan@codeplay.com
Reviewers: EwanCrawford
Subscribers: lldb-commits, deepak2427
Differential Revision: http://reviews.llvm.org/D9154
llvm-svn: 235515
Krzysztof Parzyszek [Wed, 22 Apr 2015 15:38:17 +0000 (15:38 +0000)]
[Hexagon] Implement HexagonInstPrinter::printRegName
llvm-svn: 235514
Adhemerval Zanella [Wed, 22 Apr 2015 15:26:43 +0000 (15:26 +0000)]
Support arm32 R_ARM_V4BX relocation format
ARM32 ELF R_ARM_V4BX relocation format is a special relocation type
that records the location of an ARMv4t BX instruction to enable a
static linker to generate ARMv4 compatible instructions. This
relocation does not contain a reference symbol.
This patch enabled its creation by removing the requeriment of a
relocation symbol target in ELFState<ELFT>::writeSectionContent.
llvm-svn: 235513
Aaron Ballman [Wed, 22 Apr 2015 15:25:05 +0000 (15:25 +0000)]
Silencing a -Wunused-variable warning; NFC.
llvm-svn: 235512
Brendon Cahoon [Wed, 22 Apr 2015 15:06:40 +0000 (15:06 +0000)]
Fix a type mismatch assert in SCEV division
An assert was triggered when attempting to create a new SCEV
with operands of different types in the visitAddRecExpr. In this
test case, the operand types of the numerator and denominator
are different. The SCEV division code should generate a
conservative answer when this happens.
Differential Revision: http://reviews.llvm.org/D9021
llvm-svn: 235511
Ed Maste [Wed, 22 Apr 2015 14:55:34 +0000 (14:55 +0000)]
Skip additional lldb-mi tests that failed on FreeBSD
llvm-svn: 235510
Andrea Di Biagio [Wed, 22 Apr 2015 14:53:39 +0000 (14:53 +0000)]
[X86][AVX] Fix failure due to a missing ISel pattern to select VBROADCAST nodes (PR23259).
This fixes a regression introduced at revision 218263.
On AVX, if we optimize for size, a splat build_vector of a load
is lowered into a VBROADCAST node. This is done even if the value type of the
splat build_vector node is v2i64.
Since AVX doesn't support v2f64/v2i64 broadcasts, revision 218263 added two
extra tablegen patterns to allow selecting a VMOVDDUPrm from an X86VBroadcast
where the scalar element comes from a loadi64/loadf64.
However, revision 218263 forgot to add an extra fallback pattern for the case
where we have a X86VBroadcast of a loadi64 with multiple uses.
This patch adds the missing tablegen pattern in X86InstrSSE.td.
This patch also adds an extra test to 'splat-for-size.ll' to verify that ISel
doesn't crash with a 'fatal error in the backend' due to a missing AVX pattern
to select v2i64 X86ISD::BROADCAST nodes.
llvm-svn: 235509
Olivier Sallenave [Wed, 22 Apr 2015 14:07:26 +0000 (14:07 +0000)]
Fixed logic to enable complex FMA formation.
llvm-svn: 235508