Quentin Colombet [Fri, 11 Mar 2016 17:27:38 +0000 (17:27 +0000)]
[GlobalISel][Target] Add an opcode for unconditional branch.
llvm-svn: 263259
Mehdi Amini [Fri, 11 Mar 2016 17:15:50 +0000 (17:15 +0000)]
Remove PreserveNames template parameter from IRBuilder
Summary:
Following r263086, we are now relying on a flag on the Context to
discard Value names in release builds.
Reviewers: chandlerc
Subscribers: mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D18023
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263258
Mehdi Amini [Fri, 11 Mar 2016 17:15:44 +0000 (17:15 +0000)]
Remove compile time PreserveName switch based on NDEBUG
Summary:
Following r263086, we are now relying on a flag on the Context to
discard Value names in release builds.
Reviewers: chandlerc
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18024
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263257
Mehdi Amini [Fri, 11 Mar 2016 17:15:34 +0000 (17:15 +0000)]
Do not specialize IRBuilder to strip names in SROA
Summary:
Following r263086, we are replacing this by a runtime check.
More cleanup will follow on the IRBuilder itself, but I submitted
this patch separately as SROA has a fancy "prefixInserter" class
that needs extra-love.
Reviewers: chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18022
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263256
Chad Rosier [Fri, 11 Mar 2016 16:54:07 +0000 (16:54 +0000)]
[misched] Fix a truncation issue from r263021.
The truncation was causing the sorting algorithm to behave oddly when comparing
positive and negative offsets. Fortunately, this doesn't currently happen in
practice and was exposed by a WIP. Thus, I can't test this change now, but the
follow on patch will.
llvm-svn: 263255
Rafael Espindola [Fri, 11 Mar 2016 16:41:23 +0000 (16:41 +0000)]
Yet more MSVC fixes.
llvm-svn: 263253
George Rimar [Fri, 11 Mar 2016 16:40:55 +0000 (16:40 +0000)]
[ELF] - Change all messages to lowercase to be consistent.
That is directly opposite to http://reviews.llvm.org/D18045,
which was reverted.
This patch changes all messages to start from lowercase letter if
they were not before.
That is done to be consistent with clang.
Differential revision: http://reviews.llvm.org/D18085
llvm-svn: 263252
Rafael Espindola [Fri, 11 Mar 2016 16:32:46 +0000 (16:32 +0000)]
More MSVC fixes.
llvm-svn: 263251
Chandler Carruth [Fri, 11 Mar 2016 16:25:19 +0000 (16:25 +0000)]
[PM] Sink the "Expression" type for GVN into the class as a private
member type.
Because of how this type is used by the ValueTable, it cannot actually
have hidden visibility. GCC actually nicely warns about this but Clang
just silently ... I don't even know. =/ We should do a better job either
way though.
This should resolve a bunch of the GCC warnings about visibility that
the port of GVN triggered and make the visibility story a bit more
correct.
llvm-svn: 263250
Rafael Espindola [Fri, 11 Mar 2016 16:23:45 +0000 (16:23 +0000)]
Trying to fix the MSVC build.
llvm-svn: 263249
Rafael Espindola [Fri, 11 Mar 2016 16:11:47 +0000 (16:11 +0000)]
Avoid calling getNamedValue.
In lld we usually avoid hash lookups. In addition to that, IR names are
not fully mangled, so it is best to avoid using them whenever possible.
llvm-svn: 263248
Marianne Mailhot-Sarrasin [Fri, 11 Mar 2016 15:59:32 +0000 (15:59 +0000)]
More UTF string conversion wrappers
Added new string conversion wrappers that convert between `std::string` (of UTF-8 bytes) and `std::wstring`, which is particularly useful for Win32 interop. Also fixed a missing string conversion for `getenv` on Win32, using these new wrappers.
The motivation behind this is to provide the support functions required for LLDB to work properly on Windows with non-ASCII data; however, the functions are not LLDB specific.
Patch by cameron314
Differential Revision: http://reviews.llvm.org/D17549
llvm-svn: 263247
Nico Weber [Fri, 11 Mar 2016 15:26:06 +0000 (15:26 +0000)]
Revert r263036, it's ABI-breaking.
llvm-svn: 263246
Alexandros Lamprineas [Fri, 11 Mar 2016 15:03:40 +0000 (15:03 +0000)]
Add tests for ARM Cortex-R8
Add command-line tests for ARM Cortex-R8 checking that the driver calls
clang -cc1 with the correct little-endian/big-endian, and ARM/Thumb triple.
Patch by Pablo Barrio <pablo.barrio@arm.com>
Differential Revision: http://reviews.llvm.org/D18052
llvm-svn: 263245
Rafael Espindola [Fri, 11 Mar 2016 14:57:33 +0000 (14:57 +0000)]
Don't invent names for STT_SECTION symbols.
We should just copy the symbol names with -r.
llvm-svn: 263244
Rafael Espindola [Fri, 11 Mar 2016 14:54:03 +0000 (14:54 +0000)]
Simplify test.
We only need one run of llmv-readobj.
llvm-svn: 263243
Valery Pykhtin [Fri, 11 Mar 2016 14:53:28 +0000 (14:53 +0000)]
[AMDGPU] Fix VOPC instruction operand namings
Differential Revision: http://reviews.llvm.org/D17966
llvm-svn: 263242
Rafael Espindola [Fri, 11 Mar 2016 14:46:41 +0000 (14:46 +0000)]
Simplify test. NFC.
llvm-svn: 263241
George Rimar [Fri, 11 Mar 2016 14:43:02 +0000 (14:43 +0000)]
This reverts the r263125
It was discussed to make all messages be
lowercase to be consistent with clang.
(also reverts the r263128 which fixed
build bot fail after r263125)
Original commit message:
[ELF] - Consistent spelling for error/warning messages
Previously error and warnings were not consistent in lld.
Some of them started from lowercase letter, others from
uppercase. Also there was one or two which had a dot at the end.
This patch changes all messages to start from uppercase letter if
they were not before.
Differential revision: http://reviews.llvm.org/D18045
llvm-svn: 263240
Simon Pilgrim [Fri, 11 Mar 2016 14:39:10 +0000 (14:39 +0000)]
[X86][AVX] Fixed issue where a long chain of shuffles could attempt to combine to a single (illegal) PSHUFB instruction.
Its not enough that we test for SSSE3 - that's only OK for 128-bit vectors - we also need to test for AVX2 / AVX512BW for 256/512 bit vector cases.
llvm-svn: 263239
Rafael Espindola [Fri, 11 Mar 2016 14:34:44 +0000 (14:34 +0000)]
Run dos2unix. NFC.
llvm-svn: 263238
Rafael Espindola [Fri, 11 Mar 2016 14:21:37 +0000 (14:21 +0000)]
Represent local symbols with DefinedRegular.
llvm-svn: 263237
Simon Atanasyan [Fri, 11 Mar 2016 13:57:53 +0000 (13:57 +0000)]
[ELF][MIPS] Update comment about creation local GOT entries for non-local symbols. NFC.
llvm-svn: 263236
Chandler Carruth [Fri, 11 Mar 2016 13:53:18 +0000 (13:53 +0000)]
[AA] Make BasicAA just require domtree.
This doesn't change how many times we construct domtrees in the normal
pipeline, and it removes fragility and instability where basic-aa may
not be run in time to see domtrees because they happen to be constructed
afterward.
This isn't quite as clean as the change to memdep because there is
a mode where basic-aa specifically runs without domtrees -- in the
hacking version used by function-attrs with the legacy pass manager.
llvm-svn: 263234
Marianne Mailhot-Sarrasin [Fri, 11 Mar 2016 13:50:10 +0000 (13:50 +0000)]
Fixed MemoryCache L1 cache flush
Use the same method to find the cache line as in Read().
Differential Revision: http://reviews.llvm.org/D18050
llvm-svn: 263233
Chandler Carruth [Fri, 11 Mar 2016 13:46:00 +0000 (13:46 +0000)]
[memdep] Just require domtree for memdep.
This doesn't cause us to construct dominator trees any more often in the
normal pipeline, and removes an entire mode of memdep that needed to be
reasoned about and maintained. Perhaps more importantly, it removes the
ability for the results of memdep to be different because of accidental
pass scheduling goofs or the order of evaluation of 'getResult' calls.
Essentially, 'getCachedResult', unless across IR-unit boundaries, is
extremely dangerous. We need to work much harder to avoid it (or its
analog in the old pass manager).
llvm-svn: 263232
Chandler Carruth [Fri, 11 Mar 2016 13:26:47 +0000 (13:26 +0000)]
[PM] The order of evaluation of these analyses is actually significant,
much to my horror, so use variables to fix it in place.
This terrifies me. Both basic-aa and memdep will provide more precise
information when the domtree and/or the loop info is available. Because
of this, if your pass (like GVN) requires domtree, and then queries
memdep or basic-aa, it will get more precise results. If it does this in
the other order, it gets less precise results.
All of the ideas I have for fixing this are, essentially, terrible. Here
I've just caused us to stop having unspecified behavior as different
implementations evaluate the order of these arguments differently. I'm
actually rather glad that they do, or the fragility of memdep and
basic-aa would have gone on unnoticed. I've left comments so we don't
immediately break this again. This should fix bots whose host compilers
evaluate the order of arguments differently from Clang.
llvm-svn: 263231
Rafael Espindola [Fri, 11 Mar 2016 13:17:15 +0000 (13:17 +0000)]
Remove a redundant cast.
llvm-svn: 263230
Vasileios Kalintiris [Fri, 11 Mar 2016 13:05:06 +0000 (13:05 +0000)]
[mips] MIPSR6 Instruction itineraries
Summary: Defines instruction itineraries for common MIPSR6 instructions.
Patch by Simon Dardis.
Reviewers: vkalintiris
Subscribers: MatzeB, dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D17198
llvm-svn: 263229
Rafael Espindola [Fri, 11 Mar 2016 13:04:28 +0000 (13:04 +0000)]
Simplify now that local symbols can use getVA.
It is really odd that Mips differentiates symbols that are born local
and those that become local because of hidden visibility. I don't know
enough mips to known if this is a bug or not.
llvm-svn: 263228
George Rimar [Fri, 11 Mar 2016 12:57:52 +0000 (12:57 +0000)]
[ELF] - Early continue in InputSectionBase<ELFT>::relocate(). NFC.
llvm-svn: 263227
George Rimar [Fri, 11 Mar 2016 12:53:17 +0000 (12:53 +0000)]
[ELF] - Evaluate addend earlier and use it instead getAddend() calls. NFC.
llvm-svn: 263226
Rafael Espindola [Fri, 11 Mar 2016 12:19:05 +0000 (12:19 +0000)]
Compute value of local symbol with getVA.
llvm-svn: 263225
Rafael Espindola [Fri, 11 Mar 2016 12:14:02 +0000 (12:14 +0000)]
Remember the input section of locals.
This is already a simplification, but will allow much more.
llvm-svn: 263224
Chandler Carruth [Fri, 11 Mar 2016 12:10:15 +0000 (12:10 +0000)]
[PM] Update Kaleidoscope with the new header file.
llvm-svn: 263223
Rafael Espindola [Fri, 11 Mar 2016 12:06:30 +0000 (12:06 +0000)]
Create a SymbolBody for locals.
pr26878 shows a case where locals have to be in the got.
llvm-svn: 263222
Haojian Wu [Fri, 11 Mar 2016 11:40:08 +0000 (11:40 +0000)]
[clang-tidy] Make 'modernize-use-nullptr' check ignores NULL marcos used in other macros.
Reviewers: bkramer, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17958
llvm-svn: 263221
Daniel Sanders [Fri, 11 Mar 2016 11:37:50 +0000 (11:37 +0000)]
[mips] Range check simm4.
Summary:
Reviewers: vkalintiris
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D16811
llvm-svn: 263220
Chandler Carruth [Fri, 11 Mar 2016 11:05:24 +0000 (11:05 +0000)]
[PM] Make the AnalysisManager parameter to run methods a reference.
This was originally a pointer to support pass managers which didn't use
AnalysisManagers. However, that doesn't realistically come up much and
the complexity of supporting it doesn't really make sense.
In fact, *many* parts of the pass manager were just assuming the pointer
was never null already. This at least makes it much more explicit and
clear.
llvm-svn: 263219
Mohit K. Bhakkad [Fri, 11 Mar 2016 10:51:03 +0000 (10:51 +0000)]
[Sanitizer][MIPS] internal lstat and fstat for mips64
Reviewers: dvyukov
Subscribers: jaydeep, sagar, llvm-commits
Differential Revision: http://reviews.llvm.org/D18078
llvm-svn: 263218
Chandler Carruth [Fri, 11 Mar 2016 10:33:22 +0000 (10:33 +0000)]
[PM] Rename the CRTP mixin base classes for the new pass manager to
clarify their purpose.
Firstly, call them "...Mixin" types so it is clear that there is no
type hierarchy being formed here. Secondly, use the term 'Info' to
clarify that they aren't adding any interesting *semantics* to the
passes or analyses, just exposing APIs used by the management layer to
get information about the pass or analysis.
Thanks to Manuel for helping pin down the naming confusion here and come
up with effective names to address it.
In case you already have some out-of-tree stuff, the following should be
roughly what you want to update:
perl -pi -e 's/\b(Pass|Analysis)Base\b/\1InfoMixin/g'
llvm-svn: 263217
Chandler Carruth [Fri, 11 Mar 2016 10:22:49 +0000 (10:22 +0000)]
[PM] Implement the final conclusion as to how the analysis IDs should
work in the face of the limitations of DLLs and templated static
variables.
This requires passes that use the AnalysisBase mixin provide a static
variable themselves. So as to keep their APIs clean, I've made these
private and befriended the CRTP base class (which is the common
practice).
I've added documentation to AnalysisBase for why this is necessary and
at what point we can go back to the much simpler system.
This is clearly a better pattern than the extern template as it caught
*numerous* places where the template magic hadn't been applied and
things were "just working" but would eventually have broken
mysteriously.
llvm-svn: 263216
Benjamin Kramer [Fri, 11 Mar 2016 10:20:56 +0000 (10:20 +0000)]
[InstCombine] Use Twines to generate names.
Since the names are used in a loop this does more work in debug builds. In
release builds value names are generally discarded so we don't have to do
the concatenation at all. It's also simpler code, no functional change
intended.
llvm-svn: 263215
George Rimar [Fri, 11 Mar 2016 10:07:18 +0000 (10:07 +0000)]
[ELF] - Move initSymbols() to Driver.cpp. NFC.
That is followup for http://reviews.llvm.org/D18047
patch. initSymbols() moved to Driver.cpp and made static.
llvm-svn: 263214
Ismail Donmez [Fri, 11 Mar 2016 09:55:06 +0000 (09:55 +0000)]
Fix linux build after r263190
llvm-svn: 263213
Nikolay Haustov [Fri, 11 Mar 2016 09:27:25 +0000 (09:27 +0000)]
[AMDGPU] Assembler: change v_madmk operands to have same order as mad.
The constant is now at source operand 1 (previously at 2).
This is also how it is in legacy AMD sp3 assembler.
Update tests.
Differential Revision: http://reviews.llvm.org/D17984
llvm-svn: 263212
Chandler Carruth [Fri, 11 Mar 2016 09:15:11 +0000 (09:15 +0000)]
[PM/AA] Teach the AAManager how to handle module analyses in addition to
function analyses, and use it to wire up globals-aa to the new pass
manager.
llvm-svn: 263211
Chandler Carruth [Fri, 11 Mar 2016 09:02:43 +0000 (09:02 +0000)]
Update to include the new header file providing createGVNPass.
llvm-svn: 263210
Pavel Labath [Fri, 11 Mar 2016 09:00:23 +0000 (09:00 +0000)]
Fix a bunch of signedness warnings in unittests
llvm-svn: 263209
Chandler Carruth [Fri, 11 Mar 2016 08:50:55 +0000 (08:50 +0000)]
[PM] Port GVN to the new pass manager, wire it up, and teach a couple of
tests to run GVN in both modes.
This is mostly the boring refactoring just like SROA and other complex
transformation passes. There is some trickiness in that GVN's
ValueNumber class requires hand holding to get to compile cleanly. I'm
open to suggestions about a better pattern there, but I tried several
before settling on this. I was trying to balance my desire to sink as
much implementation detail into the source file as possible without
introducing overly many layers of abstraction.
Much like with SROA, the design of this system is made somewhat more
cumbersome by the need to support both pass managers without duplicating
the significant state and logic of the pass. The same compromise is
struck here.
I've also left a FIXME in a doxygen comment as the GVN pass seems to
have pretty woeful documentation within it. I'd like to submit this with
the FIXME and let those more deeply familiar backfill the information
here now that we have a nice place in an interface to put that kind of
documentaiton.
Differential Revision: http://reviews.llvm.org/D18019
llvm-svn: 263208
Pavel Labath [Fri, 11 Mar 2016 08:44:44 +0000 (08:44 +0000)]
Fix a couple of cornercases in FileSpec + tests
Summary:
This fixes a couple of corner cases in FileSpec, related to AppendPathComponent and
handling of root directory (/) file spec. I add a bunch of unit tests for the new behavior.
Summary of changes:
FileSpec("/bar").GetCString(): before "//bar", after "/bar".
FileSpec("/").CopyByAppendingPathComponent("bar").GetCString(): before "//bar", after "/bar".
FileSpec("C:", ePathSyntaxWindows).CopyByAppendingPathComponent("bar").GetCString(): before "C:/bar", after "C:\bar".
Reviewers: clayborg, zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D18044
llvm-svn: 263207
Matt Arsenault [Fri, 11 Mar 2016 08:20:50 +0000 (08:20 +0000)]
AMDGPU: Don't use InstVisitor for AMDGPUPromoteAlloca
Frontend authors are strongly encouraged to keep allocas
in the entry block, so don't bother visiting every instruction
in the other blocks of the function.
llvm-svn: 263206
Todd Fiala [Fri, 11 Mar 2016 08:12:36 +0000 (08:12 +0000)]
skip newly segfaulting test on OS X public CI
llvm-svn: 263205
Matt Arsenault [Fri, 11 Mar 2016 08:00:27 +0000 (08:00 +0000)]
AMDGPU: R600 code splitting cleanup
Move a few functions only used by R600 to R600 specific code,
fix header macros to stop using R600, mark classes as final.
llvm-svn: 263204
Hrvoje Varga [Fri, 11 Mar 2016 08:00:11 +0000 (08:00 +0000)]
[mips] Invalid tests for MTC0, MTC2, MFC0, MFC2, DMTC0, DMFC0 MIPS instructions
Differential Revision: http://reviews.llvm.org/D18037
llvm-svn: 263203
Dmitry Polukhin [Fri, 11 Mar 2016 07:58:34 +0000 (07:58 +0000)]
[OpenMP] NFC fix compilation warning about unused variable
lib/Sema/SemaOpenMP.cpp:9243:13: warning: variable ‘IsRightMostExpression’ set but not used
llvm-svn: 263202
Matt Arsenault [Fri, 11 Mar 2016 07:42:49 +0000 (07:42 +0000)]
AMDGPU: Materialize sign bits with bfrev
If a constant is the same as the reverse of an inline immediate,
this is 4 bytes smaller than having to embed a 32-bit literal.
llvm-svn: 263201
Junmo Park [Fri, 11 Mar 2016 07:05:32 +0000 (07:05 +0000)]
Minor code cleanups. NFC.
llvm-svn: 263200
Mohit K. Bhakkad [Fri, 11 Mar 2016 05:57:20 +0000 (05:57 +0000)]
[Compiler-rt] Fix ioctl codes for MIPS in sanitizer_ioctl_test
Reviewers: samsonov
Subscribers: jaydeep, sagar, llvm-commits
Differential Revision: http://reviews.llvm.org/D17985
llvm-svn: 263199
Sean Silva [Fri, 11 Mar 2016 05:48:04 +0000 (05:48 +0000)]
Fix indentation.
Somehow this slipped by in r263197. Thanks to Rui for noticing.
llvm-svn: 263198
Sean Silva [Fri, 11 Mar 2016 05:42:34 +0000 (05:42 +0000)]
[lto] The previous testcase was not useful enough.
-shared was hiding the fact that the intrinsic wasn't being found.
llvm-svn: 263197
Junmo Park [Fri, 11 Mar 2016 05:07:07 +0000 (05:07 +0000)]
Minor code cleanup. NFC.
llvm-svn: 263196
Alexey Samsonov [Fri, 11 Mar 2016 05:04:49 +0000 (05:04 +0000)]
Fix ASan test cases after r263177
llvm-svn: 263195
John McCall [Fri, 11 Mar 2016 05:03:01 +0000 (05:03 +0000)]
Removing the friend declaration was not a good idea.
llvm-svn: 263194
John McCall [Fri, 11 Mar 2016 04:55:21 +0000 (04:55 +0000)]
Speculatively attempt to fix the MSVC build by making some
methods non-private.
llvm-svn: 263193
John McCall [Fri, 11 Mar 2016 04:30:43 +0000 (04:30 +0000)]
Add a coerce-and-expand ABIArgInfo as a generalization of some
of the things we do with Expand / Direct.
NFC for now, but this will be used by swiftcall expansion.
llvm-svn: 263192
John McCall [Fri, 11 Mar 2016 04:30:31 +0000 (04:30 +0000)]
Preserve ExtParameterInfos into CGFunctionInfo.
As part of this, make the function-arrangement interfaces
a little simpler and more semantic.
NFC.
llvm-svn: 263191
Rui Ueyama [Fri, 11 Mar 2016 04:23:12 +0000 (04:23 +0000)]
ELF: Add --thread option and partially parallelize writeTo().
This patch adds --thread option and use parallel_for_each to write
sections in regular OutputSections.
This is the first patch to use more than one threads.
Note that --thread is off by default because it is experimental.
At this moment I still want to focus on single thread performance
because multi-threading is not a magic wand to fix performance
problems after all. It is generally very hard to make a slow program
faster by threads. Therefore, I want to make the linker as efficient
as possible first and then look for opportunity to make it even faster
using more than one core.
Here are some numbers to link programs with and without --threads
and using GNU gold. Numbers are in seconds.
Clang
w/o --threads 0.697
w --threads 0.528
gold 1.643
Scylla
w/o --threads 5.032
w --threads 4.935
gold 6.791
GNU gold
w/o --threads 0.550
w --threads 0.551
gold 0.737
I limited the number of cores these processes can use to 4 using
perf command, so although my machine has 20 physical cores, the
performance gain I observed should be reproducible with a machine
which is not as beefy as mine.
llvm-svn: 263190
Pete Cooper [Fri, 11 Mar 2016 02:14:16 +0000 (02:14 +0000)]
Remove llvm::getDISubprogram in favor of Function::getSubprogram
llvm::getDISubprogram walks the instructions in a function, looking for one in the scope of the current function, so that it can find the !dbg entry for the subprogram itself.
Now that !dbg is attached to functions, this should not be necessary. This patch changes all uses to just query the subprogram directly on the function.
Ideally this should be NFC, but in reality its possible that a function:
has no !dbg (in which case there's likely a bug somewhere in an opt pass), or
that none of the instructions had a scope referencing the function, so we used to not find the !dbg on the function but now we will
Reviewed by Duncan Exon Smith.
Differential Revision: http://reviews.llvm.org/D18074
llvm-svn: 263184
Jim Ingham [Fri, 11 Mar 2016 01:57:45 +0000 (01:57 +0000)]
Fix SBDebugger.GetOutputFileHandle() on OS X.
The swig typemaps had some magic for output File *'s on OS X that made:
SBDebugger.GetOutputFileHandle()
actually work. That was protected by a "#ifdef __MACOSX__", but the corresponding define
got lost going from the Darwin shell scripts to the python scripts for running
swig, so the code was elided. I need to pass the define to SWIG, but only when
targetting Darwin.
So I added a target-platform argument to prepare_bindings, and if that
is Darwin, I pass -D__APPLE__ to swig, and that activates this code again, and
GetOutputFileHandle works again. Note, I only pass that argument for the Xcode
build. I'm sure it is possible to do that for cmake, but my cmake-foo is weak.
I should have been able to write a test for this by creating a debugger, setting the
output file handle to something file, writing to it, getting the output file handle
and reading it. But SetOutputFileHandle doesn't seem to work from Python, so I'd
have to write a pexpect test to test this, which I'd rather not do.
llvm-svn: 263183
Sean Silva [Fri, 11 Mar 2016 01:10:37 +0000 (01:10 +0000)]
[lto] Add a useful test case.
This is reduced from an issue found in practice.
The original version of D18012 needed another patch to handle this, but
it now works since we are using a more correct GV->hasAppendingLinkage()
check that Rafael suggested.
This is what remains of that other patch.
llvm-svn: 263181
Evgeniy Stepanov [Fri, 11 Mar 2016 00:51:57 +0000 (00:51 +0000)]
[gold] Fix common symbols handling.
LLVM Gold plugin decides which instance of a common symbol it wants
based on the symbol size in claim_file_hook. If the file that
contains the chosen instance is later dropped from the link, we end
up with an undefined reference.
This change delays this decision until the set of the included files
is known.
llvm-svn: 263180
Sean Silva [Fri, 11 Mar 2016 00:50:05 +0000 (00:50 +0000)]
[lto] Make sure that ctors are added to the combined module.
Summary:
More generally, appending linkage is a special case that we don't want
to create a SymbolBody for.
Reviewers: rafael, ruiu
Subscribers: Bigcheese, llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18012
llvm-svn: 263179
Sean Silva [Fri, 11 Mar 2016 00:48:36 +0000 (00:48 +0000)]
Tighten up this test a bit.
Thanks to Rafael to spotting this in the post-commit review of r263070.
llvm-svn: 263178
Alexey Samsonov [Fri, 11 Mar 2016 00:45:49 +0000 (00:45 +0000)]
[sanitizer] Add strlen to the common interceptors
Summary:
Adds strlen to the common interceptors, under a new common flag
intercept_strlen. This provides better sharing of interception code among
sanitizers and cleans up the inconsistent type declarations of the
previously duplicated interceptors.
Removes the now-duplicate strlen interceptor from asan, msan, and tsan.
The entry check semantics are normalized now for msan and asan, whose
private strlen interceptors contained multiple layers of checks that
included impossible-to-reach code. The new semantics are identical to the
old: bypass interception if in the middle of init or if both on Mac and not
initialized; else, call the init routine and proceed.
Patch by Derek Bruening!
Reviewers: samsonov, vitalybuka
Subscribers: llvm-commits, kcc, zhaoqin
Differential Revision: http://reviews.llvm.org/D18020
llvm-svn: 263177
Alexey Samsonov [Fri, 11 Mar 2016 00:37:02 +0000 (00:37 +0000)]
[UBSan] Improve bufferization of UBSan error reports.
Summary:
Use InternalScopedString more extensively. This reduces the number of
write() syscalls, and reduces the chance that UBSan output will be
mixed with program output.
Reviewers: vitalybuka
Subscribers: kcc, llvm-commits
Differential Revision: http://reviews.llvm.org/D18068
llvm-svn: 263176
Ekaterina Romanova [Fri, 11 Mar 2016 00:05:54 +0000 (00:05 +0000)]
Add doxygen comments to avxintrin.h's intrinsics.
Only around 25% of the intrinsics in this file are documented here. The patches for the other half will be sent out later.
The doxygen comments are automatically generated based on Sony's intrinsics document.
I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.
llvm-svn: 263175
Eugene Zelenko [Thu, 10 Mar 2016 23:57:12 +0000 (23:57 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263174
Adam Nemet [Thu, 10 Mar 2016 23:54:39 +0000 (23:54 +0000)]
[LLE] Add missed LoopSimplify dependence
The code assumed that we always had a preheader without making the pass
dependent on LoopSimplify.
Thanks to Mattias Eriksson V for reporting this.
llvm-svn: 263173
Manman Ren [Thu, 10 Mar 2016 23:54:12 +0000 (23:54 +0000)]
Print strict in Availability attribute when it is on.
llvm-svn: 263172
Manman Ren [Thu, 10 Mar 2016 23:51:03 +0000 (23:51 +0000)]
Add has_feature objc_class_property.
rdar://
23891898
llvm-svn: 263171
Jonathan Coe [Thu, 10 Mar 2016 23:29:45 +0000 (23:29 +0000)]
libclang python bindings: Fix for bug 26394
Summary:
https://llvm.org/bugs/show_bug.cgi?id=26394 reports that clang's python bindings tests are failing.
I can confirm that the bug exists and that the proposed fix is good.
Differential Revision: http://reviews.llvm.org/D17226
llvm-svn: 263170
Tim Northover [Thu, 10 Mar 2016 23:02:21 +0000 (23:02 +0000)]
AArch64: only try to use scaled fcvt ops on legal vector types.
Before we ended up calling getSimpleVectorType on a <3 x float>, which
asserted.
llvm-svn: 263169
Nico Weber [Thu, 10 Mar 2016 22:40:02 +0000 (22:40 +0000)]
Reenable asm-errors.c
r134811 made the test pass and reenabled it, but r134831
accidentally disabled it again due to a bad merge.
llvm-svn: 263168
Sanjay Patel [Thu, 10 Mar 2016 22:35:33 +0000 (22:35 +0000)]
[x86] don't use a shuffle when a vselect will do; NFCI
Looking at the IR definition of a masked load made me realize
there was no reason to use a shuffle here, so we don't need
to convert the format of the mask at all.
llvm-svn: 263167
Marianne Mailhot-Sarrasin [Thu, 10 Mar 2016 22:10:59 +0000 (22:10 +0000)]
Fixed ValueObject::GetExpressionPath() for paths including anonymous struct/union
When the parent of an expression is anonymous, skip adding '.' or '->' before the expression name.
Differential Revision: http://reviews.llvm.org/D18005
llvm-svn: 263166
Marianne Mailhot-Sarrasin [Thu, 10 Mar 2016 21:54:25 +0000 (21:54 +0000)]
Test commit access
llvm-svn: 263165
Simon Pilgrim [Thu, 10 Mar 2016 20:58:11 +0000 (20:58 +0000)]
Strip trailing whitespace.
llvm-svn: 263162
Greg Clayton [Thu, 10 Mar 2016 20:49:32 +0000 (20:49 +0000)]
Fixed the python interpreter so that it correctly inherits the top IOHandler's files instead of always using stdin/out/err.
Removed lldb_private::File::Duplicate() and the copy constructor and the assignment operator that used to duplicate the file handles and made them private so no one uses them. Previously the lldb_private::File::Duplicate() function duplicated files that used file descriptors, (int) but not file streams (FILE *), so the lldb_private::File::Duplicate() function only worked some of the time. No one else excep thee ScriptInterpreterPython was using these functions, so that aren't needed nor desired. Previously every time you would drop into the python interpreter we would duplicate files, and now we avoid this file churn.
<rdar://problem/
24877720>
llvm-svn: 263161
Reid Kleckner [Thu, 10 Mar 2016 20:47:26 +0000 (20:47 +0000)]
[Windows] Fix UnmapOrDie and MmapAlignedOrDie
Now ASan can return virtual memory to the underlying OS. Portable
sanitizer runtime code needs to be aware that UnmapOrDie cannot unmap
part of previous mapping.
In particular, this required changing how we implement MmapAlignedOrDie
on Windows, which is what Allocator32 uses.
The new code first attempts to allocate memory of the given size, and if
it is appropriately aligned, returns early. If not, it frees the memory
and attempts to reserve size + alignment bytes. In this region there
must be an aligned address. We then free the oversized mapping and
request a new mapping at the aligned address immediately after. However,
a thread could allocate that virtual address in between our free and
allocation, so we have to retry if that allocation fails. The existing
thread creation stress test managed to trigger this condition, so the
code isn't totally untested.
Reviewers: samsonov
Differential Revision: http://reviews.llvm.org/D17431
llvm-svn: 263160
Simon Pilgrim [Thu, 10 Mar 2016 20:40:26 +0000 (20:40 +0000)]
[X86][SSE] Reapplied: Improve vector ZERO_EXTEND by combining to ZERO_EXTEND_VECTOR_INREG
Generalise the existing SIGN_EXTEND to SIGN_EXTEND_VECTOR_INREG combine to support zero extension as well and get rid of a lot of unnecessary ANY_EXTEND + mask patterns.
Reapplied with a fix for PR26870 (avoid premature use of TargetConstant in ZERO_EXTEND_VECTOR_INREG expansion).
Differential Revision: http://reviews.llvm.org/D17691
llvm-svn: 263159
Artur Pilipenko [Thu, 10 Mar 2016 20:39:22 +0000 (20:39 +0000)]
Support arbitrary addrspace pointers in masked load/store intrinsics
This patch fixes the problem which occurs when loop-vectorize tries to use @llvm.masked.load/store intrinsic for a non-default addrspace pointer. It fails with "Calling a function with a bad signature!" assertion in CallInst constructor because it tries to pass a non-default addrspace pointer to the pointer argument which has default addrspace.
The fix is to add pointer type as another overloaded type to @llvm.masked.load/store intrinsics.
Reviewed By: reames
Differential Revision: http://reviews.llvm.org/D17270
llvm-svn: 263158
Dimitry Andric [Thu, 10 Mar 2016 20:22:02 +0000 (20:22 +0000)]
Retrieve command line arguments and environment correctly on FreeBSD
Summary:
Recently I saw the test `TestCases/Posix/print_cmdline.cc` failing on
FreeBSD, with "expected string not found in input". This is because
asan could not retrieve the command line arguments properly.
In `lib/sanitizer_common/sanitizer_linux.cc`, this is taken care of by
the `GetArgsAndEnv()` function, but it uses `__libc_stack_end` to get at
the required data. This variable does not exist on BSDs; the regular
way to retrieve the arguments and environment information is via the
`kern.ps_strings` sysctl.
I added this functionality in sanitizer_linux.cc, as a separate #ifdef
block in `GetArgsAndEnv()`. Also, `ReadNullSepFileToArray()` becomes
unused due to this change. (It won't work on FreeBSD anyway, since
`/proc` is not mounted by default.)
Reviewers: kcc, emaste, joerg, davide
Subscribers: llvm-commits, emaste
Differential Revision: http://reviews.llvm.org/D17832
llvm-svn: 263157
Peter Collingbourne [Thu, 10 Mar 2016 19:30:18 +0000 (19:30 +0000)]
ARM: Support relative references using the PREL31 symbol variant.
Differential Revision: http://reviews.llvm.org/D17937
llvm-svn: 263156
Richard Smith [Thu, 10 Mar 2016 19:22:21 +0000 (19:22 +0000)]
Add test for r263138.
llvm-svn: 263155
Balaram Makam [Thu, 10 Mar 2016 19:07:50 +0000 (19:07 +0000)]
Fix testicase to turn buildbot green. NFC.
llvm-svn: 263154
Rafael Espindola [Thu, 10 Mar 2016 19:00:22 +0000 (19:00 +0000)]
Move getLocalRelTarget to the file where it is used.
llvm-svn: 263152
Rui Ueyama [Thu, 10 Mar 2016 18:58:53 +0000 (18:58 +0000)]
Rename MaxAlignment -> Alignment.
We can argue about a maximum alignment of a group of symbols,
but for each symbol, there is only one alignment.
So it is a bit weird that each symbol has a "maximum alignment".
llvm-svn: 263151
George Rimar [Thu, 10 Mar 2016 18:57:17 +0000 (18:57 +0000)]
[ELF] - Fixed handling R_X86_64_DTPOFF64 relocation relaxation
R_X86_64_DTPOFF64 was not handled properly.
Next sample app was impossible to link before this patch:
~/pg/release/bin/clang -target x86_64-pc-linux testthread.cpp -c -g
~/pg/d+a/bin/ld.lld testthread.o
"Unknown TLS optimization" (value was 17)
__thread int x = 0;
void _start() {
}
It works fine now.
Differential revision: http://reviews.llvm.org/D18039
llvm-svn: 263150
Manman Ren [Thu, 10 Mar 2016 18:53:19 +0000 (18:53 +0000)]
Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker.
Given the following test case:
typedef struct {
const char *name;
id field;
} Test9;
extern void doSomething(Test9 arg);
void test9() {
Test9 foo2 = {0, 0};
doSomething(foo2);
}
With a release compiler, we don't emit any message and silently ignore the
variable "foo2". With an assert compiler, we get an assertion failure.
The root cause —————————————
Back in r140457 we gave InitListChecker a verification-only mode, and will use
CanUseDecl instead of DiagnoseUseOfDecl for verification-only mode.
These two functions handle unavailable issues differently:
In Sema::CanUseDecl, we say the decl is invalid when the Decl is unavailable and
the current context is available.
In Sema::DiagnoseUseOfDecl, we say the decl is usable by ignoring the return
code of DiagnoseAvailabilityOfDecl
So with an assert build, we will hit an assertion in diagnoseListInit
assert(DiagnoseInitList.HadError() &&
"Inconsistent init list check result.");
The fix -------------------
If we follow what is implemented in CanUseDecl and treat Decls with
unavailable issues as invalid, the variable decl of “foo2” will be marked as
invalid. Since unavailable checking is processed in delayed diagnostics
(r197627), we will silently ignore the diagnostics when we find out that
the variable decl is invalid.
We add a flag "TreatUnavailableAsInvalid" for the verification-only mode.
For overload resolution, we want to say decls with unavailable issues are
invalid; but for everything else, we should say they are valid and
emit diagnostics. Depending on the value of the flag, CanUseDecl
can return different values for unavailable issues.
rdar://
23557300
Differential Revision: http://reviews.llvm.org/D15314
llvm-svn: 263149