Commit Graph

215978 Commits

Author SHA1 Message Date
Xinliang David Li cfb1456572 Minor cleanups (from review feedback)
1. remove uneeded header inclusion
2. use reinterpret_cast instead of c ctyle
3. other format change

llvm-svn: 253515
2015-11-18 22:42:27 +00:00
Davide Italiano 455ea11d13 [BuildLibCalls] EmitStrNLen() is dead code. Garbage collect.
llvm-svn: 253514
2015-11-18 22:29:38 +00:00
Todd Fiala 223f4bb9b2 Remove superseded buildSwigWrapperClasses.py and buildSwigPython.py classes
This closes:
http://reviews.llvm.org/D14783

llvm-svn: 253513
2015-11-18 22:21:47 +00:00
Pete Cooper 7bfd5cb7be Change memcpy/memset/memmove to have dest and source alignments.
This is a follow on from a similar LLVM commit: r253511.

Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

These intrinsics currently have an explicit alignment argument which is
required to be a constant integer.  It represents the alignment of the
source and dest, and so must be the minimum of those.

This change allows source and dest to each have their own alignments
by using the alignment attribute on their arguments.  The alignment
argument itself is removed.

The only code change to clang is hidden in CGBuilder.h which now passes
both dest and source alignment to IRBuilder, instead of taking the minimum of
dest and source alignments.

Reviewed by Hal Finkel.

llvm-svn: 253512
2015-11-18 22:18:45 +00:00
Pete Cooper 72bc23ef02 Change memcpy/memset/memmove to have dest and source alignments.
Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

These intrinsics currently have an explicit alignment argument which is
required to be a constant integer.  It represents the alignment of the
source and dest, and so must be the minimum of those.

This change allows source and dest to each have their own alignments
by using the alignment attribute on their arguments.  The alignment
argument itself is removed.

There are a few places in the code for which the code needs to be
checked by an expert as to whether using only src/dest alignment is
safe.  For those places, they currently take the minimum of src/dest
alignments which matches the current behaviour.

For example, code which used to read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
will now read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false)

For out of tree owners, I was able to strip alignment from calls using sed by replacing:
  (call.*llvm\.memset.*)i32\ [0-9]*\,\ i1 false\)
with:
  $1i1 false)

and similarly for memmove and memcpy.

I then added back in alignment to test cases which needed it.

A similar commit will be made to clang which actually has many differences in alignment as now
IRBuilder can generate different source/dest alignments on calls.

In IRBuilder itself, a new argument was added.  Instead of calling:
  CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, /* isVolatile */ false)
you now call
  CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, SrcAlign, /* isVolatile */ false)

There is a temporary class (IntegerAlignment) which takes the source alignment and rejects
implicit conversion from bool.  This is to prevent isVolatile here from passing its default
parameter to the source alignment.

Note, changes in future can now be made to codegen.  I didn't change anything here, but this
change should enable better memcpy code sequences.

Reviewed by Hal Finkel.

llvm-svn: 253511
2015-11-18 22:17:24 +00:00
Xinliang David Li b035bd03e4 Fix format in comments.
llvm-svn: 253510
2015-11-18 22:09:41 +00:00
Jingyue Wu 03d90e545d [doc] fix a wrong link
llvm-svn: 253509
2015-11-18 22:01:44 +00:00
Xinliang David Li c5c32cbec2 [PGO] Minor cleanups (formating, comments etc) (NFC)
1. Added missing public API decl in InstrProfiling.h
2. Clang formatting fix
3. Added more comments for new VP code
4. refactor the VP allocation code to make it more readable.

llvm-svn: 253508
2015-11-18 21:54:40 +00:00
Mike Aizatsky b2c5e1b263 Removing memory leak to appease windows bots.
Differential Revision: http://reviews.llvm.org/D14785

llvm-svn: 253507
2015-11-18 21:44:33 +00:00
David Majnemer bee2bc3932 [MSVC Compat] Make -Wmicrosoft-cast not an error by default
Too much code is sloppy about this to error by default.

llvm-svn: 253506
2015-11-18 21:42:38 +00:00
Siva Chandra c7ac7d7a9b [TestExitDuringStep] Adjust after a recent type map change.
Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 253505
2015-11-18 21:22:29 +00:00
Simon Pilgrim c1a46b729b [DAGCombiner] Vector constant folding for comparisons
This patch adds support for vector constant folding of integer/float comparisons.

This requires FoldConstantVectorArithmetic to support scalar constant operands (in this case ISD::CONDCASE). In future we should be able to support other scalar constant types as necessary (and possibly start calling FoldConstantVectorArithmetic for all node creations)

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

llvm-svn: 253504
2015-11-18 21:17:19 +00:00
Xinliang David Li 6e55716509 Fix format of previous patch (NFC)
llvm-svn: 253503
2015-11-18 21:11:46 +00:00
Tim Northover 747ae9a7de ARM: make sure backend is consistent about exception handling method.
It turns out we decide whether to use SjLj exceptions or some alternative in
two separate places in the backend, and they disagreed with each other. This
led to inconsistent code and is generally a terrible idea.

So make them consistent and add an assert that they *do* match (unfortunately
MCAsmInfo isn't available in opt, so it can't be used to initialise the CodeGen
version directly).

llvm-svn: 253502
2015-11-18 21:10:39 +00:00
Zachary Turner cc2e76d57f Fix CMake dependency on lldb.py
llvm-svn: 253501
2015-11-18 21:09:55 +00:00
Xinliang David Li 1d8d46ae39 [PGO] Refactor File and Buffer API profile writing code
With this change, Buffer API and File API implementations
are unified.

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

llvm-svn: 253500
2015-11-18 21:08:03 +00:00
Mike Aizatsky 52025af820 Disable gvn non-local speculative loads under asan.
Summary: Fix for https://llvm.org/bugs/show_bug.cgi?id=25550

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

llvm-svn: 253499
2015-11-18 20:43:20 +00:00
Mike Aizatsky c7810baaa6 Disable gvn non-local speculative loads under asan.
Summary: Fix for https://llvm.org/bugs/show_bug.cgi?id=25550

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

llvm-svn: 253498
2015-11-18 20:43:00 +00:00
Nathan Slingerland 617c60013d [llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions (2nd try)
Summary:
This change adds MathExtras helper functions for handling unsigned, saturating addition and multiplication. It also updates the instrumentation and sample profile merge implementations to use them.

Reviewers: dnovillo, bogner, davidxl

Subscribers: davidxl, llvm-commits

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

llvm-svn: 253497
2015-11-18 20:40:41 +00:00
Xinliang David Li 13cd7f3cf7 Fix for loop initial decl used outside c99 mode error
llvm-svn: 253496
2015-11-18 20:20:15 +00:00
David Majnemer 678f50b622 [Sema] Don't work around a malformed AST
We created a malformed TemplateSpecializationType: it was dependent but
had a RecordType as it's canonical type.  This would lead getAs to
crash.  r249090 worked around this but we should fix this for real by
providing a more appropriate template specialization type as the
canonical type.

This fixes PR24246.

llvm-svn: 253495
2015-11-18 19:49:19 +00:00
Sanjoy Das 87f03971fd [OperandBundles] Address review on r253446; NFC
Post-commit review by David Blaikie, thanks David!

llvm-svn: 253494
2015-11-18 19:44:59 +00:00
Enrico Granata 3de08c5f0c Reapply r253423 and r253424 (which cleanup the data formatters iteration model, as well as the type X list commands), along with a change by Zachary Turner to bypass a MSVC bug with SFINAE
llvm-svn: 253493
2015-11-18 19:42:44 +00:00
Betul Buyukkurt e7891d033e [PGO] Fix the build failures due to 253483 and 253489.
llvm-svn: 253492
2015-11-18 19:39:20 +00:00
Todd Fiala a52e2c8376 Remove the scripts/Python/build-swig-Python.sh script.
This logically goes with my previous commit.

llvm-svn: 253491
2015-11-18 19:37:51 +00:00
Todd Fiala f6b2aa5882 remove defunct scripts/build-swig-wrapper-classes.sh; switch autoconf build to prepare_bindings.py.
Xcode moved off of build-swig-wrapper-classes.sh earlier this week.

llvm-svn: 253490
2015-11-18 19:34:03 +00:00
Betul Buyukkurt b8dc674f65 [PGO] Removed an extra ')' in the LLVM_ALIGNAS(x) macro.
llvm-svn: 253489
2015-11-18 19:11:31 +00:00
Ying Chen ca922bb9b9 Support unix-abstract-connect scheme as platform url in lldb testsuite
Reviewers: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 253488
2015-11-18 19:03:20 +00:00
Zachary Turner 48ef8d4c37 Fix some issues with swig & string conversion.
This patch fixes two issues:

1) Popen needs to be used with universal_newlines=True by default.
   This elicits automatic decoding from bytes -> string in Py3,
   and has no negative effects in other Py versions.
2) The swig typemaps for converting between string and (char*, int)
   did not work correctly when the length of the string was 0,
   indicating an error.  In this case we would try to construct a
   string from uninitialized data.
3) Ironically, the bug mentioned in #2 led to a test passing on
   Windows that was actually broken, because the test was written
   such that the assertion was never even getting checked, so it
   passed by default.  So we additionally fix this test to also
   fail if the method errors.  By fixing this test it's now broken
   on Windows, so we also xfail it.

llvm-svn: 253487
2015-11-18 18:40:16 +00:00
Aaron Ballman f08e184815 Removing the AST matcher test for thread_local storage duration. Not all platforms support TLS, and on platforms that do not support it, use of thread_local causes an error. Since there's no way to determine whether the testing platform supports TLS, there's no way to know whether the test is safe to run or not. I will explore ways to enable this test, but this will appease at least one more build bot.
llvm-svn: 253486
2015-11-18 18:37:29 +00:00
Betul Buyukkurt 6247bed9bd [PGO] Test update for revision 253484.
llvm-svn: 253485
2015-11-18 18:15:55 +00:00
Betul Buyukkurt 6fac1741c9 [PGO] Value profiling support
This change introduces an instrumentation intrinsic instruction for
value profiling purposes, the lowering of the instrumentation intrinsic
and raw reader updates. The raw profile data files for llvm-profdata
testing are updated.

llvm-svn: 253484
2015-11-18 18:14:55 +00:00
Betul Buyukkurt 808385f1ae [PGO] Runtime support for value profiling.
This change adds extends the data structures and adds in the routines
for handling runtime calls for value profiling. The profile data format
is modified and the version number is incremented.

llvm-svn: 253483
2015-11-18 18:12:35 +00:00
Matthew Simpson 343af07aa9 [Aarch64] Add cost for missing extensions.
This patch adds a cost estimate for some missing sign and zero extensions. The
costs were determined by counting the number of shift instructions generated
without context for each new extension.

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

llvm-svn: 253482
2015-11-18 18:03:06 +00:00
Aaron Ballman 8e7f00b0eb Re-committing r253473 after hopefully fixing the bot breakage. There was a copy-pasta issue that my local testing did not catch.
llvm-svn: 253481
2015-11-18 17:56:55 +00:00
Artyom Skrobov 763c4ab32d Removing specific target from the generic test
llvm-svn: 253479
2015-11-18 17:50:47 +00:00
Todd Fiala 7d1da7e91c Switched cmake build from using buildSwigWrapperClases.py to the cleaned up version.
This change does not introduce static bindings.  It is simply using
the pylinted cleaned up code in prepare_bindings.py.

If this breaks anyting, I'll revert immediately and figure out what
needs to be addressed.  I'm looking to wrap up
the cleanup aspect of the code change (pylinted, removal of code that
implements existing python stdlib code, fixes for Xcode adoption, etc.).

llvm-svn: 253478
2015-11-18 17:36:15 +00:00
Ed Maste c98805b493 Accept -whole-archive and -no-whole-archive (with a single dash)
Clang uses the single-dash version in addSanitizerRuntime().

llvm-svn: 253477
2015-11-18 17:22:02 +00:00
Douglas Katzman d617e44065 [Myriad]: fix test for Windows
llvm-svn: 253476
2015-11-18 17:19:47 +00:00
Aaron Ballman 81d17f2f7e Reverting r253473 while I investigate build bot failures.
llvm-svn: 253475
2015-11-18 17:16:01 +00:00
Nathan Slingerland c21a44da1e [llvm-profdata] Use SmallSet rather that std::set for keeping track of profdata merge errors
Missed bit of feedback from D14720.

Use SmallSet<std::error_code> rather than std::set<...> in order to be more efficient.

llvm-svn: 253474
2015-11-18 17:10:24 +00:00
Aaron Ballman 34e0bd40e4 Adding AST matchers for VarDecl storage durations. Can now determine whether a VarDecl has automatic, static, or thread storage duration. This also updates the documentation for matchers, which appear to be missing some previous additions.
llvm-svn: 253473
2015-11-18 17:05:39 +00:00
Dan Gohman 94ef41ff1d [WebAssembly] Add more whitespace characters to prettify the assembly output.
llvm-svn: 253472
2015-11-18 17:05:35 +00:00
Bradley Smith bbf5a00de1 [ARM] Support +feature targeting in -mcpu/-march
llvm-svn: 253471
2015-11-18 16:33:48 +00:00
Bradley Smith 7b0a7d8d1e [ARM] Add +feature names to TargetParser extensions table
llvm-svn: 253470
2015-11-18 16:32:12 +00:00
Dan Gohman 3d4a20662a [WebAssembly] Make bogus inline asm strings in tests be comments.
These tests aren't testing that the result is valid syntax; they're testing
that the compiler emits the inline asm operands correctly.

llvm-svn: 253469
2015-11-18 16:28:58 +00:00
Dan Gohman 1f29c68042 [WebAssembly] Add some spaces to the assembly output to vertically align operands.
llvm-svn: 253468
2015-11-18 16:25:38 +00:00
Douglas Katzman 674a31243b [Myriad]: insert -L paths into linker cmd only when they exist.
Differential Revision: http://reviews.llvm.org/D14754

llvm-svn: 253467
2015-11-18 16:24:46 +00:00
Benjamin Kramer c02670ed50 [libclang] Add entry points that take a full command line including argv[0].
This provides both a more uniform interface and makes libclang behave like
clang tooling wrt relative paths against argv[0]. This is necessary for
finding paths to a c++ standard library relative to a clang binary given
in a compilation database. It can also be used to find paths relative to
libclang.so if the full path to it is passed in.

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

llvm-svn: 253466
2015-11-18 16:14:27 +00:00
Dan Gohman 4ba4816b97 [WebAssembly] Enable register coloring and register stackifying.
This also takes the push/pop syntax another step forward, introducing stack
slot numbers to make it easier to see how expressions are connected. For
example, the value pushed in $push7 is popped in $pop7.

And, this begins an experiment with making get_local and set_local implicit
when an operation directly uses or defines a register. This greatly reduces
clutter. If this experiment succeeds, it may make sense to do this for
const instructions as well.

And, this introduces more special code for ARGUMENTS; hopefully this code
will soon be obviated by proper support for live-in virtual registers.

llvm-svn: 253465
2015-11-18 16:12:01 +00:00