Craig Topper [Tue, 26 Sep 2017 16:43:57 +0000 (16:43 +0000)]
[X86] Add support for v16i32 UMUL_LOHI/SMUL_LOHI
Summary: This patch extends the v8i32/v4i32 custom lowering to support v16i32
Reviewers: zvi, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38274
llvm-svn: 314221
Alexey Bataev [Tue, 26 Sep 2017 16:19:04 +0000 (16:19 +0000)]
[OPENMP] Fix handling of implicit mapping of array sections.
llvm-svn: 314220
Francis Ricci [Tue, 26 Sep 2017 16:12:56 +0000 (16:12 +0000)]
Invalidate symbolizer module list from dlopen/dlclose interceptors
Summary:
The module list should only be invalidated by dlopen and dlclose,
so the symbolizer should only re-generate it when we've hit one of those functions.
Reviewers: kubamracek, rnk, vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37268
llvm-svn: 314219
Artem Dergachev [Tue, 26 Sep 2017 15:49:53 +0000 (15:49 +0000)]
[analyzer] Keep track of design discusions as part of analyzer documentation.
Create a directory to store discussions on potentially useful features that are
not yet implemented in the analyzer.
Fill it with a discussion on representing checker-specific parts of the program
state for C++ object modeling, that occured in D35216.
Differential Revision: https://reviews.llvm.org/D36737
llvm-svn: 314218
Gheorghe-Teodor Bercea [Tue, 26 Sep 2017 15:36:20 +0000 (15:36 +0000)]
[OpenMP] Don't throw cudalib not found error if only front-end is required.
Summary: If we only use the compiler front-end, do not throw an error about the cuda device library not being found. This allows the front-end to be run on systems where no Cuda installation is found.
Reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, tra
Reviewed By: tra
Subscribers: hfinkel, tra, cfe-commits
Differential Revision: https://reviews.llvm.org/D37914
llvm-svn: 314217
Krzysztof Parzyszek [Tue, 26 Sep 2017 15:31:15 +0000 (15:31 +0000)]
[Hexagon] Fix a typo: #ifndef DEBUG -> #ifndef NDEBUG
llvm-svn: 314216
Gheorghe-Teodor Bercea [Tue, 26 Sep 2017 15:24:34 +0000 (15:24 +0000)]
Revert commit 314210.
llvm-svn: 314215
Krzysztof Parzyszek [Tue, 26 Sep 2017 15:06:37 +0000 (15:06 +0000)]
[Hexagon] Fix initialization of HexagonSubtarget
Make sure that "initializeSubtargetDependencies" sets all members that
InstrInfo and the like may depend on.
llvm-svn: 314214
Simon Dardis [Tue, 26 Sep 2017 15:01:21 +0000 (15:01 +0000)]
[mips] Accept but ignore -m(no-)branch-likely
-mbranch-likely and -mno-branch-likely are used in some build systems for
some MIPS targets. Accept these options but ignore them as they are an
(de)optimiztion hint, and that branch likely instructions were deprecated
but not removed from MIPS32 and MIPS64 ISAs.
Reviewers: atanasyan, nitesh.jain
Differential Revision: https://reviews.llvm.org/D38168
llvm-svn: 314213
Tobias Grosser [Tue, 26 Sep 2017 15:00:10 +0000 (15:00 +0000)]
[ScopInfo] Allow PHI nodes that reference an error block
As long as these PHI nodes are only referenced by terminator instructions.
llvm-svn: 314212
Krasimir Georgiev [Tue, 26 Sep 2017 14:58:29 +0000 (14:58 +0000)]
[clang-format] Add ext/ to google include categories
Summary: This adds an ext/ header include category for google style.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D38243
llvm-svn: 314211
Gheorghe-Teodor Bercea [Tue, 26 Sep 2017 14:56:50 +0000 (14:56 +0000)]
[OpenMP] Add an additional test for D34888
Summary: Test for checking if the mapping is performed correctly. This is a test initially included in Patch https://reviews.llvm.org/D29905
Reviewers: Hahnfeld, carlo.bertolli, caomhin
Reviewed By: Hahnfeld
Subscribers: tra, cfe-commits
Differential Revision: https://reviews.llvm.org/D38040
llvm-svn: 314210
Ivan A. Kosarev [Tue, 26 Sep 2017 14:22:48 +0000 (14:22 +0000)]
Fix TBAA information for reference accesses
This patch fixes clang to decorate reference accesses as pointers
and not as "omnipotent chars".
Differential Revision: https://reviews.llvm.org/D38074
llvm-svn: 314209
Jonas Devlieghere [Tue, 26 Sep 2017 14:22:35 +0000 (14:22 +0000)]
[dwarfdump] Skip 'stripped' sections
When dsymutil generates the companion file, its strips all unnecessary
sections by omitting their body and setting the offset in their
corresponding load command to zero.
One such section is the .eh_frame section, as it contains runtime
information rather than debug information and is part of the __TEXT
segment. When reading this section, we would just read the number of
bytes specified in the load command, starting from offset 0 (i.e. the
beginning of the file).
Rather than trying to parse this obviously invalid section, dwarfdump
now skips this.
Differential revision: https://reviews.llvm.org/D38135
llvm-svn: 314208
Simon Pilgrim [Tue, 26 Sep 2017 14:12:50 +0000 (14:12 +0000)]
[X86][XOP] Merge rotation opcodes with AVX512 equivalents. NFCI.
The XOP rotations act as ROTL with +ve values and ROTR with -ve values, which means that we can treat them all as ROTL with unsigned modulo. We already check that we're only trying to lower as ROTL for XOP rotations.
Differential Revision: https://reviews.llvm.org/D37949
llvm-svn: 314207
Sanjay Patel [Tue, 26 Sep 2017 13:54:28 +0000 (13:54 +0000)]
[DSE] Merge stores when the later store only writes to memory locations the early store also wrote to (2nd try)
This is a 2nd attempt at:
https://reviews.llvm.org/rL310055
...which was reverted at rL310123 because of PR34074:
https://bugs.llvm.org/show_bug.cgi?id=34074
In this version, we break out of the inner loop after we successfully merge and kill a pair of stores. In the
earlier rev, we were continuing instead, which meant we could process the invalid info from a now dead store.
Original commit message (authored by Filipe Cabecinhas):
This fixes PR31777.
If both stores' values are ConstantInt, we merge the two stores
(shifting the smaller store appropriately) and replace the earlier (and
larger) store with an updated constant.
In the future we should also support vectors of integers. And maybe
float/double if we can.
Differential Revision: https://reviews.llvm.org/D30703
llvm-svn: 314206
Alexey Bataev [Tue, 26 Sep 2017 13:47:31 +0000 (13:47 +0000)]
[OPENMP] Generate implicit map|firstprivate clauses for target-based
directives.
If the variable is used in the target-based region but is not found in
any private|mapping clause, then generate implicit firstprivate|map
clauses for these implicitly mapped variables.
llvm-svn: 314205
George Rimar [Tue, 26 Sep 2017 13:35:00 +0000 (13:35 +0000)]
[ELF] - Remove wrong comment from testcase.
It was introduced by me in D37059.
Comment was saying that Weak binding is incorrect
for 'foo' symbol and that should be true for symbol in final output.
But at that place LTO temporarily file was checked,
where Weak binding for 'foo' is fine as LTO changes binding for
'LinkerRedefined' symbols internally to prevent IPO.
Binding for 'foo' in final output is correctly set to Global
and that tested just few lines below in the same testcase.
llvm-svn: 314204
Coby Tayree [Tue, 26 Sep 2017 13:28:05 +0000 (13:28 +0000)]
[x86] fix pr29061
https://bugs.llvm.org//show_bug.cgi?id=29061
Don't try referencing REX-needed regs when not on 64bit mode
Aligns to GCC
Differetial Revision: https://reviews.llvm.org/D37801
llvm-svn: 314203
Simon Pilgrim [Tue, 26 Sep 2017 12:59:01 +0000 (12:59 +0000)]
Tidyup P->getComplexPatternInfo call by moving it inside if( != NULL) test. NFCI.
llvm-svn: 314202
Sylvestre Ledru [Tue, 26 Sep 2017 11:56:43 +0000 (11:56 +0000)]
Don't move llvm.localescape outside the entry block in the GCOV profiling pass
Summary:
This fixes https://bugs.llvm.org/show_bug.cgi?id=34714.
Patch by Marco Castelluccio
Reviewers: rnk
Reviewed By: rnk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38224
llvm-svn: 314201
Simon Dardis [Tue, 26 Sep 2017 11:49:04 +0000 (11:49 +0000)]
[mips][asan] Fix preinstalled_signal.cc test for mips
Linux for mips has a non-standard layout for the kernel sigaction struct.
Adjust the layout by the minimally amount to get the test to pass, as we
don't require the usage of the restorer function.
llvm-svn: 314200
Benjamin Kramer [Tue, 26 Sep 2017 10:25:27 +0000 (10:25 +0000)]
Revert "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST."
Makes llc crash. This reverts commit r314151.
llvm-svn: 314199
Jonas Devlieghere [Tue, 26 Sep 2017 08:17:28 +0000 (08:17 +0000)]
[dsymutil] Better support for symbol aliases
This patch adds logic to follow a symbol's aliases when the symbol name
cannot be found in the current object file. It checks the main binary
for the symbol's address and queries the current object for its aliases
(symbols with the same address) before printing out a warning.
Differential revision: https://reviews.llvm.org/D38230
llvm-svn: 314198
Martin Storsjo [Tue, 26 Sep 2017 08:07:26 +0000 (08:07 +0000)]
Skip building unused parts when targeting SJLJ
When SJLJ exceptions are used, those functions aren't used.
This fixes build failures on ARM with SJLJ enabled (e.g. on armv7/iOS)
when built using the CMake project files.
Differential Revision: https://reviews.llvm.org/D38249
llvm-svn: 314197
Martin Storsjo [Tue, 26 Sep 2017 08:07:17 +0000 (08:07 +0000)]
Correct data types in the _Unwind_FunctionContext struct
This makes it match the definition used within llvm and in libgcc,
we previously got the wrong layout in 64 bit environments.
Differential Revision: https://reviews.llvm.org/D38247
llvm-svn: 314196
Uriel Korach [Tue, 26 Sep 2017 07:39:39 +0000 (07:39 +0000)]
[X86] Finishing broadcastf32x2 and broadcasti32x2 intrinsics lowering to IR. llvm side.
Removing X86 broadcast(f/i)32x2 intrinsics from llvm.
Adding autoUpgrade support.
Moving matching tests from avx512dq-intrinsics.ll to avx512dq-intrinsics-upgrade.ll and from avx512dqvl-intrinsics.ll to avx512dqvl-intrinsics-upgrade.ll.
Differential Revision: https://reviews.llvm.org/D38220
llvm-svn: 314195
Dean Michael Berris [Tue, 26 Sep 2017 04:29:25 +0000 (04:29 +0000)]
[XRay] Avoid actual linking when testing the driver
Use -### in the command to see just look for the output of -v.
Follow-up to D38226.
llvm-svn: 314194
Dean Michael Berris [Tue, 26 Sep 2017 04:17:37 +0000 (04:17 +0000)]
[XRay] Run command once without piping to FileCheck
This allows us to debug the failures that come up from the build bots.
Follow-up to D38226.
llvm-svn: 314193
Rui Ueyama [Tue, 26 Sep 2017 04:17:13 +0000 (04:17 +0000)]
Speed up SymbolTable::insert().
SymbolTable::insert() is a hot path function. When linking a clang debug
build, the function is called 3.7 million times. The total amount of "Name"
string contents is 300 MiB. That means this `Name.find("@@")` scans almost
300 MiB of data. That's far from negligible.
StringRef::find(StringRef) uses a sophisticated algorithm, but the
function is slow for a short needle. This patch replaces it with
StringRef::find(char).
This patch alone speeds up a clang debug build link time by 0.5 seconds
from 8.2s to 7.7s. That's 6% speed up. It seems too good for this tiny
change, but looks like it's real.
llvm-svn: 314192
Dean Michael Berris [Tue, 26 Sep 2017 04:07:45 +0000 (04:07 +0000)]
[XRay] Only run shared tests when 'enable_shared' is true
Follow-up to D38226.
llvm-svn: 314191
Dean Michael Berris [Tue, 26 Sep 2017 04:00:41 +0000 (04:00 +0000)]
[XRay] Remove -fPIC from shared build test.
Follow-up to D38226.
llvm-svn: 314190
Dean Michael Berris [Tue, 26 Sep 2017 03:45:37 +0000 (03:45 +0000)]
[XRay] Stop running tests for 'amd64', and remove -fPIE from tests.
Follow-up to D38226.
llvm-svn: 314189
Dean Michael Berris [Tue, 26 Sep 2017 03:18:11 +0000 (03:18 +0000)]
[XRay][Driver] Do not link in XRay runtime in shared libs
Summary:
This change ensures that we don't link in the XRay runtime when building
shared libraries with clang. This doesn't prevent us from building
shared libraris tht have XRay instrumentation sleds, but it does prevent
us from linking in the static XRay runtime into a shared library.
The XRay runtime currently doesn't support dynamic registration of
instrumentation sleds in shared objects, which we'll start enabling in
the future. That work has to happen in the back-end and in the runtime.
Reviewers: rnk, pelikan
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38226
llvm-svn: 314188
Matthias Braun [Tue, 26 Sep 2017 02:37:23 +0000 (02:37 +0000)]
CodeGenModule: Adapt to LLVM TargetLibraryInfo changes
Adapt to LLVM TargetLibraryInfo changes in r314185.
See also https://reviews.llvm.org/D38106 and https://reviews.llvm.org/D37891
llvm-svn: 314187
Matthias Braun [Tue, 26 Sep 2017 02:36:58 +0000 (02:36 +0000)]
CMake: Add option to set LLVM_ENABLE_DUMP
Differential Revision: https://reviews.llvm.org/D38267
llvm-svn: 314186
Matthias Braun [Tue, 26 Sep 2017 02:36:57 +0000 (02:36 +0000)]
TargetLibraryInfo: Stop guessing wchar_t size
Usually the frontend communicates the size of wchar_t via metadata and
we can optimize wcslen (and possibly other calls in the future). In
cases without the wchar_size metadata we would previously try to guess
the correct size based on the target triple; however this is fragile to
keep up to date and may miss users manually changing the size via flags.
Better be safe and stop guessing and optimizing if the frontend didn't
communicate the size.
Differential Revision: https://reviews.llvm.org/D38106
llvm-svn: 314185
Dylan McKay [Tue, 26 Sep 2017 02:07:54 +0000 (02:07 +0000)]
[AVR] Fix the build after setting alignment to 1 in r314179
Changing all types to be byte-aligned broke a small number of tests.
llvm-svn: 314183
Dylan McKay [Tue, 26 Sep 2017 01:37:53 +0000 (01:37 +0000)]
[AVR] Prefer BasicBlock::getIterator over Function::begin()
Thanks to Eli Friedman for the suggestion.
llvm-svn: 314182
Rui Ueyama [Tue, 26 Sep 2017 00:54:24 +0000 (00:54 +0000)]
Split MergeSyntheticSection into Merge{Tail,NoTail}Section.
This patch alone is neutral in terms of code readability, but this
change makes a following patch easier to read.
llvm-svn: 314181
Dylan McKay [Tue, 26 Sep 2017 00:51:03 +0000 (00:51 +0000)]
[AVR] When lowering shifts into loops, put newly generated MBBs in the same
spot as the original MBB
Discovered in avr-rust/rust#62
https://github.com/avr-rust/rust/issues/62
Patch by Gergo Erdi.
llvm-svn: 314180
Dylan McKay [Tue, 26 Sep 2017 00:45:27 +0000 (00:45 +0000)]
[AVR] Use 1-byte alignment for all data types
This was an oversight in the original backend data layout.
The AVR architecture does not have the concept of unaligned loads - all
loads/stores from all addresses are aligned to one byte.
Discovered in avr-rust issue #64
https://github.com/avr-rust/rust/issues/64
Patch By Gergo Erdi.
llvm-svn: 314179
Dean Michael Berris [Tue, 26 Sep 2017 00:41:08 +0000 (00:41 +0000)]
Revert "[XRay][Driver] Do not link in XRay runtime in shared libs"
Reverts r314177.
llvm-svn: 314178
Dean Michael Berris [Mon, 25 Sep 2017 23:40:33 +0000 (23:40 +0000)]
[XRay][Driver] Do not link in XRay runtime in shared libs
Summary:
This change ensures that we don't link in the XRay runtime when building
shared libraries with clang. This doesn't prevent us from building
shared libraris tht have XRay instrumentation sleds, but it does prevent
us from linking in the static XRay runtime into a shared library.
The XRay runtime currently doesn't support dynamic registration of
instrumentation sleds in shared objects, which we'll start enabling in
the future. That work has to happen in the back-end and in the runtime.
Reviewers: rnk, pelikan
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38226
llvm-svn: 314177
Vedant Kumar [Mon, 25 Sep 2017 23:10:04 +0000 (23:10 +0000)]
[docs] llvm-cov: Make docs for boolean options more consistent
llvm-svn: 314176
Vedant Kumar [Mon, 25 Sep 2017 23:10:03 +0000 (23:10 +0000)]
[llvm-cov] Warn if -show-functions is used without query files
llvm-cov's report mode does not print any output when -show-functions is
specified and no source files are specified. This can be surprising, so
the tool should at least print out an error message when this happens.
rdar://problem/
34636859
llvm-svn: 314175
Adrian Prantl [Mon, 25 Sep 2017 22:51:26 +0000 (22:51 +0000)]
Modernize comments
llvm-svn: 314174
Adrian Prantl [Mon, 25 Sep 2017 22:51:15 +0000 (22:51 +0000)]
Modernize comments
llvm-svn: 314173
Nico Weber [Mon, 25 Sep 2017 22:42:49 +0000 (22:42 +0000)]
clang-format/java: Always put space after `assert` keyword.
Previously, it was missing if the expression after the assert started with a (.
llvm-svn: 314172
Vlad Tsyrklevich [Mon, 25 Sep 2017 22:11:12 +0000 (22:11 +0000)]
Allow specifying sanitizers in blacklists
Summary:
This is the follow-up patch to D37924.
This change refactors clang to use the the newly added section headers
in SpecialCaseList to specify which sanitizers blacklists entries
should apply to, like so:
[cfi-vcall]
fun:*bad_vcall*
[cfi-derived-cast|cfi-unrelated-cast]
fun:*bad_cast*
The SanitizerSpecialCaseList class has been added to allow querying by
SanitizerMask, and SanitizerBlacklist and its downstream users have been
updated to provide that information. Old blacklists not using sections
will continue to function identically since the blacklist entries will
be placed into a '[*]' section by default matching against all
sanitizers.
Reviewers: pcc, kcc, eugenis, vsk
Reviewed By: eugenis
Subscribers: dberris, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D37925
llvm-svn: 314171
Vlad Tsyrklevich [Mon, 25 Sep 2017 22:11:11 +0000 (22:11 +0000)]
Add section headers to SpecialCaseLists
Summary:
Sanitizer blacklist entries currently apply to all sanitizers--there
is no way to specify that an entry should only apply to a specific
sanitizer. This is important for Control Flow Integrity since there are
several different CFI modes that can be enabled at once. For maximum
security, CFI blacklist entries should be scoped to only the specific
CFI mode(s) that entry applies to.
Adding section headers to SpecialCaseLists allows users to specify more
information about list entries, like sanitizer names or other metadata,
like so:
[section1]
fun:*fun1*
[section2|section3]
fun:*fun23*
The section headers are regular expressions. For backwards compatbility,
blacklist entries entered before a section header are put into the '[*]'
section so that blacklists without sections retain the same behavior.
SpecialCaseList has been modified to also accept a section name when
matching against the blacklist. It has also been modified so the
follow-up change to clang can define a derived class that allows
matching sections by SectionMask instead of by string.
Reviewers: pcc, kcc, eugenis, vsk
Reviewed By: eugenis, vsk
Subscribers: vitalybuka, llvm-commits
Differential Revision: https://reviews.llvm.org/D37924
llvm-svn: 314170
Eli Friedman [Mon, 25 Sep 2017 22:07:33 +0000 (22:07 +0000)]
Revert r312724 ("[ARM] Remove redundant vcvt patterns.").
It leads to some improvements, but also a regression for the simple
case, so it's not clearly a good idea.
test/CodeGen/ARM/vcvt.ll now has test coverage to show the difference.
Ultimately, the right solution is probably to custom-lower fp-to-int
conversions, to something like ARMISD::VCVT_F32_S32 plus a bitcast.
It's hard to do the right thing when the implicit bitcast isn't visible
to DAG transforms.
llvm-svn: 314169
Quentin Colombet [Mon, 25 Sep 2017 22:03:06 +0000 (22:03 +0000)]
[GlobalISel] Update the documentation and comment for G_[UN]MERGE_VALUES
In r296921, we added the G_[UN]MERGE_VALUES node, but did not update the
documentation. Fixing that.
NFC.
llvm-svn: 314168
Quentin Colombet [Mon, 25 Sep 2017 22:03:05 +0000 (22:03 +0000)]
[GlobalISel] Update the documentation for G_SEQUENCE
This instruction has been removed in r306120.
NFC.
llvm-svn: 314167
Quentin Colombet [Mon, 25 Sep 2017 22:03:01 +0000 (22:03 +0000)]
[GlobalISel] Update the documentation and comments for G_EXTRACT
In r297100, G_EXTRACT changed from a multiple results instruction to a
single result one. Update the documentation accordingly.
NFC.
llvm-svn: 314166
Saleem Abdulrasool [Mon, 25 Sep 2017 22:00:17 +0000 (22:00 +0000)]
X86: remove R12 from CSR on Windows x64 SwiftCC
R12 is used for the SwiftError parameter. It is no longer a CSR as it
is used for transfer the SwiftError, and the caller must preserve it if
they need to.
llvm-svn: 314165
Gheorghe-Teodor Bercea [Mon, 25 Sep 2017 21:56:32 +0000 (21:56 +0000)]
[OpenMP] Enable the existing nocudalib flag for OpenMP offloading toolchain.
Summary: Enable the -nocudalib flag for the OpenMP device offloading toolchain as well. Currently it can only be used for the CUDA toolchain.
Reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, hfinkel, tra
Reviewed By: tra
Subscribers: hfinkel, cfe-commits
Differential Revision: https://reviews.llvm.org/D37913
llvm-svn: 314164
Eli Friedman [Mon, 25 Sep 2017 21:55:27 +0000 (21:55 +0000)]
[ARM] Fix tests for vcvt+store to return void.
This is what I meant to do in r314161; I didn't realize I'd messed up
because the generated assembly is currently identical.
llvm-svn: 314163
Francis Ricci [Mon, 25 Sep 2017 21:51:04 +0000 (21:51 +0000)]
Add missing include to sanitizer procmaps
llvm-svn: 314162
Eli Friedman [Mon, 25 Sep 2017 21:37:52 +0000 (21:37 +0000)]
[ARM] Add tests for vcvt followed by store.
llvm-svn: 314161
Eli Friedman [Mon, 25 Sep 2017 21:34:29 +0000 (21:34 +0000)]
[ARM] Regenerate vcvt test checks.
llvm-svn: 314160
Sanjay Patel [Mon, 25 Sep 2017 21:31:08 +0000 (21:31 +0000)]
[x86] make assertions less strict in avx512f test file
Missed a line in r314158.
llvm-svn: 314159
Sanjay Patel [Mon, 25 Sep 2017 21:27:37 +0000 (21:27 +0000)]
[x86] make assertions less strict in avx512f test file
I'm not sure why yet, but there may be differences depending on the host?
llvm-svn: 314158
Francis Ricci [Mon, 25 Sep 2017 21:26:34 +0000 (21:26 +0000)]
Fix style in sanitizer_procmaps.h
llvm-svn: 314157
Gheorghe-Teodor Bercea [Mon, 25 Sep 2017 21:25:38 +0000 (21:25 +0000)]
[OpenMP] Bugfix: output file name drops the absolute path where full path is needed.
Summary: When composing the output file name, the path to the file is being dropped. The full path is required.
Reviewers: Hahnfeld, ABataev, caomhin, carlo.bertolli, hfinkel, tra
Reviewed By: tra
Subscribers: hfinkel, tra, cfe-commits
Differential Revision: https://reviews.llvm.org/D37912
llvm-svn: 314156
Jason Molenda [Mon, 25 Sep 2017 21:23:37 +0000 (21:23 +0000)]
Remove the details of the libstdc++ implementation that were
in TestDataFormatterSkipSummary.py - I'm building this test
with the default c++ library.
Skip TestMTCSimple.py when running for i386.
llvm-svn: 314155
Gheorghe-Teodor Bercea [Mon, 25 Sep 2017 21:22:49 +0000 (21:22 +0000)]
Revert commit with wrong message.
llvm-svn: 314154
Craig Topper [Mon, 25 Sep 2017 21:15:00 +0000 (21:15 +0000)]
[InstCombine] Move an optimization from foldICmpAndConstConst to foldICmpUsingKnownBits
All this optimization cares about is knowing how many low bits of LHS is known to be zero and whether that means that the result is 0 or greater than the RHS constant. It doesn't matter where the zeros in the low bits came from. So we don't need to specifically look for an AND. Instead we can use known bits.
Differential Revision: https://reviews.llvm.org/D38195
llvm-svn: 314153
Craig Topper [Mon, 25 Sep 2017 21:14:59 +0000 (21:14 +0000)]
[X86] Don't select anyext GR32->GR64 to SUBREG_TO_REG. Use INSERT_SUBREG instead.
As far as I know SUBREG_TO_REG is stating that the upper bits are 0. But if we are just converting the GR32 with no checks, then we have no reason to say the upper bits are 0.
I don't really know how to test this today since I can't find anything that looks that closely at SUBREG_TO_REG. The test changes here seems to be some perturbance of register allocation.
Differential Revision: https://reviews.llvm.org/D38001
llvm-svn: 314152
Craig Topper [Mon, 25 Sep 2017 21:14:55 +0000 (21:14 +0000)]
[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST.
llvm-svn: 314151
Gheorghe-Teodor Bercea [Mon, 25 Sep 2017 21:07:16 +0000 (21:07 +0000)]
[OpenMP] Don't throw cudalib not found error if only front-end is required.
Summary: If we only use the compiler front-end, do not throw an error about the cuda device library not being found. This allows the front-end to be run on systems where no Cuda installation is found.
Reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, tra
Reviewed By: tra
Subscribers: hfinkel, tra, cfe-commits
Differential Revision: https://reviews.llvm.org/D37914
llvm-svn: 314150
Francis Ricci [Mon, 25 Sep 2017 20:48:51 +0000 (20:48 +0000)]
[sanitizer_common] Don't provide sanitizer_procmaps API functions where not defined
Summary:
Platforms that don't implement procmaps (primarily fuchsia and windows) still expose
the procmaps API when including sanitizer_procmaps.h, despite not implementing the functions
provided by that header. Ensure that the API is only exposed on platforms that implement it.
Reviewers: vitalybuka, alekseyshl, kubamracek
Subscribers: llvm-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D38187
llvm-svn: 314149
Jake Ehrlich [Mon, 25 Sep 2017 20:37:28 +0000 (20:37 +0000)]
[llvm-objcopy] Refactor code to include initialize method
This change refactors some of the code to allow for some code
deduplication in later diffs as well as just to make adding a new
section type more self contained to the class itself. The idea for this
was first mentioned by James in D 37915 and will be used in that change
as recommended.
This change follows changes for dynamic sections but precedes support
for dynamic relocations.
Differential Revision: https://reviews.llvm.org/D38008
llvm-svn: 314148
Sanjay Patel [Mon, 25 Sep 2017 20:30:53 +0000 (20:30 +0000)]
[InstCombine] remove extract-of-select vector transform (2nd try)
The 1st attempt at this:
https://reviews.llvm.org/rL314117
was reverted at:
https://reviews.llvm.org/rL314118
because of bot fails for clang tests that were checking optimized IR. That should be fixed with:
https://reviews.llvm.org/rL314144
...so try again.
Original commit message:
The transform to convert an extract-of-a-select-of-vectors was added at:
https://reviews.llvm.org/rL194013
And a question about the validity of this transform was raised in the review:
https://reviews.llvm.org/D1539:
...but not answered AFAICT>
Most of the motivating cases in that patch are now handled by other combines. These are the tests that were added with
the original commit, but they are not regressing even after we remove the transform in this patch.
The diffs we see after removing this transform cause us to avoid increasing the instruction count, so we don't want to do
those transforms as canonicalizations.
The motivation for not turning a vector-select-of-vectors into a scalar operation is shown in PR33301:
https://bugs.llvm.org/show_bug.cgi?id=33301
...in those cases, we'll get vector ops with this patch rather than the vector/scalar mix that we currently see.
Differential Revision: https://reviews.llvm.org/D38006
llvm-svn: 314147
Tobias Grosser [Mon, 25 Sep 2017 20:27:15 +0000 (20:27 +0000)]
[ScopInfo] Allow invariant loads in branch conditions
In case the value used in a branch condition is a load instruction, assume this
load to be invariant.
llvm-svn: 314146
Wei Mi [Mon, 25 Sep 2017 19:57:59 +0000 (19:57 +0000)]
Reinstall the patch "Use EmitPointerWithAlignment to get alignment information of the pointer used in atomic expr" after fixing PR31620.
This is to fix PR34347. EmitAtomicExpr now only uses alignment information from
Type, instead of Decl, so when the declaration of an atomic variable is marked
to have the alignment equal as its size, EmitAtomicExpr doesn't know about it and
will generate libcall instead of atomic op. The patch uses EmitPointerWithAlignment
to get the precise alignment information.
Differential Revision: https://reviews.llvm.org/D37310
llvm-svn: 314145
Sanjay Patel [Mon, 25 Sep 2017 19:56:57 +0000 (19:56 +0000)]
[x86] remove RUNs that were checking fully optimized IR
Clang regression tests that depend on the optimizer can break
when there are changes to LLVM...as in:
https://reviews.llvm.org/rL314117
llvm-svn: 314144
Benjamin Kramer [Mon, 25 Sep 2017 19:42:20 +0000 (19:42 +0000)]
[Hexagon] Avoid unused variable warnings in Release builds.
No functionality change intended.
llvm-svn: 314143
Justin Lebar [Mon, 25 Sep 2017 19:41:56 +0000 (19:41 +0000)]
Revert "[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.", rL314135.
Causing assertion failures on macos:
> Assertion failed: (Num < NumOperands && "Invalid child # of SDNode!"),
> function getOperand, file
> /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm/include/llvm/CodeGen/SelectionDAGNodes.h,
> line 835.
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42739/testReport/LLVM/CodeGen_NVPTX/surf_read_cuda_ll/
llvm-svn: 314142
Alexander Shaposhnikov [Mon, 25 Sep 2017 19:32:33 +0000 (19:32 +0000)]
[analyzer] Fix crash on modeling of pointer arithmetic
This patch fixes analyzer's crash on the newly added test case
(see also https://bugs.llvm.org/show_bug.cgi?id=34374).
Pointers subtraction appears to be modeled incorrectly
in the following example:
char* p;
auto n = p - reinterpret_cast<char*>((unsigned long)1);
In this case the analyzer (built without this patch)
tries to create a symbolic value for the difference
treating reinterpret_cast<char*>((unsigned long)1)
as an integer, that is not correct.
Differential revision: https://reviews.llvm.org/D38214
Test plan: make check-all
llvm-svn: 314141
Konstantin Belochapka [Mon, 25 Sep 2017 19:26:48 +0000 (19:26 +0000)]
[X86] [ASM INTEL SYNTAX] fix for incorrect assembler code generation when x86-asm-syntax=intel (PR34617).
Fix for incorrect code generation when x86-asm-syntax=intel.
Differential Revision: https://reviews.llvm.org/D37945
llvm-svn: 314140
Craig Topper [Mon, 25 Sep 2017 19:26:08 +0000 (19:26 +0000)]
[SelectionDAG] Teach simplifyDemandedBits to handle shifts by constant splat vectors
This teach simplifyDemandedBits to handle constant splat vector shifts.
This required changing some uses of getZExtValue to getLimitedValue since we can't rely on legalization using getShiftAmountTy for the shift amount.
I believe there may have been a bug in the ((X << C1) >>u ShAmt) handling where we didn't check if the inner shift was too large. I've fixed that here.
I had to add new patterns to ARM because the zext/sext the patterns were trying to look for got turned into an any_extend with this patch. Happy to split that out too, but not sure how to test without this change.
Differential Revision: https://reviews.llvm.org/D37665
llvm-svn: 314139
Martin Storsjo [Mon, 25 Sep 2017 19:24:45 +0000 (19:24 +0000)]
[MinGW] Don't link -lmsvcrt if a different msvcrt version is to be linked
Differential Revision: https://reviews.llvm.org/D37530
llvm-svn: 314138
Alexey Bataev [Mon, 25 Sep 2017 19:12:59 +0000 (19:12 +0000)]
[SLP] Add a test for PR32086, NFC.
llvm-svn: 314137
Krzysztof Parzyszek [Mon, 25 Sep 2017 19:12:55 +0000 (19:12 +0000)]
[Hexagon] Better determination of register classes in bit tracker
Add two callbacks to MachineEvaluator, so that specific implementations
can specify more details about register classes:
- composeWithSubRegIndex(RC,Idx), to provide the register class for a
register from RC used in conjunction with a subregister index Idx.
- getPhysRegBitWidth(Reg), to provide the size in bits of the given
physical register.
llvm-svn: 314136
Artem Belevich [Mon, 25 Sep 2017 18:53:57 +0000 (18:53 +0000)]
[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.
Differential Revision: https://reviews.llvm.org/D38191
llvm-svn: 314135
Krzysztof Parzyszek [Mon, 25 Sep 2017 18:49:42 +0000 (18:49 +0000)]
[Hexagon] Make getHexagonSubRegIndex take reference instead of pointer
llvm-svn: 314134
Craig Topper [Mon, 25 Sep 2017 18:43:13 +0000 (18:43 +0000)]
[AVX-512] Replace large number of explicit patterns that check for insert_subvector with zero after masked compares with fewer patterns with predicate
This replaces the large number of patterns that handle every possible case of zeroing after a masked compare with a few simpler patterns that use a predicate to check for a masked compare producer.
This is similar to what we do for detecting free GR32->GR64 zero extends and free xmm->ymm/zmm zero extends.
This shrinks the isel table from ~590k to ~531k. This is a roughly 10% reduction in size.
Differential Revision: https://reviews.llvm.org/D38217
llvm-svn: 314133
Jason Molenda [Mon, 25 Sep 2017 18:19:39 +0000 (18:19 +0000)]
Initial patchset to get the testsuite running against armv7 and arm64 iOS devices.
Normal customer devices won't be able to run these tests, we're hoping to get
a public facing bot set up at some point. Both devices pass the testsuite without
any errors or failures.
I have seen some instability with the armv7 test runs, I may submit additional patches
to address this. arm64 looks good.
I'll be watching the bots for the rest of today; if any problems are introduced by
this patch I'll revert it - if anyone sees a problem with their bot that I don't
see, please do the same. I know it's a rather large patch.
One change I had to make specifically for iOS devices was that debugserver can't
create files. There were several tests that launch the inferior process redirecting
its output to a file, then they retrieve the file. They were not trying to test
file redirection in these tests, so I rewrote those to write their output to a file
directly.
llvm-svn: 314132
Hongbin Zheng [Mon, 25 Sep 2017 18:10:36 +0000 (18:10 +0000)]
[SimplifyIndvar] Minor change to refine r314125, NFC
llvm-svn: 314130
Artem Belevich [Mon, 25 Sep 2017 17:55:26 +0000 (17:55 +0000)]
[CUDA] Fix names of __nvvm_vote* intrinsics.
Also fixed a syntax error in activemask().
Differential Revision: https://reviews.llvm.org/D38188
llvm-svn: 314129
Arnold Schwaighofer [Mon, 25 Sep 2017 17:51:33 +0000 (17:51 +0000)]
ARM: One more fix for swifterror CSR set
We use a differently ordered CSR set if the frame pointer is pushed. Add a
matching ..._SwiftError version.
llvm-svn: 314128
Eugene Zemtsov [Mon, 25 Sep 2017 17:41:16 +0000 (17:41 +0000)]
Use socketpair on all Unix platforms
Using TCP sockets is insecure against local attackers, and possibly
against remote attackers too (some vulnerabilities may allow tricking a
browser to make a request to localhost). Use socketpair (which is immune
to such attacks) on all Unix platforms.
Patch by Demi Marie Obenour < demiobenour@gmail.com >
Differential Revision: https://reviews.llvm.org/D33213
llvm-svn: 314127
Rui Ueyama [Mon, 25 Sep 2017 17:40:21 +0000 (17:40 +0000)]
Use UINT64_MAX instead of implicitly-type-converted -1.
llvm-svn: 314126
Hongbin Zheng [Mon, 25 Sep 2017 17:39:40 +0000 (17:39 +0000)]
[SimplifyIndvar] Replace the srem used by IV if we can prove both of its operands are non-negative
Since now SCEV can handle 'urem', an 'urem' is a better canonical form than an 'srem' because it has well-defined behavior
This is a follow up of D34598
Differential Revision: https://reviews.llvm.org/D38072
llvm-svn: 314125
Yi Kong [Mon, 25 Sep 2017 17:36:54 +0000 (17:36 +0000)]
[Sema] Null check in BuildDeclarationNameExpr
Qualtype may point to null if we cannot infer its type yet.
Fixes PR33843
Differential Revision: https://reviews.llvm.org/D38158
llvm-svn: 314124
Benjamin Kramer [Mon, 25 Sep 2017 17:35:38 +0000 (17:35 +0000)]
[ARM] Fix -Wdangling-else warning.
A ternary is clearer here. No functionality change.
llvm-svn: 314123
Chris Bieneman [Mon, 25 Sep 2017 17:31:40 +0000 (17:31 +0000)]
Revert "Initial patchset to get the testsuite running against armv7 and arm64 iOS devices. Normal customer devices won't be able to run these devices, we're hoping to get a public facing bot set up at some point. Both devices pass the testsuite without any errors or failures."
This patch has been causing LLDB test failures on ObjC tests. A test log
may still be available here:
http://lab.llvm.org:8080/green/view/LLDB/job/lldb/1650/
This reverts commit r314038.
llvm-svn: 314122
Arnold Schwaighofer [Mon, 25 Sep 2017 17:19:50 +0000 (17:19 +0000)]
ARM: Use the proper swifterror CSR list on platforms other than darwin
Noticed by inspection
llvm-svn: 314121
Rui Ueyama [Mon, 25 Sep 2017 17:19:17 +0000 (17:19 +0000)]
Use a temporary varaible to improve readability. NFC.
llvm-svn: 314120