Commit Graph

214688 Commits

Author SHA1 Message Date
Kostya Serebryany e692621a9d [libFuzzer] when choosing the next unit to mutate, give some preference to the most recent units (they are more likely to be interesting)
llvm-svn: 252097
2015-11-04 23:22:25 +00:00
Sanjay Patel 58a7e659d9 fix typo; NFC
llvm-svn: 252096
2015-11-04 23:21:13 +00:00
Sanjoy Das ea34382dfa [CaptureTracking] Support operand bundles conservatively
Summary:
Earlier CaptureTracking would assume all "interesting" operands to a
call or invoke were its arguments.  With operand bundles this is no
longer true.

Note: an earlier change got `doesNotCapture` working correctly with
operand bundles.

This change uses DSE to test the changes to CaptureTracking.  DSE is a
vehicle for testing only, and is not directly involved in this change.

Reviewers: reames, majnemer

Subscribers: llvm-commits

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

llvm-svn: 252095
2015-11-04 23:21:06 +00:00
Davide Italiano 7769b4a1d0 [FreeBSD] Add missing overrides.
llvm-svn: 252094
2015-11-04 23:12:17 +00:00
Chris Bieneman 5e96fe905b [CMake] Bug 25059 - CMake libllvm.so.$MAJOR.$MINOR shared object name not compatible with ldconfig
Summary:
This change makes the CMake build system generate libraries for Linux and Darwin matching the makefile build system.

Linux libraries follow the pattern lib${name}.${MAJOR}.${MINOR}.so so that ldconfig won't pick it up incorrectly.

Darwin libraries are not versioned.

Note: On linux the non-versioned symlink is generated at install-time not build time. I plan to fix that eventually, but I expect that is good enough for the purposes of fixing this bug.

Reviewers: loladiro, tstellarAMD

Subscribers: axw, llvm-commits

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

llvm-svn: 252093
2015-11-04 23:11:12 +00:00
Zachary Turner 88a12f5526 Handle keyword args on our patched Popen methods.
Python 3 introduces the `timeout` keyword argument on Popen.wait().
If our patched version doesn't support keyword arguments, then when
the internal Python implementation attempts to call wait() with the
keyword argument, things will explode.

Such as my head, after I finally figured out what was happening.

llvm-svn: 252092
2015-11-04 23:03:21 +00:00
Zachary Turner 9858899148 Don't access class members inside of `__del__`.
Apparently this doesn't work as the attribute doesn't exist anymore.

llvm-svn: 252091
2015-11-04 23:03:10 +00:00
Rafael Espindola 49b8548903 Slightly saner handling of thumb branches.
The generic infrastructure already did a lot of work to decide if the
fixup value is know or not. It doesn't make sense to reimplement a very
basic case: same fragment.

llvm-svn: 252090
2015-11-04 23:00:39 +00:00
Daniel Jasper 49dbbdb3b3 clang-format: Turn on wrapping before "else" for WebKit style.
llvm-svn: 252089
2015-11-04 22:49:32 +00:00
Quentin Colombet 421723cdd8 [x86] Teach the shrink-wrapping hooks to do the proper thing with Win64.
Win64 has some strict requirements for the epilogue. As a result, we disable
shrink-wrapping for Win64 unless the block that gets the epilogue is already an
exit block.

Fixes PR24193.

llvm-svn: 252088
2015-11-04 22:37:28 +00:00
Eugene Zelenko ffec81ca00 Fix some Clang-tidy modernize warnings, other minor fixes.
Fixed warnings are: modernize-use-override, modernize-use-nullptr and modernize-redundant-void-arg.

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

llvm-svn: 252087
2015-11-04 22:32:32 +00:00
Jonathan Peyton dd23974a5d Remove incorrect debug assert.
in __kmp_free_team(), the team's number of processors can be == 1.

llvm-svn: 252086
2015-11-04 22:31:57 +00:00
Justin Bogner c2b98f03db PM: Rephrase PrintLoopPass as a wrapper around a new-style pass. NFC
Splits PrintLoopPass into a new-style pass and a PrintLoopPassWrapper,
much like we already do for PrintFunctionPass and PrintModulePass.

llvm-svn: 252085
2015-11-04 22:24:08 +00:00
Jonathan Peyton 4505bf68b0 Remove some empty lines.
llvm-svn: 252084
2015-11-04 22:06:07 +00:00
Cong Hou 23a3bf0147 Add new interfaces to MBB for manipulating successors with probabilities instead of weights. NFC.
This is part-1 of the patch that replaces all edge weights in MBB by
probabilities, which only adds new interfaces. No functional changes.

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

llvm-svn: 252083
2015-11-04 21:37:58 +00:00
Jonathan Peyton 54127981be Refactor of task_team code.
This is a refactoring of the task_team code that more elegantly handles the two
task_team case. Two task_teams per team are kept in use for the lifetime of the
team. Thus no reference counting is needed.

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

llvm-svn: 252082
2015-11-04 21:37:48 +00:00
Eugene Zelenko d4304d2f9c Fix some Clang-tidy modernize warnings, other minor fixes.
Differential revision: http://reviews.llvm.org/D14311

llvm-svn: 252081
2015-11-04 21:37:17 +00:00
Devin Coughlin 0500c70beb [analyzer] Add 'optin' checker package and move localizability checkers into it.
This commit creates a new 'optin' top-level checker package and moves several of
the localizability checkers into it.

This package is for checkers that are not alpha and that would normally be on by
default but where the driver does not have enough information to determine when
they are applicable. The localizability checkers fit this criterion because the
driver cannot determine whether a project is localized or not -- this is best
determined at the IDE or build-system level.

This new package is *not* intended for checkers that are too noisy to be on by
default.

The hierarchy under 'optin' mirrors that in 'alpha': checkers under 'optin'
should be organized in the hierarchy they would have had if they were truly top
level (e.g., optin.osx.cocoa.MyOptInChecker).

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

llvm-svn: 252080
2015-11-04 21:33:41 +00:00
Davide Italiano 7d3e66a58f [Core] Avoid default in switch() that covers all the cases.
Unbreak the build for FreeBSD + -Werror.

llvm-svn: 252079
2015-11-04 21:31:16 +00:00
Simon Pilgrim f669d381f9 Warning fix.
llvm-svn: 252078
2015-11-04 21:27:22 +00:00
Sanjoy Das a4bae3bb21 [IR] Add a `data_operand` abstraction
Summary:
Data operands of a call or invoke consist of the call arguments, and
the bundle operands associated with the `call` (or `invoke`)
instruction.  The motivation for this change is that we'd like to be
able to query "argument attributes" like `readonly` and `nocapture`
for bundle operands naturally.

This change also provides a conservative "implementation" for these
attributes for any bundle operand, and an extension point for future
work.

Reviewers: chandlerc, majnemer, reames

Subscribers: llvm-commits

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

llvm-svn: 252077
2015-11-04 21:05:24 +00:00
Juergen Ributzka d7dcffaea4 Revert "Reapply: [asan] On OS X, log reports to syslog and os_trace"
Looks like this commit is deadlocking the ASAN tests on the green dragon bot
(http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA/).

llvm-svn: 252076
2015-11-04 21:03:12 +00:00
Tom Stellard 18bf626cf7 llvm-config: Add --has-rtti option
Summary:
This prints NO if LLVM was built with -fno-rtti or an equivalent flag
and YES otherwise.  The reasons to add -has-rtti rather than adding -fno-rtti
to --cxxflags are:

1. Building LLVM with -fno-rtti does not always mean that client
applications need this flag.

2. Some compilers have a different flag for disabling rtti, and the
compiler being used to build LLVM may not be the compiler being used to
build the application.

Reviewers: echristo, chandlerc, beanz

Subscribers: llvm-commits

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

llvm-svn: 252075
2015-11-04 20:57:43 +00:00
Simon Pilgrim 7e6606f4f1 [X86][SSE] Add general memory folding for (V)INSERTPS instruction
This patch improves the memory folding of the inserted float element for the (V)INSERTPS instruction.

The existing implementation occurs in the DAGCombiner and relies on the narrowing of a whole vector load into a scalar load (and then converted into a vector) to (hopefully) allow folding to occur later on. Not only has this proven problematic for debug builds, it also prevents other memory folds (notably stack reloads) from happening.

This patch removes the old implementation and moves the folding code to the X86 foldMemoryOperand handler. A new private 'special case' function - foldMemoryOperandCustom - has been added to deal with memory folding of instructions that can't just use the lookup tables - (V)INSERTPS is the first of several that could be done.

It also tweaks the memory operand folding code with an additional pointer offset that allows existing memory addresses to be modified, in this case to convert the vector address to the explicit address of the scalar element that will be inserted.

Unlike the previous implementation we now set the insertion source index to zero, although this is ignored for the (V)INSERTPSrm version, anything that relied on shuffle decodes (such as unfolding of insertps loads) was incorrectly calculating the source address - I've added a test for this at insertps-unfold-load-bug.ll

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

llvm-svn: 252074
2015-11-04 20:48:09 +00:00
Sanjoy Das b11b440f8e [IR] Add bounds checking to paramHasAttr
Summary:
This is intended to make a later change simpler.

Note: adding this bounds checking required fixing `X86FastISel`.  As
far I can tell I've preserved original behavior but a careful review
will be appreciated.

Reviewers: reames

Subscribers: llvm-commits

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

llvm-svn: 252073
2015-11-04 20:33:45 +00:00
Jim Ingham 2c38141423 Add "zero_memory" option to IRMemoryMap::FindSpace & IRMemoryMap::Malloc. Zero out
the Expression ResultVariable so it's in a known initial state.

llvm-svn: 252072
2015-11-04 20:32:27 +00:00
Mike Aizatsky 1e41784f20 Asan: utility function to determine first wrongly poisoned byte in
container.

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

llvm-svn: 252071
2015-11-04 19:56:03 +00:00
David Blaikie a895aa635c Orc: Streamline some lambda usage in a unit test
llvm-svn: 252070
2015-11-04 19:43:24 +00:00
Alexander Kornienko 149af59113 Fixed a link.
llvm-svn: 252069
2015-11-04 19:42:17 +00:00
Alexander Kornienko 4f6725c426 Fixed header levels.
llvm-svn: 252068
2015-11-04 19:40:05 +00:00
Tamas Berghammer 2a2d39d760 Revert r252001 as it brake TestCppIncompleteTypes on all platforms
llvm-svn: 252067
2015-11-04 19:39:32 +00:00
Alexander Kornienko dec64d8e16 Removed mentions of clang-modernize, added a short description of clang-tidy.
llvm-svn: 252066
2015-11-04 19:34:55 +00:00
Tamas Berghammer aaaa157673 Fix TestMemoryRead after r252035
llvm-svn: 252065
2015-11-04 19:32:01 +00:00
Richard Smith 2dbe4043e8 [modules] Generalize the workaround for multiple ambiguous definitions of
internal linkage entities in different modules from r250884 to apply to all
names, not just function names.

This is really awkward: we don't want to merge internal-linkage symbols from
separate modules, because they might not actually be defining the same entity.
But we don't want to reject programs that use such an ambiguous symbol if those
internal-linkage symbols are in fact equivalent. For now, we're resolving the
ambiguity by picking one of the equivalent definitions as an extension.

llvm-svn: 252063
2015-11-04 19:26:32 +00:00
Rafael Espindola 337675b891 Relax the check for ninja.
On fedora the ninja executable is called ninja-build :-(

llvm-svn: 252062
2015-11-04 19:18:11 +00:00
Nathan Wilson f22124f531 [Concepts] Add diagnostics which fall under [dcl.spec.concept]p1
Summary: Diagnose when the 'concept' specifier is used on a typedef or function parameter.

Reviewers: rsmith, hubert.reinterpretcast, aaron.ballman, faisalv

Subscribers: cfe-commits

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

llvm-svn: 252061
2015-11-04 18:18:35 +00:00
Andrew Kaylor e41a8c4182 Created new X86 FMA3 opcodes (FMA*_Int) that are used now for lowering of scalar FMA intrinsics.
Patch by Slava Klochkov 

The key difference between FMA* and FMA*_Int opcodes is that FMA*_Int opcodes are handled more conservatively. It is illegal to commute the 1st operand of FMA*_Int instructions as the upper bits of scalar FMA intrinsic result must be taken from the 1st operand, but such commute transformation would change those upper bits and invalidate the intrinsic's result.

Reviewers: Quentin Colombet, Elena Demikhovsky

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

llvm-svn: 252060
2015-11-04 18:10:41 +00:00
Todd Fiala e028e4e3bb OS X: fix the Xcode debugserver lookup code when LLDB.framework does not contain a debugserver
LLDB recently started supporting LLDB.framework without a
debugserver in it.  When that happens, the Xcode-included debugserver
is searched for and used.  This change fixes the code that looks for
Xcode when the housing process is not Xcode.  In particular, this
addresses the problem where python is running the test suite and
the LLDB.framework does not contain a debugserver.

llvm-svn: 252059
2015-11-04 18:10:31 +00:00
Todd Fiala d8078ffcfc Fix test infrastructure when using xunit output.
Our test reporting infrastructure needed module names to change based on the python package layout.

llvm-svn: 252058
2015-11-04 17:10:40 +00:00
James Molloy e7d679cf4c [ARM] Combine CMOV into BFI where possible
If we have a CMOV, OR and AND combination such as:
  if (x & CN)
    y |= CM;

And:
  * CN is a single bit;
  * All bits covered by CM are known zero in y;

Then we can convert this to a sequence of BFI instructions. This will always be a win if CM is a single bit, will always be no worse than the TST & OR sequence if CM is two bits, and for thumb will be no worse if CM is three bits (due to the extra IT instruction).

llvm-svn: 252057
2015-11-04 16:55:07 +00:00
Hans Wennborg d6e069f990 clang-cl: Parse the /guard:cf[-] flag (PR25400)
llvm-svn: 252056
2015-11-04 16:11:56 +00:00
Aaron Ballman 853273f8a9 Improving the diagnostic for cases where the attribute only appertains to a function with a prototype.
llvm-svn: 252055
2015-11-04 16:09:04 +00:00
Teresa Johnson f1b0a6e37c [ThinLTO] Always set linkage type to external when converting alias
When converting an alias to a non-alias when the aliasee is not
imported, ensure that the linkage type is set to external so that it is
a valid linkage type. Added a test case that exposed this issue.

llvm-svn: 252054
2015-11-04 16:01:16 +00:00
Kuba Brecka ef731a9edc Whitespace fixup for r252052. NFC.
llvm-svn: 252053
2015-11-04 15:57:38 +00:00
Kuba Brecka 465cb8a6fa [tsan] Use malloc zone interceptors on OS X, part 1 (refactoring)
TSan needs to use a custom malloc zone on OS X, which is already implemented in ASan.  This patch is a refactoring patch (NFC) that extracts this from ASan into sanitizer_common, where we can reuse it in TSan.

Reviewed at http://reviews.llvm.org/D14330

llvm-svn: 252052
2015-11-04 15:43:45 +00:00
James Molloy 4de84ddec9 [SimplifyCFG] Merge conditional stores
We can often end up with conditional stores that cannot be speculated. They can come from fairly simple, idiomatic code:

  if (c & flag1)
    *a = x;
  if (c & flag2)
    *a = y;
  ...

There is no dominating or post-dominating store to a, so it is not legal to move the store unconditionally to the end of the sequence and cache the intermediate result in a register, as we would like to.

It is, however, legal to merge the stores together and do the store once:

  tmp = undef;
  if (c & flag1)
    tmp = x;
  if (c & flag2)
    tmp = y;
  if (c & flag1 || c & flag2)
    *a = tmp;

The real power in this optimization is that it allows arbitrary length ladders such as these to be completely and trivially if-converted. The typical code I'd expect this to trigger on often uses binary-AND with constants as the condition (as in the above example), which means the ending condition can simply be truncated into a single binary-AND too: 'if (c & (flag1|flag2))'. As in the general case there are bitwise operators here, the ladder can often be optimized further too.

This optimization involves potentially increasing register pressure. Even in the simplest case, the lifetime of the first predicate is extended. This can be elided in some cases such as using binary-AND on constants, but not in the general case. Threading 'tmp' through all branches can also increase register pressure.

The optimization as in this patch is enabled by default but kept in a very conservative mode. It will only optimize if it thinks the resultant code should be if-convertable, and additionally if it can thread 'tmp' through at least one existing PHI, so it will only ever in the worst case create one more PHI and extend the lifetime of a predicate.

This doesn't trigger much in LNT, unfortunately, but it does trigger in a big way in a third party test suite.

llvm-svn: 252051
2015-11-04 15:28:04 +00:00
Stephen Canon 74f9c1a7aa Allow compound assignment expressions to be contracted when licensed by the language or pragma.
llvm-svn: 252050
2015-11-04 15:25:38 +00:00
Kuba Brecka a1186b828f [tsan] Handle libdispatch worker threads on OS X
On OS X, GCD worker threads are created without a call to pthread_create. We need to properly register these threads with ThreadCreate and ThreadStart. This patch uses a libpthread API (`pthread_introspection_hook_install`) to get notifications about new threads and about threads that are about to be destroyed.

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

llvm-svn: 252049
2015-11-04 15:09:14 +00:00
Filipe Cabecinhas a2b0ac40cf Error out when faced with value names containing '\0'
Bug found with afl-fuzz.

llvm-svn: 252048
2015-11-04 14:53:36 +00:00
Aaron Ballman 4305910803 Silence "enumeral and non-enumeral type in conditional expression" warning; NFC.
llvm-svn: 252047
2015-11-04 14:43:43 +00:00