Geoff Berry [Mon, 14 Nov 2016 19:39:00 +0000 (19:39 +0000)]
[AArch64] Factor out transform code from split16BStore. NFC.
llvm-svn: 286874
Eric Liu [Mon, 14 Nov 2016 19:37:55 +0000 (19:37 +0000)]
[change-namespace] consider typedef/using alias decls in the moved namespace.
Summary: If a TypeLoc refers to a type alias defined in the moved namespace, we do not need to update its specifier since the type alias decl will be moved along with the type reference.
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26592
llvm-svn: 286873
Marshall Clow [Mon, 14 Nov 2016 19:35:34 +0000 (19:35 +0000)]
Make one of the new tests fail correctly on pre-C++17 systems
llvm-svn: 286872
Teresa Johnson [Mon, 14 Nov 2016 19:21:41 +0000 (19:21 +0000)]
[ThinLTO] Only promote exported locals as marked in index
Summary:
We have always speculatively promoted all renamable local values
(except const non-address taken variables) for both the exporting
and importing module. We would then internalize them back based on
the ThinLink results if they weren't actually exported. This is
inefficient, and results in unnecessary renames. It also meant we
had to check the non-renamability of a value in the summary, which
was already checked during function importing analysis in the ThinLink.
Made renameModuleForThinLTO (which does the promotion/renaming) instead
use the index when exporting, to avoid unnecessary renames/promotions.
For importing modules, we can simply promoted all values as any local
we import by definition is exported and needs promotion.
This required changes to the method used by the FunctionImport pass
(only invoked from 'opt' for testing) and when invoked from llvm-link,
since neither does a ThinLink. We simply conservatively mark all locals
in the index as promoted, which preserves the current aggressive
promotion behavior.
I also needed to change an llvm-lto based test where we had previously
been aggressively promoting values that weren't importable (aliasees),
but now will not promote.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26467
llvm-svn: 286871
Kostya Serebryany [Mon, 14 Nov 2016 19:21:38 +0000 (19:21 +0000)]
[libFuzzer] replace 'auto' with 'auto *' to better follow the LLVM style
llvm-svn: 286870
Daniel Sanders [Mon, 14 Nov 2016 19:10:56 +0000 (19:10 +0000)]
Revert: r286868 - Test commit
llvm-svn: 286869
Daniel Sanders [Mon, 14 Nov 2016 19:09:33 +0000 (19:09 +0000)]
Test commit
llvm-svn: 286868
Tim Northover [Mon, 14 Nov 2016 19:05:28 +0000 (19:05 +0000)]
Revert "ARM: sort register lists by encoding in push/pop instructions."
This reverts commit 286866. It broke a bot, something to do with exactly which
templates std::sort accepts.
llvm-svn: 286867
Tim Northover [Mon, 14 Nov 2016 19:02:17 +0000 (19:02 +0000)]
ARM: sort register lists by encoding in push/pop instructions.
For example we were producing
push {r8, r10, r11, r4, r5, r7, lr}
This is misleading (r4, r5 and r7 are actually pushed before the rest), and
other components (stack folding recently) often forget to deal with the extra
complexity coming from the different order, leading to miscompiles. Finally, we
warn about our own code in -no-integrated-as mode without this, which is really
not a good idea.
llvm-svn: 286866
Michael Kuperstein [Mon, 14 Nov 2016 19:01:59 +0000 (19:01 +0000)]
Give SLP vectorizer credit where it's due.
llvm-svn: 286865
Marshall Clow [Mon, 14 Nov 2016 18:56:24 +0000 (18:56 +0000)]
Implement P0510 'Make future_error Constructible' adopted in Issaquah
llvm-svn: 286864
Sean Fertile [Mon, 14 Nov 2016 18:47:15 +0000 (18:47 +0000)]
[PPC] altivec.h functions for converting half precision to single precision.
Adds 2 vector functions for converting from a vector of unsigned short to a
vector of float. One converts the low 4 halfwords and one converts the high
4 halfwords.
Differential Revision: https://reviews.llvm.org/D26534
llvm-svn: 286863
Sean Fertile [Mon, 14 Nov 2016 18:43:59 +0000 (18:43 +0000)]
[PPC] Add intrinsic mapping to the xscvhpsp instruction
add an intrinsic to expose the 'VSX Scalar Convert Half-Precision to
Single-Precision' instruction.
Differential review: https://reviews.llvm.org/D26536
llvm-svn: 286862
Adam Nemet [Mon, 14 Nov 2016 18:38:48 +0000 (18:38 +0000)]
[opt-viewer] Don't fail with remarks without debug location
llvm-svn: 286861
Changpeng Fang [Mon, 14 Nov 2016 18:33:18 +0000 (18:33 +0000)]
AMDGPU/SI: Support data types other than V4f32 in image intrinsics
Summary:
Extend image intrinsics to support data types of V1F32 and V2F32.
TODO: we should define a mapping table to change the opcode for data type of V2F32 but just one channel is active,
even though such case should be very rare.
Reviewers:
tstellarAMD
Differential Revision:
http://reviews.llvm.org/D26472
llvm-svn: 286860
Kuba Brecka [Mon, 14 Nov 2016 18:27:47 +0000 (18:27 +0000)]
[sanitizer] Max out allowed macOS deployment targets to 10.9
It's not a good idea to build the sanitizers with e.g. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12, because some deprecated functions that we intercept will cause build errors. Let's limit the allowed deployment targets to 10.9 (which is the default anyway), and warn when it's set above.
Differential Revision: https://reviews.llvm.org/D26557
llvm-svn: 286859
Marshall Clow [Mon, 14 Nov 2016 18:22:19 +0000 (18:22 +0000)]
Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted last week in Issaquah
llvm-svn: 286858
Davide Italiano [Mon, 14 Nov 2016 18:20:20 +0000 (18:20 +0000)]
[ELF] Clarify why `lld -flavor gnu` is used.
Pointed out by Rafael!
llvm-svn: 286857
Anastasia Stulova [Mon, 14 Nov 2016 18:11:09 +0000 (18:11 +0000)]
Fix OpenCL test for buildbot by removing extra (erroneous) RUN line
llvm-svn: 286856
Zvi Rackover [Mon, 14 Nov 2016 18:10:44 +0000 (18:10 +0000)]
[X86] Adding reproducer for pr30981
llvm-svn: 286855
Reid Kleckner [Mon, 14 Nov 2016 18:02:42 +0000 (18:02 +0000)]
Remove pwd to fix WinASan bot
It only slipped in while I was debugging the test case.
llvm-svn: 286854
Zachary Turner [Mon, 14 Nov 2016 17:59:28 +0000 (17:59 +0000)]
[PDB] Add documentation for the DBI Stream.
Differential Revision: https://reviews.llvm.org/D26552
llvm-svn: 286853
Zachary Turner [Mon, 14 Nov 2016 17:59:21 +0000 (17:59 +0000)]
[PDB] Add documentation for the PDB Stream.
https://reviews.llvm.org/D26516
llvm-svn: 286852
Bob Wilson [Mon, 14 Nov 2016 17:56:18 +0000 (17:56 +0000)]
Use _Unwind_Backtrace on Apple platforms.
Darwin's backtrace() function does not work with sigaltstack (which was
enabled when available with r270395) — it does a sanity check to make
sure that the current frame pointer is within the expected stack area
(which it is not when using an alternate stack) and gives up otherwise.
The alternative of _Unwind_Backtrace seems to work fine on macOS, so use
that when backtrace() fails. Note that we then use backtrace_symbols_fd()
with the addresses from _Unwind_Backtrace, but I’ve tested that and it
also seems to work fine. rdar://problem/
28646552
llvm-svn: 286851
Reid Kleckner [Mon, 14 Nov 2016 17:51:11 +0000 (17:51 +0000)]
Split strncmp and strncasecmp test and XFAIL one for Windows
llvm-svn: 286850
Anastasia Stulova [Mon, 14 Nov 2016 17:39:58 +0000 (17:39 +0000)]
[OpenCL] Fix for integer parameters of enqueue_kernel
Make handling integer parameters more flexible:
- For the number of events argument allow to pass larger
integers than 32 bits as soon as compiler can prove that
the range fits in 32 bits. If not, the diagnostic will be given.
- Change type of the arguments specifying the sizes of
the corresponding block arguments to be size_t.
Review: https://reviews.llvm.org/D26509
llvm-svn: 286849
Reid Kleckner [Mon, 14 Nov 2016 17:37:50 +0000 (17:37 +0000)]
[asan/win] Delay load dbghelp.dll to delay ucrtbase.dll initialization
Summary:
ASan needs to initialize before ucrtbase.dll so that it can intercept
all of its heap allocations. New versions of dbghelp.dll depend on
ucrtbase.dll, which means both of those DLLs will initialize before the
dynamic ASan runtime. By lazily loading dbghelp.dll with LoadLibrary, we
avoid the issue.
Eventually, I would like to remove our dbghelp.dll dependency in favor
of always using llvm-symbolizer.exe, but this seems like an acceptable
interim solution.
Fixes PR30903
Reviewers: etienneb
Subscribers: kubabrecka, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D26473
llvm-svn: 286848
Stephan T. Lavavej [Mon, 14 Nov 2016 17:35:14 +0000 (17:35 +0000)]
[libcxx] [test] D26314: Fix MSVC warning C4189 "local variable is initialized but not referenced".
test/std/depr/depr.c.headers/inttypes_h.pass.cpp
test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
test/std/input.output/iostream.forward/iosfwd.pass.cpp
Add test() to avoid a bunch of void-casts, although we still need a few.
test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
skippingws was unused (it's unclear to me whether this was mistakenly copy-pasted from round_trip() below).
test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
test/std/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
test/std/localization/locales/locale.global.templates/use_facet.pass.cpp
When retrieving facets, the references are unused.
test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp
test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp
"std::ios_base::iostate err = ios.goodbit;" was completely unused here.
test/std/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
test/std/numerics/c.math/ctgmath.pass.cpp
test/std/numerics/rand/rand.device/entropy.pass.cpp
test/std/numerics/rand/rand.device/eval.pass.cpp
test/std/strings/basic.string/string.modifiers/string_copy/copy.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eof.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eof.pass.cpp
test/std/thread/futures/futures.promise/dtor.pass.cpp
test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
test/std/thread/thread.condition/thread.condition.condvar/wait_for_pred.pass.cpp
These variables are verifying types but are otherwise unused.
test/std/strings/basic.string/string.capacity/reserve.pass.cpp
old_cap was unused (it's unclear to me whether it was intended to be used).
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char16_t/lt.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/lt.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
These tests contained unused characters.
llvm-svn: 286847
Mandeep Singh Grang [Mon, 14 Nov 2016 17:31:24 +0000 (17:31 +0000)]
[clang docs] Minor fix in ClangCheck.rst
Reviewers: djasper, rengolin
Subscribers: Eugene.Zelenko
Tags: #clang-c
Differential Revision: https://reviews.llvm.org/D26484
llvm-svn: 286846
Adrian Prantl [Mon, 14 Nov 2016 17:26:32 +0000 (17:26 +0000)]
Typo
llvm-svn: 286845
Teresa Johnson [Mon, 14 Nov 2016 17:12:32 +0000 (17:12 +0000)]
Restore "[ThinLTO] Prevent exporting of locals used/defined in module level asm"
This restores the rest of r286297 (part was restored in r286475).
Specifically, it restores the part requiring adding a dependency from
the Analysis to Object library (downstream use changed to correctly
model split BitReader vs BitWriter libraries).
Original description of this part of patch follows:
Module level asm may also contain defs of values. We need to prevent
export of any refs to local values defined in module level asm (e.g. a
ref in normal IR), since that also requires renaming/promotion of the
local. To do that, the summary index builder looks at all values in the
module level asm string that are not marked Weak or Global, which is
exactly the set of locals that are defined. A summary is created for
each of these local defs and flagged as NoRename.
This required adding handling to the BitcodeWriter to look at GV
declarations to see if they have a summary (rather than skipping them
all).
Finally, added an assert to IRObjectFile::CollectAsmUndefinedRefs to
ensure that an MCAsmParser is available, otherwise the module asm parse
would silently fail. Initialized the asm parser in the opt tool for use
in testing this fix.
Fixes PR30610.
llvm-svn: 286844
Sumanth Gundapaneni [Mon, 14 Nov 2016 17:11:00 +0000 (17:11 +0000)]
[Hexagon] Remove unsafe load instructions that affect Stack Slot Coloring
The Stack slot coloring pass removes a store that is followed by a load
that deal with the same stack slot. The function isLoadFromStackSlot
is supposed to consider the loads that have no side-effects. This
patch fixed the issue by removing the unsafe loads from this function
Eg:
%vreg0<def> = L2_loadruh_io <fi#15>, 0
S2_storeri_io <fi#15>, 0, %vreg0
In this case, we load an unsigned extended half word and store this in to
the same stack slot. The Stack slot coloring pass considers safe to remove
the store. This patch marked all the non-vector byte and half word loads as
unsafe.
llvm-svn: 286843
Sumanth Gundapaneni [Mon, 14 Nov 2016 17:09:39 +0000 (17:09 +0000)]
Fix the unit test darwin-multiarch-arm.c for windows
llvm-svn: 286842
Stephan Bergmann [Mon, 14 Nov 2016 17:07:09 +0000 (17:07 +0000)]
Handle non-inlined clang::Type::getAs specializations in extract_symbols.py
The existing logic was to discard any symbols representing function template
instantiations, as the definitions were assumed to be inline. But there are
three explicit specializations of clang::Type::getAs that are only defined in
Clang's lib/AST/Type.cpp, and at least the plugin used by the LibreOffice build
(https://wiki.documentfoundation.org/Development/Clang_plugins) uses those
functions.
Differential Revision: https://reviews.llvm.org/D26455
llvm-svn: 286841
Teresa Johnson [Mon, 14 Nov 2016 16:40:19 +0000 (16:40 +0000)]
[ThinLTO] Make inline assembly handling more efficient in summary
Summary:
The change in r285513 to prevent exporting of locals used in
inline asm added all locals in the llvm.used set to the reference
set of functions containing inline asm. Since these locals were marked
NoRename, this automatically prevented importing of the function.
Unfortunately, this caused an explosion in the summary reference lists
in some cases. In my particular example, it happened for a large protocol
buffer generated C++ file, where many of the generated functions
contained an inline asm call. It was exacerbated when doing a ThinLTO
PGO instrumentation build, where the PGO instrumentation included
thousands of private __profd_* values that were added to llvm.used.
We really only need to include a single llvm.used local (NoRename) value
in the reference list of a function containing inline asm to block it
being imported. However, it seems cleaner to add a flag to the summary
that explicitly describes this situation, which is what this patch does.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26402
llvm-svn: 286840
Tom Stellard [Mon, 14 Nov 2016 16:06:33 +0000 (16:06 +0000)]
Fix build since r286752.
llvm-svn: 286839
Simon Pilgrim [Mon, 14 Nov 2016 15:54:24 +0000 (15:54 +0000)]
[CostModel][X86] Added mul costs for vXi8 vectors
More realistic v16i8/v32i8/v64i8 MUL costs - we have to extend to vXi16, use PMULLW and then truncate the result
llvm-svn: 286838
Rafael Espindola [Mon, 14 Nov 2016 15:39:38 +0000 (15:39 +0000)]
Fix program header propagation.
Propagate program headers by walking the commands, not the
sections. This allows us to propagate program headers even from
sections that don't end up in the output.
Fixes pr30997.
llvm-svn: 286837
Anastasia Stulova [Mon, 14 Nov 2016 15:34:01 +0000 (15:34 +0000)]
[OpenCL] Change to clk_event parameter in enqueue_kernel.
- Accept NULL pointer as a valid parameter value for clk_event.
- Generate clk_event_t arguments of internal
__enqueue_kernel_XXX function as pointers in generic address space.
Review: https://reviews.llvm.org/D26507
llvm-svn: 286836
Marshall Clow [Mon, 14 Nov 2016 15:09:45 +0000 (15:09 +0000)]
Update C++1z status with LWG papers from Issaquah.
llvm-svn: 286835
Marshall Clow [Mon, 14 Nov 2016 14:53:07 +0000 (14:53 +0000)]
Update C++1z status with LFTS issues from Issaquah.
llvm-svn: 286834
Haojian Wu [Mon, 14 Nov 2016 14:46:48 +0000 (14:46 +0000)]
[clang-move] Fix an incorrect range for the functions whose returned value is a macro
Summary:
Fix an incorrect range for the functions whose returned value is a macro
(e.g. `bool`). This incorrect range can lead to modifications of an unexpected
file where the macro is in.
We should use expansion location instead of spelling location.
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26609
llvm-svn: 286833
Simon Pilgrim [Mon, 14 Nov 2016 14:45:16 +0000 (14:45 +0000)]
[X86][AVX] Fixed v16i16/v32i8 ADD/SUB costs on AVX1 subtargets
Add explicit v16i16/v32i8 ADD/SUB costs, matching the costs of v4i64/v8i32 - they were missing for some reason.
This has side effects on the LV max bandwidth tests (AVX1 now prefers 128-bit vectors vs AVX2 which still prefers 256-bit)
llvm-svn: 286832
George Rimar [Mon, 14 Nov 2016 14:45:11 +0000 (14:45 +0000)]
[ELF] - Ignore -Map,-M and --cref options.
-M, --print-map Write map file on standard output
-Map MAPFILENAME Write map file
--cref Output cross reference table
This is relative to PR30973.
Next FreeBSD ports were atm failing because of
lack of -Map, -M and --cref:
sysutils/openipmi
emulators/adamem
devel/jwasm
net/pimd
devel/k8048
textproc/libcrm114
lang/micropython
net/mrouted
print/openprinting
After this patch all of them can be link fine.
llvm-svn: 286831
Sean Fertile [Mon, 14 Nov 2016 14:43:27 +0000 (14:43 +0000)]
[PPC] add extract sig/exp test data class for vec float and vec double.
Add vector extract exponent/significand functions to altivec.h, as well as
functions (and related constants) to test the data class of vector float
and vector double.
Differential Revision: https://reviews.llvm.org/D26271
llvm-svn: 286830
Sean Fertile [Mon, 14 Nov 2016 14:42:37 +0000 (14:42 +0000)]
[PPC] add intrinsics for vec extract exp/significand and vec test data class.
Differential Revision: https://reviews.llvm.org/D26272
llvm-svn: 286829
Marshall Clow [Mon, 14 Nov 2016 14:41:33 +0000 (14:41 +0000)]
Update C++1z status with C++17 issues from Issaquah. Still to come: LFTS issues and papers
llvm-svn: 286828
Rafael Espindola [Mon, 14 Nov 2016 14:33:49 +0000 (14:33 +0000)]
Delay removing empty section commands. NFC.
To fix pr30997 we will have to keep them a bit longer, this just
splits that part of the diff.
llvm-svn: 286827
Rafael Espindola [Mon, 14 Nov 2016 14:23:35 +0000 (14:23 +0000)]
Factor out removeEmptyCommands. NFC.
llvm-svn: 286826
Haojian Wu [Mon, 14 Nov 2016 14:15:44 +0000 (14:15 +0000)]
[clang-move] Abstract a ClassMather for matching class declarations.
Summary:
No functionality change.
This is a refactoring patch, which makes the code more readable and easy
to extend it to support more types.
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26515
llvm-svn: 286825
Rafael Espindola [Mon, 14 Nov 2016 14:13:32 +0000 (14:13 +0000)]
Factor out placeOrphanSections. NFC.
llvm-svn: 286824
Roger Ferrer Ibanez [Mon, 14 Nov 2016 13:44:50 +0000 (13:44 +0000)]
Protect std::ios tests under libcpp-no-exceptions
Skip tests that expect an exception be thrown. Also add
some missing asserts in the original test.
Differential Revision: https://reviews.llvm.org/D26512
llvm-svn: 286823
Aaron Ballman [Mon, 14 Nov 2016 13:33:51 +0000 (13:33 +0000)]
Reverting r285406, which was a temporary workaround to get one of the documentation bots upgraded to something newer than GCC 4.7. This restores the check for GCC 4.8.
llvm-svn: 286822
Pekka Jaaskelainen [Mon, 14 Nov 2016 13:14:38 +0000 (13:14 +0000)]
Fix r286819 (accidentally patched multiple times.
llvm-svn: 286821
Renato Golin [Mon, 14 Nov 2016 13:09:24 +0000 (13:09 +0000)]
Revert "llvm-strings: support printing the filename"
Also,
Revert "test: remove the archive before modifying it"
Revert "test: explicitly use gnu format"
This reverts commits r286778, r286729 and r286767, as they are randomly failing
on many bots (AArch64, x86_64).
llvm-svn: 286820
Pekka Jaaskelainen [Mon, 14 Nov 2016 13:08:30 +0000 (13:08 +0000)]
[OpenCL] always use SPIR address spaces for kernel_arg_addr_space MD
It doesn't make sense to use the target's address space ids in this context as
this is metadata that should be referring to the "logical" OpenCL address spaces.
For flat AS machines like all "CPUs" in general, the logical AS info gets lost as
there's only one address space (0).
This commit changes the logic such that we always use the SPIR address space
ids for the argument metadata. It thus allows implementing the clGetKernelArgInfo()
and the other detection needs.
https://reviews.llvm.org/D26157
llvm-svn: 286819
Renato Golin [Mon, 14 Nov 2016 12:19:18 +0000 (12:19 +0000)]
Revert "Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64."
This reverts commit r286815, as it broke all ARM and AArch64 bots.
llvm-svn: 286818
Simon Pilgrim [Mon, 14 Nov 2016 12:00:46 +0000 (12:00 +0000)]
Remove redundant condition (PR28352) NFCI.
We were already testing is the op was not a leaf, so need to then test if it was a leaf (added it to the assert instead).
llvm-svn: 286817
Strahinja Petrovic [Mon, 14 Nov 2016 11:40:56 +0000 (11:40 +0000)]
[lsan] [aarch64] Fix printing of pointers in make check tests - update
This patch replaces fprintf with print_address function in LSAN
tests. This is necessary because of different printing of pointers
in fprintf and sanitizer's print function.
Differential Revision: https://reviews.llvm.org/D26084.
llvm-svn: 286816
Neil Hickey [Mon, 14 Nov 2016 11:15:51 +0000 (11:15 +0000)]
Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64.
This change makes sure single-precision floating point types are used if the
cl_fp64 extension is not supported by the target.
Also removed the check to see whether the OpenCL version is >= 1.2, as this has
been incorporated into the extension setting code.
Differential Revision: https://reviews.llvm.org/D24235
llvm-svn: 286815
James Molloy [Mon, 14 Nov 2016 11:14:41 +0000 (11:14 +0000)]
[InlineCost] Remove skew when calculating call costs
When calculating the cost of a call instruction we were applying a heuristic penalty as well as the cost of the instruction itself.
However, when calculating the benefit from inlining we weren't discounting the equivalent penalty for the call instruction that would be removed! This caused skew in the calculation and meant we wouldn't inline in the following, trivial case:
int g() {
h();
}
int f() {
g();
}
llvm-svn: 286814
Roger Ferrer Ibanez [Mon, 14 Nov 2016 11:00:28 +0000 (11:00 +0000)]
Protect nested-exceptions tests under no-exceptions
Differential Revision: https://reviews.llvm.org/D26458
llvm-svn: 286813
Roger Ferrer Ibanez [Mon, 14 Nov 2016 10:44:26 +0000 (10:44 +0000)]
Update tests for strings conversions under libcpp-no-exceptions
Differential Revision: https://reviews.llvm.org/D26139
llvm-svn: 286812
Simon Pilgrim [Mon, 14 Nov 2016 10:40:23 +0000 (10:40 +0000)]
Remove redundant condition (PR28800) NFCI.
'A || (!A && B)' is equivalent to 'A || B':
(LoopCycle > DefCycle) || (LoopCycle <= DefCycle && LoopStage <= DefStage)
-->
(LoopCycle > DefCycle) || (LoopStage <= DefStage)
llvm-svn: 286811
George Rimar [Mon, 14 Nov 2016 10:33:53 +0000 (10:33 +0000)]
[ELF] - Simplify edata-etext.s test. NFC.
llvm-svn: 286810
Roger Ferrer Ibanez [Mon, 14 Nov 2016 10:27:56 +0000 (10:27 +0000)]
Protect smart-pointer tests under no exceptions
Skip tests that expect an exception be thrown under no-exceptions.
Differential Revision: https://reviews.llvm.org/D26457
llvm-svn: 286809
Diana Picus [Mon, 14 Nov 2016 10:25:43 +0000 (10:25 +0000)]
GlobalISel: Fix indentation. NFC
llvm-svn: 286808
Pablo Barrio [Mon, 14 Nov 2016 10:24:26 +0000 (10:24 +0000)]
[JumpThreading] Prevent non-deterministic use lists
Summary:
Unfolding selects was previously done with the help of a vector
of pointers that was then sorted to be able to remove duplicates.
As this sorting depends on the memory addresses, it was
non-deterministic. A SetVector is used now so that duplicates are
removed without the need of sorting first.
Reviewers: mgrang, efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26450
llvm-svn: 286807
Diana Picus [Mon, 14 Nov 2016 10:22:18 +0000 (10:22 +0000)]
GlobalISel: Fix typos. NFC
llvm-svn: 286806
George Rimar [Mon, 14 Nov 2016 10:14:18 +0000 (10:14 +0000)]
[ELF] - format. NFC.
llvm-svn: 286805
George Rimar [Mon, 14 Nov 2016 10:05:53 +0000 (10:05 +0000)]
[ELF] - format. NFC.
llvm-svn: 286804
George Rimar [Mon, 14 Nov 2016 10:04:45 +0000 (10:04 +0000)]
[ELF] - Removed trailing whitespace. NFC.
llvm-svn: 286803
George Rimar [Mon, 14 Nov 2016 10:03:54 +0000 (10:03 +0000)]
[ELF] - Removed unused code. NFC.
This branch was unused I believe,
as Tok can never be empty.
llvm-svn: 286802
George Rimar [Mon, 14 Nov 2016 09:56:35 +0000 (09:56 +0000)]
[ELF] - Fix mistype. NFC.
llvm-svn: 286801
George Rimar [Mon, 14 Nov 2016 09:33:38 +0000 (09:33 +0000)]
[ELF] - Untabify. NFC.
llvm-svn: 286800
Eugene Leviant [Mon, 14 Nov 2016 09:16:00 +0000 (09:16 +0000)]
[ELF] Convert StringTableSection to input section
Differential revision: https://reviews.llvm.org/D26549
llvm-svn: 286799
Roger Ferrer Ibanez [Mon, 14 Nov 2016 08:53:27 +0000 (08:53 +0000)]
Remove some false positives when taking the address of packed members
Differential Revision: https://reviews.llvm.org/D23657
llvm-svn: 286798
Eric Fiselier [Mon, 14 Nov 2016 07:26:17 +0000 (07:26 +0000)]
Add explicit (void) cast to unused unique_ptr::release() results
Summary:
This patch adds explicit `(void)` casts to discarded `release()` calls to suppress -Wunused-result.
This patch fixes *all* warnings are generated as a result of [applying `[[nodiscard]]` within libc++](https://reviews.llvm.org/D26596).
Similar fixes were applied to Clang in r286796.
Reviewers: chandlerc, dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26598
llvm-svn: 286797
Eric Fiselier [Mon, 14 Nov 2016 07:03:50 +0000 (07:03 +0000)]
Add explicit (void) cast to result of unique_ptr::release()
llvm-svn: 286796
Saleem Abdulrasool [Mon, 14 Nov 2016 04:54:47 +0000 (04:54 +0000)]
Demangle: only demangle mangled symbols
Only attempt to demangle symbols which have the itanium C++ prefix of `_Z`.
This ensures that we do not treat any symbol name as a managled named. We would
previously treat a C function `f` as a mangled name and decode that to `float`
incorrectly.
While it is easy to add tests for this, Mehdi recommended against introducing
tests for the demangler as libc++abi should cover the testing.
llvm-svn: 286795
Saleem Abdulrasool [Mon, 14 Nov 2016 03:07:47 +0000 (03:07 +0000)]
__cxa_demangle: allow demangling invocation blocks
The block invocation function uses an extension where the prefix is ___Z
as opposed to _Z. This should make the tests pass again.
Disable a negative test which was testing a crasher. The symbol being
demangled is not a valid mangled symbol and will return a nullptr.
Adjust the type info decoding test to be a valid symbol name.
llvm-svn: 286793
Eric Fiselier [Mon, 14 Nov 2016 03:03:13 +0000 (03:03 +0000)]
Fix ABI configuration detection on OS X
llvm-svn: 286792
Eric Fiselier [Mon, 14 Nov 2016 02:51:30 +0000 (02:51 +0000)]
Fix CMake set syntax
llvm-svn: 286791
Craig Topper [Mon, 14 Nov 2016 02:46:58 +0000 (02:46 +0000)]
[AVX-512] Add suffixless aliases for EVEX encoded vcvtsi2ss/vcvtsi2sd/vcvtusi2ss/vcvtusi2sd. This matches the VEX behavior.
Fixes another problem from PR28850.
llvm-svn: 286790
Eric Fiselier [Mon, 14 Nov 2016 02:43:12 +0000 (02:43 +0000)]
Add check-cxx-abilist target when supported.
This patch adds a `check-cxx-abilist` target which verifies the libc++.so ABI
when the current build configuration matches the configuration used to generate
the ABI lists.
In order to make this change `HandleOutOfTreeLLVM.cmake` needed to be modified
to include `LLVMConfig.cmake` so that `TARGET_TRIPLE` is defined. Hopefully
the changes needed to accommodate this won't break existing build
configurations.
llvm-svn: 286789
Saleem Abdulrasool [Mon, 14 Nov 2016 01:55:54 +0000 (01:55 +0000)]
__cxa_demangle: ensure that we have a mangled symbol
Ensure that we have a mangled symbol before attempting to demangle it. We would
previously treat any input as a mangled symbol rather than checking that the
symbol has the initial C++ Itanium v3 mangling prefix of `_Z`. This changes the
behaviour from the previous case which would undecorate `f` to `float` rather
than nullptr as it should.
Unfortunately, we do not have any negative testing for the demangler.
llvm-svn: 286788
Craig Topper [Mon, 14 Nov 2016 01:53:29 +0000 (01:53 +0000)]
[X86] Cleanup 'x' and 'y' mnemonic suffixes for vcvtpd2dq/vcvttpd2dq/vcvtpd2ps and similar instructions.
-Don't print the 'x' suffix for the 128-bit reg/mem VEX encoded instructions in Intel syntax. This is consistent with the EVEX versions.
-Don't print the 'y' suffix for the 256-bit reg/reg VEX encoded instructions in Intel or AT&T syntax. This is consistent with the EVEX versions.
-Allow the 'x' and 'y' suffixes to be used for the reg/mem forms when we're assembling using Intel syntax.
-Allow the 'x' and 'y' suffixes on the reg/reg EVEX encoded instructions in Intel or AT&T syntax. This is consistent with what VEX was already allowing.
This should fix at least some of PR28850.
llvm-svn: 286787
Craig Topper [Mon, 14 Nov 2016 01:53:22 +0000 (01:53 +0000)]
[AVX-512] Remove and autoupgrade masked dword/qword variable shift intrinsics to the new unmasked versions and selects.
llvm-svn: 286786
Sanjoy Das [Sun, 13 Nov 2016 23:40:40 +0000 (23:40 +0000)]
[LangRef] Drop misleading anecdote
`shl nsw i8 1, i8 8` is poison, but `mul i8 1, i8 128` is not.
This was discussed previously here:
http://lists.llvm.org/pipermail/llvm-dev/2015-April/084195.html. From
the discussion, it was not clear which semantics we want for `shl`, but
for now at least make the language reference more accurate.
llvm-svn: 286785
Eric Fiselier [Sun, 13 Nov 2016 23:00:30 +0000 (23:00 +0000)]
Add docs for use-configurable libc++ features
llvm-svn: 286784
Eric Fiselier [Sun, 13 Nov 2016 22:27:00 +0000 (22:27 +0000)]
Fix GCC libc++abi build
llvm-svn: 286783
Enrico Granata [Sun, 13 Nov 2016 21:30:54 +0000 (21:30 +0000)]
I am leaving Apple in a few weeks; switch over to my personal email address
llvm-svn: 286782
Tobias Grosser [Sun, 13 Nov 2016 21:28:13 +0000 (21:28 +0000)]
[ScopBuilder] Drop unnecessary namespace identifiers [NFC]
llvm-svn: 286781
Tobias Grosser [Sun, 13 Nov 2016 21:28:07 +0000 (21:28 +0000)]
[SCEVAffinator] Do not scan redundantly for parameters
In r286430 "SCEVValidator: add new parameters resulting from constant
extraction" we added functionality to scan for parameters after constant
extraction has taken place to ensure newly created parameters are correctly
registered. This addition made the already existing registration of parameters
redundant. Hence, we remove the corresponding call in this commit.
An alternative solution would have been to also perform constant extraction when
validating SCEV expressions and to then scan for parameters when validating
a SCEV expression. However, as SCEV validation is used during SCoP detection
where we want to be especially fast, adding additional functionality on this
hot path should be avoided if good alternatives exist. In this case, we can
choose to continue to only transform SCEV expression when actually modeling
them. As all transformations we perform are expected to not change the validity
of the SCEV expressions, this solution seems preferable.
Suggested-by: Eli Friedman <efriedma@codeaurora.org>
llvm-svn: 286780
Eric Fiselier [Sun, 13 Nov 2016 20:43:50 +0000 (20:43 +0000)]
Implement LWG 2770 - Make tuple_size<T> defined for all T
llvm-svn: 286779
Saleem Abdulrasool [Sun, 13 Nov 2016 20:43:41 +0000 (20:43 +0000)]
test: remove the archive before modifying it
The archive may already exist when not doing a clean test run. The dirty state
can cause a test failure. Remove the archive first.
llvm-svn: 286778
Saleem Abdulrasool [Sun, 13 Nov 2016 20:43:38 +0000 (20:43 +0000)]
llvm-cxxfilt: support reading from stdin
`c++filt` when given no arguments runs as a REPL, decoding each line as a
decorated name. Unify the test structure to be more uniform, with the tests for
llvm-cxxfilt living under test/tools/llvm-cxxfilt.
llvm-svn: 286777
Sanjay Patel [Sun, 13 Nov 2016 20:04:52 +0000 (20:04 +0000)]
[ValueTracking] recognize even more variants of smin/smax
Similar to:
https://reviews.llvm.org/rL285499
https://reviews.llvm.org/rL286318
We can't minimally expose this in IR tests because we don't have min/max intrinsics,
but the difference is visible in codegen because SelectionDAGBuilder::visitSelect()
uses matchSelectPattern().
We're not canonicalizing these patterns in IR (yet), so I don't expect there to be any
regressions as noted here:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/106868.html
llvm-svn: 286776
Craig Topper [Sun, 13 Nov 2016 19:58:18 +0000 (19:58 +0000)]
[AVX-512] Fix a disassembler failure for AVX-512 vcmpss/vcmpsd with an immediate larger than 32. Fix the same bug with VLX vcmpps/vcmppd.
Fixes PR24941.
llvm-svn: 286775
Eric Fiselier [Sun, 13 Nov 2016 19:54:31 +0000 (19:54 +0000)]
Fix PR30979 - tuple<move_only> is constructible from move_only const&
llvm-svn: 286774