Commit Graph

264506 Commits

Author SHA1 Message Date
Rui Ueyama 1c837b5fb1 [ICF] Ignore SHF_GROUP flag when comparing two sections.
SHF_GROUP bit doesn't make sense in executables or DSOs, so linkers are
expected to remove that bit from section flags. We did that when we create
output sections.

This patch is to do that earlier than before. Now the flag is dropped when
we instantiate input section objects.

This change improves ICF. Previously, two sections that differ only in
SHF_GROUP flag were not merged, because when the control reached ICF,
the flag was still there. Now the flag is dropped before reaching to ICF,
so the difference is ignored naturally.

This issue was found by pcc.

Differential Revision: https://reviews.llvm.org/D34074

llvm-svn: 305134
2017-06-10 00:38:55 +00:00
Vedant Kumar c7672d66ba Mark a sancov test as unsupported on x86_64h-darwin
Failing bot: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/6891

llvm-svn: 305133
2017-06-10 00:12:11 +00:00
Andrew Kaylor 647025f9e1 [InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin
Differential Revision: https://reviews.llvm.org/D33737

llvm-svn: 305132
2017-06-09 23:18:11 +00:00
Sanjay Patel dd96270472 [PowerPC] add memcmp test with one constant operand and equality cmp; NFC
llvm-svn: 305131
2017-06-09 23:15:14 +00:00
Richard Trieu be5cb93088 Revert r305110 to fix buildbot
llvm-svn: 305130
2017-06-09 23:03:40 +00:00
Sanjay Patel 2843cad435 [CGP] add a reference to DataLayout in MemCmpExpansion; NFCI
We're currently passing endian-ness around as a param (and not uniformly),
so this eliminates the need for that. I'd like to add a constant fold
call too, and that requires a DL.

llvm-svn: 305129
2017-06-09 23:01:05 +00:00
Erich Keane 3cf69bce69 Support operator keywords used in Windows SDK(fix ubsan)
UBSan found an issue with a nullptr being assigned to a reference.
This was because a following function went back and checked the 
identifier in the CPPOperatorName case.  This patch corrects that
location with the original logic as well.

llvm-svn: 305128
2017-06-09 22:50:02 +00:00
I-Jui (Ray) Sung 21fde385fa [AArch64] Add fallback in FastISel fp16 conversions
Summary:
- Fix assertion failures on F16 to/from int types in FastISel by falling
  back to regular ISel
- Add a testcase of various conversion cases with FastISel (-O0)

Reviewers: kristof.beyls, jmolloy, SjoerdMeijer

Reviewed By: SjoerdMeijer

Subscribers: SjoerdMeijer, llvm-commits, srhines, pirama, aemerson, rengolin, javed.absar, kristof.beyls

Differential Revision: https://reviews.llvm.org/D33734

llvm-svn: 305127
2017-06-09 22:40:50 +00:00
Richard Smith 01e4a7f29b 27037: Use correct CVR qualifier on an upcast on method pointer call
Patch by Taiju Tsuiki!

Differential Revision: https://reviews.llvm.org/D33875

llvm-svn: 305126
2017-06-09 22:25:28 +00:00
Vassil Vassilev c4c33ce097 [clang-tidy] D33930: Do not pick up by default the LLVM style if passing -format.
This adds a new flag -style which is passed to clang-apply-replacements and
defaults to file meaning it would pick up the closest .clang-format file in tree.

llvm-svn: 305125
2017-06-09 22:23:03 +00:00
Alexander Shaposhnikov f3e877017b [clang] Cleanup fixit.c
This diff removes temporary file t2 in fixit.c and updates the test command accordingly.
NFC.

Test plan:
make check-all

Differential revision: https://reviews.llvm.org/D34066

llvm-svn: 305124
2017-06-09 22:20:52 +00:00
Vassil Vassilev d335233fe2 Enable c++1z experimental builds.
Patch by David Abdurachmanov!

llvm-svn: 305123
2017-06-09 22:09:57 +00:00
Alex Lorenz 35cc699d7a Revert r305117
It caused `Index/availability.c` test failure on Linux

llvm-svn: 305122
2017-06-09 22:06:36 +00:00
Richard Smith 76c51dc5b2 Attempt to fix shared library build: RewriteFrontend depends on Serialization after r305116.
llvm-svn: 305121
2017-06-09 22:02:33 +00:00
Vassil Vassilev 497a99523a [modules] D29951: Load lazily the template specialization in multi-module setups.
Currently, we load all template specialization if we have more than one module
attached and we touch anything around the template definition.

This patch registers the template specializations as lazily-loadable entities.
In some TUs it reduces the amount of deserializations by 1%.

llvm-svn: 305120
2017-06-09 21:54:18 +00:00
Eugene Zelenko 416e0592d5 [Support] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 305119
2017-06-09 21:41:54 +00:00
Vassil Vassilev 41cafcd49c [modules] Fix that global delete operator get's assigned to a submodule.
n the current local-submodule-visibility mode, as soon as we discover a virtual
destructor, we declare on demand a global delete operator. However, this causes
that this delete operator is owned by the submodule which contains said virtual
destructor. This means that other modules no longer can see the global delete
operator which is hidden inside another submodule and fail to compile.

This patch unhides those global allocation function once they're created to
prevent this issue.

Patch by Raphael Isemann (D33366)!

llvm-svn: 305118
2017-06-09 21:36:28 +00:00
Alex Lorenz 2e34be23a2 [libclang] Merge multiple availability clauses when getting the platform's
availability

Patch by Ronald Wampler!

Differential Revision: https://reviews.llvm.org/D33478

llvm-svn: 305117
2017-06-09 21:29:45 +00:00
Richard Smith 86a3ef5b03 Add -frewrite-imports flag.
If specified, when preprocessing, the contents of imported .pcm files will be
included in preprocessed output. The resulting preprocessed file can then be
compiled standalone without the module sources or .pcm files.

llvm-svn: 305116
2017-06-09 21:24:02 +00:00
Craig Topper 7ad13f259f [LVI] Fix spelling error in comment. NFC
llvm-svn: 305115
2017-06-09 21:21:17 +00:00
Craig Topper 6dd9dcf26e [LVI] Const correct and rename the LVILatticeVal parameter to getPredicateResult. NFC
Previously it was non-const reference named Result which would tend to make someone think that it was an outparam when really its an input.

llvm-svn: 305114
2017-06-09 21:18:16 +00:00
Xinliang David Li 384f704834 Minor clean up of profile rt tests
llvm-svn: 305113
2017-06-09 21:14:19 +00:00
Rui Ueyama d97265f792 Simplify. NFC.
llvm-svn: 305112
2017-06-09 21:09:08 +00:00
Davide Italiano 0d54c46cdd [VMRange] Remove unused FindRangeIndexThatContainsValue().
llvm-svn: 305111
2017-06-09 21:01:55 +00:00
Richard Trieu 4ab80f2e9e [ODRHash] Add support for TemplateArgument types.
Recommit r304592 that was reverted in r304618.  r305104 should have fixed the
issue.

llvm-svn: 305110
2017-06-09 21:00:10 +00:00
Davide Italiano e8111778c1 [VMRange] Implement comparison operators using `==` and `<`.
llvm-svn: 305109
2017-06-09 20:49:11 +00:00
Zachary Turner 3226fe95bb [pdb] Support CoffSymbolRVA debug subsection.
llvm-svn: 305108
2017-06-09 20:46:52 +00:00
Yaxun Liu 6455b0dbf3 [SROA] Fix APInt size when load/store have different address space
Currently there is a bug in SROA::presplitLoadsAndStores which causes assertion in
GEPOperator::accumulateConstantOffset.

Basically it does not consider the situation that the pointer operand of load or store
may be in a non-zero address space and its size may be different from the size of
a pointer in address space 0.

This patch fixes assertion when compiling Blender Cycles kernels for amdgpu backend.

Diffferential Revision: https://reviews.llvm.org/D33298

llvm-svn: 305107
2017-06-09 20:46:29 +00:00
Zachary Turner bd336e44d8 Rename llvm-pdbdump -> llvm-pdbutil.
This is to reflect the evolving nature of the tool as being
useful for more than just dumping PDBs, as it can do many other
things.

Differential Revision: https://reviews.llvm.org/D34062

llvm-svn: 305106
2017-06-09 20:46:17 +00:00
Francis Ricci e22b696936 [ADT] Make iterable SmallVector template overrides more specific
Summary:
This prevents the iterator overrides from being selected in
the case where non-iterator types are used as arguments, which
is of particular importance in cases where other overrides with
identical types exist.

Reviewers: dblaikie, bkramer, rafael

Subscribers: llvm-commits, efriedma

Differential Revision: https://reviews.llvm.org/D33919

llvm-svn: 305105
2017-06-09 20:31:53 +00:00
Richard Trieu f21b803876 [ODRHash] Skip inline namespaces when hashing.
Speculatively try to fix the underlying issue from r304592, of underlying types
being confused when inline namespaces are used.

llvm-svn: 305104
2017-06-09 20:11:51 +00:00
Benjamin Kramer 29e23f3ccf Bringt back -triple so the test passes on non-x86.
llvm-svn: 305103
2017-06-09 19:47:36 +00:00
Keno Fischer 5329174cb1 [Sink] Fix predicate in legality check
Summary:
isSafeToSpeculativelyExecute is the wrong predicate to use here.
All that checks for is whether it is safe to hoist a value due to
unaligned/un-dereferencable accesses. However, not only are we doing
sinking rather than hoisting, our concern is that the location
we're loading from may have been modified. Instead forbid sinking
any load across a critical edge.

Reviewers: majnemer

Subscribers: davide, llvm-commits

Differential Revision: https://reviews.llvm.org/D33179

llvm-svn: 305102
2017-06-09 19:31:10 +00:00
Richard Smith 5d2ed48987 Add #pragma clang module build/endbuild pragmas for performing a module build
as part of a compilation.

This is intended for two purposes:

1) Writing self-contained test cases for modules: we can now write a single
source file test that builds some number of module files on the side and
imports them.

2) Debugging / test case reduction. A single-source testcase is much more
amenable to reduction, compared to a VFS tarball or .pcm files.

llvm-svn: 305101
2017-06-09 19:22:32 +00:00
Benjamin Kramer 01a48b5dfd I guess /dev/null is a bad idea on windows. Use a temp file instead.
llvm-svn: 305100
2017-06-09 19:18:07 +00:00
Davide Italiano 5ccf12e65f [VMRange] Use llvm::find_if. Thanks to Zachary for the suggestion.
llvm-svn: 305099
2017-06-09 19:14:59 +00:00
Stanislav Mekhanoshin 1a61ab8172 [AMDGPU] Add intrinsics for alignbit and alignbyte instructions
Differential Revision: https://reviews.llvm.org/D34046

llvm-svn: 305098
2017-06-09 19:03:00 +00:00
Benjamin Kramer a5a173639c [llvm-cvtres] Don't polute the test directory.
llvm-svn: 305097
2017-06-09 18:44:10 +00:00
Rafael Espindola d2a1b944bc Don't check the raw bits in tests.
It is not needed since we have the disassemble.

llvm-svn: 305096
2017-06-09 18:07:34 +00:00
Zachary Turner 1203bc4e28 Fix -Wreorder-fields warning.
llvm-svn: 305095
2017-06-09 18:04:02 +00:00
Benjamin Kramer 96a0b3fc6c [ASTMatchers] Fix use after free.
Found by asan.

llvm-svn: 305094
2017-06-09 17:55:42 +00:00
Zachary Turner 7e62cd17d6 Allow VarStreamArray to use stateful extractors.
Previously extractors tried to be stateless with any additional
context information needed in order to parse items being passed
in via the extraction method.  This led to quite cumbersome
implementation challenges and awkwardness of use.  This patch
brings back support for stateful extractors, making the
implementation and usage simpler.

llvm-svn: 305093
2017-06-09 17:54:36 +00:00
Eric Beckmann d9de6389fc Implement COFF emission for parsed Windows Resource ( .res) files.
Summary: Add the WindowsResourceCOFFWriter class for producing the final COFF after all parsing is done.

Reviewers: hiraditya!, zturner, ruiu

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34020

llvm-svn: 305092
2017-06-09 17:34:30 +00:00
Simon Pilgrim 3d37b1a277 [X86][SSE] Add support for PACKSS nodes to faux shuffle extraction
If the inputs won't saturate during packing then we can treat the PACKSS as a truncation shuffle

llvm-svn: 305091
2017-06-09 17:29:52 +00:00
Samuel Antao 8933ffbb12 [OpenMP] Prevent unused-variable warning in libomptarget when compiling in Release mode.
llvm-svn: 305090
2017-06-09 16:46:07 +00:00
Vassil Vassilev 0e1a4ca42e Repair 2010-05-31-palignr.c test
This test was silently failing since a long time because it failed to include
stdlib.h (as it's running in a freestanding environment). However, because we
 used just not clang_cc1 instead of the verify mode, this regression was never
 noticed and the test was just always passing.

This adds -ffreestanding to the invocation, so that tmmintrin.h doesn't
indirectly include mm_malloc.h, which in turns includes the unavailable stdlib.h.
We also run now in the -verify mode to prevent that we silently regress again.

I've also updated the test to no longer check the return value of _mm_alignr_epi8
as this is also causing it to fail (and it's not really the job of this test to
test this).


Patch by Raphael Isemann (D34022)

llvm-svn: 305089
2017-06-09 16:42:26 +00:00
Vassil Vassilev cb28894ac0 We do not need google test utils if we disabled LLVM_INCLUDE_TESTS
Fixes embedded uses of llvm where google testing framework is provided outside.

llvm-svn: 305088
2017-06-09 16:37:39 +00:00
Erich Keane 33c3d8a916 support operator keywords used in Windows SDK
to support operator keywords used in Windows SDK, alter token type when 
seen in system headers

Hello, I submitted D33505 to address this problem, but the 
proposal was rejected as too big a hammer.
This change will allow clang to parse the WindowsSDK header <query.h> 
which uses the operator name "or" as a field name. Treat cpp operator 
keywords as ordinary identifiers inside the Microsoft headers, but 
treat them as usual in the user's program.

Original Submitter: Melanie Blower (mibintc)

Differential Revision: https://reviews.llvm.org/D33782

llvm-svn: 305087
2017-06-09 16:29:35 +00:00
Craig Topper 31ce4ec2fd [LazyValueInfo] Don't run the more complex predicate handling code for EQ and NE in getPredicateResult
Summary:
Unless I'm mistaken, the special handling for EQ/NE should cover everything and there is no reason to fallthrough to the more complex code. For that matter I'm not sure there's any reason to special case EQ/NE other than avoiding creating temporary ConstantRanges.

This patch moves the complex code into an else so we only do it when we are handling a predicate other than EQ/NE.

Reviewers: anna, reames, resistor, Farhana

Reviewed By: anna

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34000

llvm-svn: 305086
2017-06-09 16:16:20 +00:00
Krzysztof Parzyszek 7aca2fd830 [Hexagon] Fixes and updates to the selection patterns
- Add some missing patterns.
- Use C4_cmplte in branch patterns.
- Fix signedness of immediate operand in M2_accii.

llvm-svn: 305085
2017-06-09 15:26:21 +00:00