Aaron Ballman [Mon, 16 Apr 2018 21:07:08 +0000 (21:07 +0000)]
Defer adding keywords to the identifier table until after the language options have been loaded from the AST file.
This fixes issues with "class" being reported as an identifier in "enum class" because the construct is not present when using default language options.
Patch by Johann Klähn.
llvm-svn: 330159
Saleem Abdulrasool [Mon, 16 Apr 2018 21:05:56 +0000 (21:05 +0000)]
build: reserve `--color-diagnostics` for lld
When building out-of-tree compilers (e.g. swift), the linker check here
may yield incorrect values. Ensure that we are using lld before we
attempt to use `--color-diagnostics` for the linker. Other linkers (i.e
bfd, gold) do not support this flag and the test can pass in some cases
and then fail subsequently when building.
llvm-svn: 330158
Zachary Turner [Mon, 16 Apr 2018 20:42:06 +0000 (20:42 +0000)]
[PDB] Correctly use the target machine when writing DBI stream.
Using Config->is64() will treat ARM64 as Amd64, which is incorrect.
Furthermore, there are more esoteric architectures that could
theoretically be encountered. Just set it directly to the machine
type, which we already know anyway.
llvm-svn: 330157
Alexey Bataev [Mon, 16 Apr 2018 20:34:41 +0000 (20:34 +0000)]
[OPENMP] Allow to use declare target variables in map clauses
Global variables marked as declare target are allowed to be used in map
clauses. Patch fixes the crash of the compiler on the declare target
variables in map clauses.
llvm-svn: 330156
Akira Hatanaka [Mon, 16 Apr 2018 20:23:52 +0000 (20:23 +0000)]
[CodeGen] Fix a crash that occurs when a non-trivial C struct with a
volatile array field is copied.
The crash occurs because method 'visitArray' passes a null FieldDecl to
method 'visit' and some of the methods called downstream expect a
non-null FieldDecl to be passed.
This reapplies r330151 with a fix to the test case.
rdar://problem/
33599681
llvm-svn: 330155
Alexey Bataev [Mon, 16 Apr 2018 20:16:21 +0000 (20:16 +0000)]
[OPENMP] General code improvements.
llvm-svn: 330154
Akira Hatanaka [Mon, 16 Apr 2018 19:53:59 +0000 (19:53 +0000)]
Revert "[CodeGen] Fix a crash that occurs when a non-trivial C struct with a"
This reverts commit r330151, which caused bots to fail.
llvm-svn: 330153
Bruno Cardoso Lopes [Mon, 16 Apr 2018 19:42:32 +0000 (19:42 +0000)]
Use export_as for autolinking frameworks
framework module SomeKitCore {
...
export_as SomeKit
}
Given the module above, while generting autolink information during
codegen, clang should to emit '-framework SomeKitCore' only if SomeKit
was not imported in the relevant TU, otherwise it should use '-framework
SomeKit' instead.
rdar://problem/
38269782
llvm-svn: 330152
Akira Hatanaka [Mon, 16 Apr 2018 19:38:00 +0000 (19:38 +0000)]
[CodeGen] Fix a crash that occurs when a non-trivial C struct with a
volatile array field is copied.
The crash occurs because method 'visitArray' passes a null FieldDecl to
method 'visit' and some of the methods called downstream expect a
non-null FieldDecl to be passed.
rdar://problem/
33599681
llvm-svn: 330151
Krzysztof Parzyszek [Mon, 16 Apr 2018 19:11:17 +0000 (19:11 +0000)]
[Hexagon] Emit a warning when -fvectorize is given without -mhvx
llvm-svn: 330150
Davide Italiano [Mon, 16 Apr 2018 19:07:14 +0000 (19:07 +0000)]
[lldb-private] Mark a function as inline to prevent multiple def errors.
llvm-svn: 330149
Mandeep Singh Grang [Mon, 16 Apr 2018 18:56:10 +0000 (18:56 +0000)]
[RISCV] Fix assert message operator
Summary:
Specifying assert message with an || operator makes the compiler interpret it
as a bool. Changed it to &&.
Reviewers: asb, apazos
Reviewed By: asb
Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D45660
llvm-svn: 330148
Davide Italiano [Mon, 16 Apr 2018 18:25:57 +0000 (18:25 +0000)]
[Statistics] Move GetStatDescription to an header file.
In preparation for using it in the API.
<rdar://problem/
36555975>
llvm-svn: 330147
Kostya Kortchinsky [Mon, 16 Apr 2018 18:17:22 +0000 (18:17 +0000)]
[sanitizer] Fix OSX build failure post D45457
Summary:
It looks like OSX's UBSan needs a "NoHooks" version of
`RTSanitizerCommonSymbolizer` to work build properly.
Subscribers: kubamracek, mgorny, delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D45696
llvm-svn: 330146
Zachary Turner [Mon, 16 Apr 2018 18:17:13 +0000 (18:17 +0000)]
Resubmit "Fix some incorrect fields in our generated PDBs."
This fixes the failing tests. They simply hadn't been updated
to match the new output resulting from this patch.
llvm-svn: 330145
Craig Topper [Mon, 16 Apr 2018 18:14:19 +0000 (18:14 +0000)]
[X86] Remove unnecessary -mattr to enable avx512bw when the -mcpu already enabled it. NFC
This makes the test similar to the arith-sub.ll and arith-mul.ll tests.
llvm-svn: 330144
Haicheng Wu [Mon, 16 Apr 2018 18:09:49 +0000 (18:09 +0000)]
[SLP] Use getExtractWithExtendCost() to compute the scalar cost of extractelement/ext pair
We use getExtractWithExtendCost to calculate the cost of extractelement and
s|zext together when computing the extract cost after vectorization, but we
calculate the cost of extractelement and s|zext separately when computing the
scalar cost which is larger than it should be.
Differential Revision: https://reviews.llvm.org/D45469
llvm-svn: 330143
Lang Hames [Mon, 16 Apr 2018 18:05:24 +0000 (18:05 +0000)]
[ORC] Add a MaterializationResponsibility class to track responsibility for
materializing function definitions.
MaterializationUnit instances are responsible for resolving and finalizing
symbol definitions when their materialize method is called. By contract, the
MaterializationUnit must materialize all definitions it is responsible for and
no others. If it can not materialize all definitions (because of some error)
then it must notify the associated VSO about each definition that could not be
materialized. The MaterializationResponsibility class tracks this
responsibility, asserting that all required symbols are resolved and finalized,
and that no extraneous symbols are resolved or finalized. In the event of an
error it provides a convenience method for notifying the VSO about each
definition that could not be materialized.
llvm-svn: 330142
Lang Hames [Mon, 16 Apr 2018 18:05:22 +0000 (18:05 +0000)]
[ORC] Merge VSO notifyResolutionFailed and notifyFinalizationFailed in to
notifyMaterializationFailed.
The notifyMaterializationFailed method can determine which error to raise by
looking at which queue the pending queries are in (resolution or finalization).
llvm-svn: 330141
Alexey Bataev [Mon, 16 Apr 2018 17:59:34 +0000 (17:59 +0000)]
[OPENMP] General code improvements.
llvm-svn: 330140
Krzysztof Parzyszek [Mon, 16 Apr 2018 17:35:30 +0000 (17:35 +0000)]
[Hexagon] Turn off flag enabling auto-vectorization
It was turned on for testing and was accidentally left on in the commit.
llvm-svn: 330139
Lei Huang [Mon, 16 Apr 2018 17:30:24 +0000 (17:30 +0000)]
[NFC] Move verificaiton check for f128 conversion into LowerINT_TO_FP()
Move veriication check for legal conversions to f128 into LowerINT_TO_FP()
and fix some indentations to match other sections of the code for readability.
llvm-svn: 330138
Sanjay Patel [Mon, 16 Apr 2018 17:15:13 +0000 (17:15 +0000)]
[InstCombine] simplify code in SimplifyAssociativeOrCommutative; NFCI
llvm-svn: 330137
Craig Topper [Mon, 16 Apr 2018 17:05:01 +0000 (17:05 +0000)]
[Attributes] Fix a bug in AttributeList::get so it can handle a mix of FunctionIndex and ReturnIndex/arg indices at the same time
The code uses the index of the last element in the sorted array to determine the maximum size needed for the vector. But if the last index is a FunctionIndex(~0), attrIdxToArrayIdx will return 0 and the vector will have size 1. If there are any indices before FunctionIndex, those values would return a value larger than 0 from attrIdxToArrayIdx. So in this case we need to look in front of the FunctionIndex to get the true size needed.
Differential Revision: https://reviews.llvm.org/D45632
llvm-svn: 330136
Adrian McCarthy [Mon, 16 Apr 2018 17:01:18 +0000 (17:01 +0000)]
Remove faulty assertion in llvm-pdbutil
If a class's first data member is an instance of an empty class, then an
assertion in the PrettyClassLayoutGraphicalDumper would fail. The
storage is reserved, but it's not marked as in use.
As far as I understand, it's the assertion that's faulty, so I removed it
and updated the nearby comment.
Found by running llvm-pdbutil against its own PDB, and this assertion would
fail on HashAdjusters, which is a HashTable whose first data member is a
TraitsT, which is a PdbHashTraits<T>, which is an empty struct. (The struct
has a specialization for uint32_t, but that specialization doesn't apply
here because the T is actually ulittle32_t.)
Differential Revision: https://reviews.llvm.org/D45645
llvm-svn: 330135
Kostya Kortchinsky [Mon, 16 Apr 2018 16:58:34 +0000 (16:58 +0000)]
[sanitizer] Build failures fixes post D45457
Summary: Adding a couple missed RTSanitizerCommonSymbolizer in makefiles.
Subscribers: kubamracek, mgorny, delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D45694
llvm-svn: 330134
Zachary Turner [Mon, 16 Apr 2018 16:55:41 +0000 (16:55 +0000)]
Revert "Fix some incorrect fields in our generated PDBs."
There are a couple of failing tests which slipped under my radar
so I'm reverting this while I attempt to fix.
llvm-svn: 330133
Brock Wyma [Mon, 16 Apr 2018 16:53:57 +0000 (16:53 +0000)]
[CodeView] Initial support for emitting S_THUNK32 symbols for compiler...
When emitting CodeView debug information, compiler-generated thunk routines
should be emitted using S_THUNK32 symbols instead of S_GPROC32_ID symbols so
Visual Studio can properly step into the user code. This initial support only
handles standard thunk ordinals.
Differential Revision: https://reviews.llvm.org/D43838
llvm-svn: 330132
Kostya Kortchinsky [Mon, 16 Apr 2018 16:32:19 +0000 (16:32 +0000)]
[sanitizer] Split Symbolizer/StackTraces from core RTSanitizerCommon
Summary:
Host symbolizer & stacktraces related code in their own RT:
`RTSanitizerCommonSymbolizer`, which is "libcdep" by nature. Symbolizer &
stacktraces specific code that used to live in common files is moved to a new
file `sanitizer_symbolizer_report.cc` as is.
The purpose of this is the enforce a separation between code that relies on
symbolization and code that doesn't. This saves the inclusion of spurious code
due to the interface functions with default visibility, and the extra data
associated.
The following sanitizers makefiles were modified & tested locally:
- dfsan: doesn't require the new symbolizer RT
- esan: requires it
- hwasan: requires it
- lsan: requires it
- msan: requires it
- safestack: doesn't require it
- xray: doesn't require it
- tsan: requires it
- ubsan: requires it
- ubsan_minimal: doesn't require it
- scudo: requires it (but not for Fuchsia that has a minimal runtime)
This was tested locally on Linux, Android, Fuchsia.
Reviewers: alekseyshl, eugenis, dberris, kubamracek, vitalybuka, dvyukov, mcgrathr
Reviewed By: alekseyshl, vitalybuka
Subscribers: srhines, kubamracek, mgorny, krytarowski, delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D45457
llvm-svn: 330131
Zachary Turner [Mon, 16 Apr 2018 16:27:49 +0000 (16:27 +0000)]
Fix some incorrect fields in our generated PDBs.
Most of these are pretty trivial and obvious. Setting the toolchain
version to 14.11 is perhaps a little questionable, but we've been bitten
in the past where one of our version fields sidn't match MSVC's, and I
definitely don't want to go through that diagnosis again as it was
pretty time consuming and hard to track down.
I found all of these by using llvm-pdbutil export to dump the dbi and
pdb streams to a file, then using fc followed by llvm-pdbutil explain to
explain the mismatched bytes.
There are still some more, these are just the low hanging fruit.
Differential Revision: https://reviews.llvm.org/D45276
llvm-svn: 330130
Sanjay Patel [Mon, 16 Apr 2018 15:19:24 +0000 (15:19 +0000)]
[InstCombine] simplify getBinOpsForFactorization(); NFC
llvm-svn: 330129
David Blaikie [Mon, 16 Apr 2018 14:23:15 +0000 (14:23 +0000)]
SmallVectorMemoryBuffer: Fix some comments
llvm-svn: 330128
Sanjay Patel [Mon, 16 Apr 2018 14:13:57 +0000 (14:13 +0000)]
[InstCombine] simplify fneg+fadd folds; NFC
Two cleanups:
1. As noted in D45453, we had tests that don't need FMF that were misplaced in the 'fast-math.ll' test file.
2. This removes the final uses of dyn_castFNegVal, so that can be deleted. We use 'match' now.
llvm-svn: 330126
Sanjay Patel [Mon, 16 Apr 2018 13:21:15 +0000 (13:21 +0000)]
[InstCombine] fix formatting; NFC
llvm-svn: 330124
Dmitry Preobrazhensky [Mon, 16 Apr 2018 12:41:38 +0000 (12:41 +0000)]
[AMDGPU][MC][VI][GFX9] Added support of SDWA/DPP for v_cndmask_b32
See bug 36356: https://bugs.llvm.org/show_bug.cgi?id=36356
Differential Revision: https://reviews.llvm.org/D45446
Reviewers: artem.tamazov, arsenm, timcorringham
llvm-svn: 330123
Dmitry Vyukov [Mon, 16 Apr 2018 11:43:00 +0000 (11:43 +0000)]
tsan: add support for linux/powerpc64 in buildgo.sh
The current implementation of the Go sanitizer only works on x86_64.
Added some modifications to the buildgo.sh script and the Tsan code
to make it work on powerpc64/linux.
Author: cseo (Carlos Eduardo Seo)
Reviewed in: https://reviews.llvm.org/D43025
llvm-svn: 330122
Pavel Labath [Mon, 16 Apr 2018 11:16:41 +0000 (11:16 +0000)]
[test] Avoid spurious failure in debug-names-find.s. NFC.
Have llvm-dwarfdump take input from stdin to avoid leaking the host paths into
the tests, causing nondeterministic failures.
llvm-svn: 330121
Sander de Smalen [Mon, 16 Apr 2018 10:46:18 +0000 (10:46 +0000)]
[AArch64][SVE] Asm: Support for structured LD4 (scalar+imm) load instructions.
Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro
Reviewed By: rengolin
Subscribers: tschuett, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D45624
llvm-svn: 330120
Roman Lebedev [Mon, 16 Apr 2018 10:40:56 +0000 (10:40 +0000)]
[LatencyPriorityQueue] Fix build: missing override
[10/260] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/PostRASchedulerList.cpp.o
FAILED: lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/PostRASchedulerList.cpp.o
/usr/local/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/CodeGen -I/build/llvm/lib/CodeGen -I/usr/include/libxml2 -Iinclude -I/build/llvm/include -g0 -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics -ffunction-sections -fdata-sections -O3 -g0 -fPIC -UNDEBUG -fno-exceptions -fno-rtti -MD -MT lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/PostRASchedulerList.cpp.o -MF lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/PostRASchedulerList.cpp.o.d -o lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/PostRASchedulerList.cpp.o -c /build/llvm/lib/CodeGen/PostRASchedulerList.cpp
In file included from /build/llvm/lib/CodeGen/PostRASchedulerList.cpp:26:
/build/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h:87:27: error: 'dump' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
LLVM_DUMP_METHOD void dump(ScheduleDAG *DAG) const {
^
/build/llvm/include/llvm/CodeGen/ScheduleDAG.h:547:18: note: overridden virtual function is here
virtual void dump(ScheduleDAG *) const {}
^
1 error generated.
llvm-svn: 330119
Aleksandar Beserminji [Mon, 16 Apr 2018 10:21:24 +0000 (10:21 +0000)]
[mips] Prevent PIC to be set to level 2
MIPS does not use PIC level 2 for historical reasons,
even with -fPIC/-mxgot/multigot options. This patch
prevents PIC to be set to level 2 for MIPS.
Differential Revision: https://reviews.llvm.org/D44381
llvm-svn: 330118
Stefan Pintilie [Mon, 16 Apr 2018 10:20:56 +0000 (10:20 +0000)]
[LatencyPriorityQueue] The LatencyPriorityQueue class is missing the implementation for the dump function
Added implementation of the dump function for LatencyPriorityQueue.
llvm-svn: 330117
Sander de Smalen [Mon, 16 Apr 2018 10:10:48 +0000 (10:10 +0000)]
[AArch64][SVE] Asm: Support for structured LD3 (scalar+imm) load instructions.
Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro
Reviewed By: rengolin
Subscribers: tschuett, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D45623
llvm-svn: 330116
Puyan Lotfi [Mon, 16 Apr 2018 09:31:49 +0000 (09:31 +0000)]
[MIR-Canon] Fixing a test failure caused by COPY Folding.
llvm-svn: 330115
Stefan Maksimovic [Mon, 16 Apr 2018 09:22:20 +0000 (09:22 +0000)]
[mips] Restrict certain trap instructions for micromipsr6
Instructions removed from micromipsr6:
teqi, tgei, tgeiu, tlti, tltiu, tnei
Differential Revision: https://reviews.llvm.org/D45318
llvm-svn: 330114
Puyan Lotfi [Mon, 16 Apr 2018 09:03:03 +0000 (09:03 +0000)]
[MIR-Canon] Adding ISA-Agnostic COPY Folding.
Transforms the following:
%vreg1234:gpr32 = COPY %42
%vreg1235:gpr32 = COPY %vreg1234
%vreg1236:gpr32 = COPY %vreg1235
$w0 = COPY %vreg1236
into:
$w0 = COPY %42
Assuming %42 is also a gpr32
llvm-svn: 330113
Malcolm Parsons [Mon, 16 Apr 2018 08:31:08 +0000 (08:31 +0000)]
Clean carriage returns from lib/ and include/. NFC.
Summary:
Clean carriage returns from lib/ and include/. NFC.
(I have to make this change locally in order for `git diff` to show sane output after I edit a file, so I might as well ask for it to be committed. I don't have commit privs myself.)
(Without this patch, `git rebase`ing any change involving SemaDeclCXX.cpp is a real nightmare. :( So while I have no right to ask for this to be committed, geez would it make my workflow easier if it were.)
Here's the command I used to reformat things. (Requires bash and OSX/FreeBSD sed.)
git grep -l $'\r' lib include | xargs sed -i -e $'s/\r//'
find lib include -name '*-e' -delete
Reviewers: malcolm.parsons
Reviewed By: malcolm.parsons
Subscribers: emaste, krytarowski, cfe-commits
Differential Revision: https://reviews.llvm.org/D45591
Patch by Arthur O'Dwyer.
llvm-svn: 330112
Puyan Lotfi [Mon, 16 Apr 2018 08:12:15 +0000 (08:12 +0000)]
[NFC][MIR-Canon] clang-format cleanup of Mir Canonicalizer Pass.
llvm-svn: 330111
Gabor Buella [Mon, 16 Apr 2018 08:10:10 +0000 (08:10 +0000)]
[X86] Introduce archs: goldmont-plus & tremont
Reviewers: craig.topper
Reviewed By: craig.topper
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D45613
llvm-svn: 330110
Gabor Buella [Mon, 16 Apr 2018 07:47:35 +0000 (07:47 +0000)]
[X86] Introduce archs: goldmont-plus & tremont
Using Goldmont's cost tables for these two upcoming
atom archs.
Reviewers: craig.topper
Reviewed By: craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45612
llvm-svn: 330109
Sander de Smalen [Mon, 16 Apr 2018 07:09:29 +0000 (07:09 +0000)]
[AArch64][SVE] Asm: Support for structured LD2 (scalar+imm) load instructions.
Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro
Reviewed By: rengolin
Subscribers: tschuett, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D45622
llvm-svn: 330108
Weiming Zhao [Mon, 16 Apr 2018 03:44:03 +0000 (03:44 +0000)]
Rename ObjectMemoryBuffer to SmallVectorMemoryBuffer; NFCI
Summary: As discussed in https://reviews.llvm.org/D45606, it makes more sense to name the class as SmallVectorMemoryBuffer
Reviewers: bkramer, dblaikie
Reviewed By: dblaikie
Subscribers: mehdi_amini, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D45661
llvm-svn: 330107
Shiva Chen [Mon, 16 Apr 2018 01:58:39 +0000 (01:58 +0000)]
[BasicAA] Return MayAlias for the pointer plus variable offset to
structure object member
Differential Revision: https://reviews.llvm.org/D45510
llvm-svn: 330106
Craig Topper [Sun, 15 Apr 2018 19:11:25 +0000 (19:11 +0000)]
[X86] Use APInt::isSubsetof instead of APInt::intersects to avoid a negation of an APInt value. NFC
llvm-svn: 330105
Craig Topper [Sun, 15 Apr 2018 19:11:24 +0000 (19:11 +0000)]
[X86] Use uint32_t instead of unsigned in GetLo32XForm for readability. NFC
GetLo8XForm right next to it uses uint8_t so uint32_t is consistent.
llvm-svn: 330104
Roman Lebedev [Sun, 15 Apr 2018 18:59:44 +0000 (18:59 +0000)]
[InstCombine] Simplify 'xor' to 'or' if no common bits are set.
Summary:
In order to get the whole fold as specified in [[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]],
let's first handle the simple straight-forward things.
Let's start with the `and` -> `or` simplification.
The one obvious thing missing here: the constant mask is not handled.
I have an idea how to handle it, but it will require some thinking,
and is not strictly required here, so i've left that for later.
https://rise4fun.com/Alive/Pkmg
Reviewers: spatel, craig.topper, eli.friedman, jingyue
Reviewed By: spatel
Subscribers: llvm-commits
Was reviewed as part of https://reviews.llvm.org/D45631
llvm-svn: 330103
Roman Lebedev [Sun, 15 Apr 2018 18:59:38 +0000 (18:59 +0000)]
[SelectionDAG][NFC] haveNoCommonBitsSet(): add FIXME notes
As suggested in https://reviews.llvm.org/D45631#1068338
llvm-svn: 330102
Roman Lebedev [Sun, 15 Apr 2018 18:59:33 +0000 (18:59 +0000)]
[InstCombine] Simplify 'add' to 'or' if no common bits are set.
Summary:
In order to get the whole fold as specified in [[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]],
let's first handle the simple straight-forward things.
Let's start with the `and` -> `or` simplification.
The one obvious thing missing here: the constant mask is not handled.
I have an idea how to handle it, but it will require some thinking,
and is not strictly required here, so i've left that for later.
https://rise4fun.com/Alive/Pkmg
Reviewers: spatel, craig.topper, eli.friedman, jingyue
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45631
llvm-svn: 330101
Roman Lebedev [Sun, 15 Apr 2018 18:59:27 +0000 (18:59 +0000)]
[NFC] ConstantOffsetExtractor::CanTraceInto(): add FIXME: no tests
As suggested in https://reviews.llvm.org/D45631#1068338,
looking at haveNoCommonBitsSet() users, and *trying* to
show the change effect elsewhere.
llvm-svn: 330100
Andrea Di Biagio [Sun, 15 Apr 2018 17:32:17 +0000 (17:32 +0000)]
[MC] Moved all the remaining logic that computed instruction latency and reciprocal throughput from TargetSchedModel to MCSchedModel.
TargetSchedModel now always delegates to MCSchedModel the computation of
instruction latency and reciprocal throughput.
No functional change intended.
llvm-svn: 330099
Sanjay Patel [Sun, 15 Apr 2018 16:43:48 +0000 (16:43 +0000)]
[DAGCombiner, PowerPC] allow X - (fpext(-Y) --> X + fpext(Y) with multiple uses
This is a transform that I limited in instcombine in rL329821 because it was
creating more instructions in IR when the cast has multiple uses.
But if the cast is free, then we can do the transform regardless of other
uses because it improves the potential throughput of the calculation by
removing a dependency on the fneg.
Differential Revision: https://reviews.llvm.org/D45598
llvm-svn: 330098
Sanjay Patel [Sun, 15 Apr 2018 16:20:58 +0000 (16:20 +0000)]
[InstCombine] simplify more code for distributive property; NFCI
Also, fix capitalization to current style. Follow-up to:
rL330096
llvm-svn: 330097
Sanjay Patel [Sun, 15 Apr 2018 15:39:57 +0000 (15:39 +0000)]
[InstCombine] simplify code for distributive property; NFCI
llvm-svn: 330096
Henry Wong [Sun, 15 Apr 2018 10:34:06 +0000 (10:34 +0000)]
[analyzer] Do not invalidate the `this` pointer.
Summary:
`this` pointer is not an l-value, although we have modeled `CXXThisRegion` for `this` pointer, we can only bind it once, which is when we start to inline method. And this patch fixes https://bugs.llvm.org/show_bug.cgi?id=35506.
In addition, I didn't find any other cases other than loop-widen that could invalidate `this` pointer.
Reviewers: NoQ, george.karpenkov, a.sidorin, seaneveson, szepet
Reviewed By: NoQ
Subscribers: xazax.hun, rnkovacs, cfe-commits, MTC
Differential Revision: https://reviews.llvm.org/D45491
llvm-svn: 330095
Jonas Devlieghere [Sun, 15 Apr 2018 08:44:15 +0000 (08:44 +0000)]
[Support] Extend WithColor helpers
Although printing warnings and errors to stderr is by far the most
common case, this patch makes it possible to specify any stream.
llvm-svn: 330094
Weiming Zhao [Sun, 15 Apr 2018 05:17:14 +0000 (05:17 +0000)]
NFC: Move ObjectMemoryBuffer to support
Summary:
Since the class is used by both MCJIT and LTO, it makes more sense to move it to Support lib.
This is a follow up patch to r329929 and https://reviews.llvm.org/D45244
Reviewers: bkramer, dblaikie
Reviewed By: bkramer
Subscribers: mehdi_amini, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D45606
llvm-svn: 330093
Jonas Devlieghere [Sat, 14 Apr 2018 22:07:23 +0000 (22:07 +0000)]
[DebugInfo] Use WithColor to print errors/warnings
Use the convenience methods from WithColor to consistently print errors
and warnings in libDebugInfo.
llvm-svn: 330092
Jonas Devlieghere [Sat, 14 Apr 2018 21:36:42 +0000 (21:36 +0000)]
[Support] Add convenience functions to WithColor. NFC.
Create convenience functions for printing error, warning and note to
stdout. Previously we had similar functions being used in dsymutil, but
given that this pattern is so common it makes sense to make it available
globally.
llvm-svn: 330091
Artur Gainullin [Sat, 14 Apr 2018 20:10:17 +0000 (20:10 +0000)]
[X86] Tests for unsigned saturation downconvert detection.
One more test for smax(smin(x, C2), C1) pattern.
llvm-svn: 330090
Warren Ristow [Sat, 14 Apr 2018 19:18:28 +0000 (19:18 +0000)]
[InstCombine] Enable Add/Sub simplifications with only 'reassoc' FMF
These simplifications were previously enabled only with isFast(), but that
is more restrictive than required. Since r317488, FMF has 'reassoc' to
control these cases at a finer level.
llvm-svn: 330089
Artur Gainullin [Sat, 14 Apr 2018 19:09:02 +0000 (19:09 +0000)]
[X86] Tests for unsigned saturation downconvert detection.
llvm-svn: 330088
Ilya Biryukov [Sat, 14 Apr 2018 16:27:35 +0000 (16:27 +0000)]
[clangd] Fix label and snippet for funcs in the index
This is a follow-up to r330004 to fix functions with required template args,
e.g. std::make_shared.
llvm-svn: 330087
Sanjay Patel [Sat, 14 Apr 2018 13:39:02 +0000 (13:39 +0000)]
[InstCombine] add shift+logic tests (PR37098); NFC
It debateable whether instcombine should be in the business of
reassociation, but it is currently.
These tests and PR37098 demonstrate a missing ability to do a
simple reassociation that allows eliminating shifts.
If we decide that functionality belongs somewhere else, then we
should still have some tests to show that we've intentionally
limited instcombine to *not* include this ability.
llvm-svn: 330086
Simon Pilgrim [Sat, 14 Apr 2018 13:06:38 +0000 (13:06 +0000)]
[X86][MMX] Set PAVG/PHADD/PMIN/PMAX/PSIGN instructions to use same scheduler classes as SSE/AVX
llvm-svn: 330085
Jan Kratochvil [Sat, 14 Apr 2018 11:12:52 +0000 (11:12 +0000)]
Reapply "Cleanup DWARFCompileUnit and DWARFUnit in preparation for adding DWARFTypeUnit".
This patch by Greg Clayton drops the virtualization for DWARFPartialUnit.
The virtualization of DWARFUnit now matches more its LLVM counterpart.
DWZ patchset is going to be implementable without DWARFPartialUnit remapping.
https://reviews.llvm.org/D40474
This reverts commit 329423.
This reapplies commit r329305.
llvm-svn: 330084
Hiroshi Inoue [Sat, 14 Apr 2018 08:59:00 +0000 (08:59 +0000)]
[NFC] fix trivial typos in document and comments
"not not" -> "not" etc
llvm-svn: 330083
Tony Tye [Sat, 14 Apr 2018 01:58:10 +0000 (01:58 +0000)]
[AMDGPU] Add gfx902 product names
Differential Revision: https://reviews.llvm.org/D45609
llvm-svn: 330081
Vedant Kumar [Sat, 14 Apr 2018 01:40:48 +0000 (01:40 +0000)]
Revert "[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC)."
This reverts commit r330068. It breaks the lldb bots due to assertion
failures (more details on cfe-commits).
http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/
http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/6341/
stderr: Assertion failed: (M && "imported decl from no module file"), function loadPendingDeclChain, file /Users/vsk/src/llvm.org-lldbsan/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp, line 3861.
llvm-svn: 330080
Heejin Ahn [Sat, 14 Apr 2018 00:12:12 +0000 (00:12 +0000)]
[WebAssembly] Fix a bug in MachineBasicBlock::findDebugLoc() call
Summary:
InsertPos is within the bacic block `Header`, so `findDebugLoc()` should
be called on not `MBB` but `Header` instead.
Reviewers: yurydelendik
Subscribers: jfb, dschuff, aprantl, sbc100, jgravelle-google, sunfish, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D45648
llvm-svn: 330079
Craig Topper [Fri, 13 Apr 2018 23:57:54 +0000 (23:57 +0000)]
[X86] Add the bizarro movsww and movzww mnemonics for the disassembler.
The destination size of the movzx/movsx instruction is controlled by the normal operand size mechanisms. Only the input type is fixed.
This means that a 0x66 prefix on the encoding for zext/sext 16->32 should really produce a 16->16 instruction. Functionally this is equivalent to a GR16->GR16 move since bits 16 and above will be preserved. So nothing is actually extended.
llvm-svn: 330078
Vedant Kumar [Fri, 13 Apr 2018 23:43:59 +0000 (23:43 +0000)]
[Driver] Export profiling symbols for -exported_symbols_list
When profiling is enabled and -exported_symbols_list is specified for
the Darwin linker, export the requisite set of profiling symbols.
rdar://
39427167
llvm-svn: 330077
Petr Hosek [Fri, 13 Apr 2018 23:05:14 +0000 (23:05 +0000)]
[Fuzzer] Avoid C++ compiler checks for fuzzer C++ library
When bulding libFuzzer as part of the toolchain, C++ library may not
have been fully built yet so the C++ compiler checks will fail, but we
don't care since we don't need C++ library anyway as we're building
our own.
Differential Revision: https://reviews.llvm.org/D45638
llvm-svn: 330075
Richard Trieu [Fri, 13 Apr 2018 22:34:43 +0000 (22:34 +0000)]
[ODRHash] Support pointer and reference types.
Recommit r328404 which was reverted in rL328404. r329869 fixed the issue that
caused the revert.
llvm-svn: 330074
Tim Northover [Fri, 13 Apr 2018 22:25:20 +0000 (22:25 +0000)]
MachO: trap unreachable instructions
Debugability is more important than saving 4 bytes to let us to fall
through to nonense.
llvm-svn: 330073
Roman Lebedev [Fri, 13 Apr 2018 21:57:01 +0000 (21:57 +0000)]
[InstCombine][NFC] masked-merge: add 'and' tests, too.
(and plain 'or', for completeness sake.)
After submitting D45631, i have realized that it will *already*
affect 'and' pattern, and it was obvious that there were no
good test patterns to show that.
Since the masked-merge.ll is getting kinda big,
unify naming schemes a bit, and split into 'xor'/'and'/'or'
testfiles, with the only difference being the last operation.
llvm-svn: 330072
Davide Italiano [Fri, 13 Apr 2018 21:26:32 +0000 (21:26 +0000)]
Revert "[debugserver] Remove dead function call. NFCI."
This reverts commit r330066 as it was wrong and the call was
not dead. Thanks to Fred for pointing this out.
llvm-svn: 330071
Roman Tereshin [Fri, 13 Apr 2018 21:23:11 +0000 (21:23 +0000)]
[DebugInfo][OPT] NFC follow-up on "Fixing a couple of DI duplication bugs of CloneModule"
llvm-svn: 330070
Roman Tereshin [Fri, 13 Apr 2018 21:22:24 +0000 (21:22 +0000)]
[DebugInfo][OPT] Fixing a couple of DI duplication bugs of CloneModule
As demonstrated by the regression tests added in this patch, the
following cases are valid cases:
1. A Function with no DISubprogram attached, but various debug info
related to its instructions, coming, for instance, from an inlined
function, also defined somewhere else in the same module;
2. ... or coming exclusively from the functions inlined and eliminated
from the module entirely.
The ValueMap shared between CloneFunctionInto calls within CloneModule
needs to contain identity mappings for all of the DISubprogram's to
prevent them from being duplicated by MapMetadata / RemapInstruction
calls, this is achieved via DebugInfoFinder collecting all the
DISubprogram's. However, CloneFunctionInto was missing calls into
DebugInfoFinder for functions w/o DISubprogram's attached, but still
referring DISubprogram's from within (case 1). This patch fixes that.
The fix above, however, exposes another issue: if a module contains a
DISubprogram referenced only indirectly from other debug info
metadata, but not attached to any Function defined within the module
(case 2), cloning such a module causes a DICompileUnit duplication: it
will be moved in indirecty via a DISubprogram by DebugInfoFinder first
(because of the first bug fix described above), without being
self-mapped within the shared ValueMap, and then will be copied during
named metadata cloning. So this patch makes sure DebugInfoFinder
visits DICompileUnit's referenced from DISubprogram's as it goes w/o
re-processing llvm.dbg.cu list over and over again for every function
cloned, and makes sure that CloneFunctionInto self-maps
DICompileUnit's referenced from the entire function, not just its own
DISubprogram attached that may also be missing.
The most convenient way of tesing CloneModule I found is to rely on
CloneModule call from `opt -run-twice`, instead of writing tedious
unit tests. That feature has a couple of properties that makes it hard
to use for this purpose though:
1. CloneModule doesn't copy source filename, making `opt -run-twice`
report it as a difference.
2. `opt -run-twice` does the second run on the original module, not
its clone, making the result of cloning completely invisible in opt's
actual output with and without `-run-twice` both, which directly
contradicts `opt -run-twice`s own error message.
This patch fixes this as well.
Reviewed By: aprantl
Reviewers: loladiro, GorNishanov, espindola, echristo, dexonsmith
Subscribers: vsk, debug-info, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D45593
llvm-svn: 330069
Eugene Zelenko [Fri, 13 Apr 2018 21:12:33 +0000 (21:12 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 330068
Rui Ueyama [Fri, 13 Apr 2018 20:57:57 +0000 (20:57 +0000)]
Use InitLLVM in clang as well.
Differential Revision: https://reviews.llvm.org/D45634
llvm-svn: 330067
Davide Italiano [Fri, 13 Apr 2018 20:47:25 +0000 (20:47 +0000)]
[debugserver] Remove dead function call. NFCI.
llvm-svn: 330066
Krzysztof Parzyszek [Fri, 13 Apr 2018 20:46:50 +0000 (20:46 +0000)]
[Hexagon] Initial instruction cost model for auto-vectorization
llvm-svn: 330065
Adam Balogh [Fri, 13 Apr 2018 20:23:02 +0000 (20:23 +0000)]
[Analyzer] Fix for SValBuilder expressions rearrangement
Expression rearrangement in SValBuilder (see rL329780) crashes with an assert if the type of the integer is different from the type of the symbol. This fix adds a check that prevents rearrangement in such cases.
Differential Revision: https://reviews.llvm.org/D45557
llvm-svn: 330064
Peter Collingbourne [Fri, 13 Apr 2018 20:21:00 +0000 (20:21 +0000)]
Revert r329956, "AArch64: Introduce a DAG combine for folding offsets into addresses."
Caused a hang and eventually an assertion failure in LTO builds
of 7zip-benchmark on aarch64 iOS targets.
http://green.lab.llvm.org/green/job/lnt-ctmark-aarch64-O3-flto/2024/
llvm-svn: 330063
Krzysztof Parzyszek [Fri, 13 Apr 2018 20:16:32 +0000 (20:16 +0000)]
[LV] Introduce TTI::getMinimumVF
The function getMinimumVF(ElemWidth) will return the minimum VF for
a vector with elements of size ElemWidth bits. This value will only
apply to targets for which TTI::shouldMaximizeVectorBandwidth returns
true. The value of 0 indicates that there is no minimum VF.
Differential Revision: https://reviews.llvm.org/D45271
llvm-svn: 330062
Mandeep Singh Grang [Fri, 13 Apr 2018 19:50:51 +0000 (19:50 +0000)]
[DebugInfo] Change std::sort to llvm::sort in response to r327219
r327219 added wrappers to std::sort which randomly shuffle the container before
sorting. This will help in uncovering non-determinism caused due to undefined
sorting order of objects having the same key.
To make use of that infrastructure we need to invoke llvm::sort instead of
std::sort.
Note: This patch is one of a series of patches to replace *all* std::sort to
llvm::sort. Refer the comments section in D44363 for a list of all the
required patches.
llvm-svn: 330061
Stefan Pintilie [Fri, 13 Apr 2018 19:49:58 +0000 (19:49 +0000)]
[Power9] Add the TLS store instructions to the Power 9 model
The Power 9 scheduler model should now include the TLS instructions.
We can now, once again, mark the model as complete.
From now on, if instructions are added to Power 9 but are not
added to the model the build should produce an error. Hopefully
that will alert the developer who is adding new instructions
that they should also be added to the scheulder model.
llvm-svn: 330060
Mandeep Singh Grang [Fri, 13 Apr 2018 19:47:57 +0000 (19:47 +0000)]
[Transforms] Change std::sort to llvm::sort in response to r327219
Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.
To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.
Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.
Reviewers: kcc, pcc, danielcdh, jmolloy, sanjoy, dberlin, ruiu
Reviewed By: ruiu
Subscribers: ruiu, llvm-commits
Differential Revision: https://reviews.llvm.org/D45142
llvm-svn: 330059
Mandeep Singh Grang [Fri, 13 Apr 2018 19:47:01 +0000 (19:47 +0000)]
[MC] Change std::sort to llvm::sort in response to r327219
Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.
To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.
Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.
Reviewers: grosbach, void, ruiu
Reviewed By: ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45138
llvm-svn: 330058
Mandeep Singh Grang [Fri, 13 Apr 2018 19:46:36 +0000 (19:46 +0000)]
[ProfileData] Change std::sort to llvm::sort in response to r327219
Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.
To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.
Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.
Reviewers: bogner, vsk, eraman, ruiu
Reviewed By: ruiu
Subscribers: ruiu, llvm-commits
Differential Revision: https://reviews.llvm.org/D45139
llvm-svn: 330057
Simon Pilgrim [Fri, 13 Apr 2018 19:30:15 +0000 (19:30 +0000)]
[CostModel][X86] Add some specific cpu targets to the cost models
We're mostly testing with generic isa attributes, but PR36550 will require testing of specific target's scheduler models as well.
llvm-svn: 330056