Johannes Doerfert [Thu, 18 Feb 2016 16:50:12 +0000 (16:50 +0000)]
Allow all combinations of types and subscripts for memory accesses
To support non-aligned accesses we introduce a virtual element size
for arrays that divides each access function used for this array. The
adjustment of the access function based on the element size of the
array was therefore moved after this virtual element size was
determined, thus after all accesses have been created.
Differential Revision: http://reviews.llvm.org/D17246
llvm-svn: 261226
Nicolai Haehnle [Thu, 18 Feb 2016 16:44:18 +0000 (16:44 +0000)]
AMDGPU/SI: add llvm.amdgcn.image.load/store[.mip] intrinsics
Summary:
These correspond to IMAGE_LOAD/STORE[_MIP] and are going to be used by Mesa
for the GL_ARB_shader_image_load_store extension.
IMAGE_LOAD is already matched by llvm.SI.image.load. That intrinsic has
a legacy name and pretends not to read memory.
Differential Revision: http://reviews.llvm.org/D17276
llvm-svn: 261224
Serge Pavlov [Thu, 18 Feb 2016 16:43:24 +0000 (16:43 +0000)]
File missed from r261222
llvm-svn: 261223
Serge Pavlov [Thu, 18 Feb 2016 16:42:09 +0000 (16:42 +0000)]
Avoid double deletion in Clang driver.
Llvm module object is shared between CodeGenerator and BackendConsumer,
in both classes it is stored as std::unique_ptr, which is not a good
design solution and can cause double deletion error. Usually it does
not occur because in BackendConsumer::HandleTranslationUnit the
ownership of CodeGenerator over the module is taken away. If however
this method is not called, the module is deleted twice and compiler crashes.
As the module owned by BackendConsumer is always the same as CodeGenerator
has, pointer to llvm module can be removed from BackendGenerator.
Differential Revision: http://reviews.llvm.org/D15450
llvm-svn: 261222
Aaron Ballman [Thu, 18 Feb 2016 16:36:01 +0000 (16:36 +0000)]
Add an AST matcher for real floating-point types. e.g., float, double, long double, but not complex.
llvm-svn: 261221
Krzysztof Parzyszek [Thu, 18 Feb 2016 16:10:27 +0000 (16:10 +0000)]
[Hexagon] Fix compilation error with GCC 6
Compiling Hexagon target with GCC 6 produces "error: should have been
declared inside" due to GCC PR c++/69657 which was merged.
Properly wrapping operator<<() definitions within the namespace llvm
fixes the issue.
Author: domagoj.stolfa
Differential Revision: http://reviews.llvm.org/D17281
llvm-svn: 261220
Yury Gribov [Thu, 18 Feb 2016 15:43:56 +0000 (15:43 +0000)]
[analyzer] dump_ast_matchers.py: fix replacement regexps
Patch by Alex Sidorin!
Differential Revision: http://reviews.llvm.org/D17376
llvm-svn: 261219
Krzysztof Parzyszek [Thu, 18 Feb 2016 15:42:57 +0000 (15:42 +0000)]
[Hexagon] Implement TLS support
Patch by Anand Kodnani.
llvm-svn: 261218
Benjamin Kramer [Thu, 18 Feb 2016 15:30:24 +0000 (15:30 +0000)]
[Parse] Code complete expressions in bracket declarators.
Currently we return no results when completing inside of the brackets in
a 'char foo[]' declaration. Let the generic expression completion code
handle it instead. We could get fancier here (e.g. filter non-constant
expressions in contexts where VLAs are not allowed), but it's a strict
improvement over the existing version.
llvm-svn: 261217
Hongbin Zheng [Thu, 18 Feb 2016 15:24:42 +0000 (15:24 +0000)]
Add more isl object printing function
llvm-svn: 261216
Hongbin Zheng [Thu, 18 Feb 2016 15:24:38 +0000 (15:24 +0000)]
Add the missing __isl_give to MemoryAccess::getAccessRelation
llvm-svn: 261215
George Rimar [Thu, 18 Feb 2016 15:17:01 +0000 (15:17 +0000)]
Fixed comments formatting. NFC.
llvm-svn: 261214
George Rimar [Thu, 18 Feb 2016 14:20:08 +0000 (14:20 +0000)]
Renamed sh_type -> Type, sh_flags -> Flags in arguments. NFC.
llvm-svn: 261213
Matthew Simpson [Thu, 18 Feb 2016 14:14:40 +0000 (14:14 +0000)]
Reapply commit r259357 with a fix for PR26629
Commit r259357 was reverted because it caused PR26629. We were assuming all
roots of a vectorizable tree could be truncated to the same width, which is not
the case in general. This commit reapplies the patch along with a fix and a new
test case to ensure we don't regress because of this issue again. This should
fix PR26629.
llvm-svn: 261212
Zlatko Buljan [Thu, 18 Feb 2016 14:10:52 +0000 (14:10 +0000)]
[mips][microMIPS] Implement TLBINV and TLBINVF instructions
Differential Revision: http://reviews.llvm.org/D16849
llvm-svn: 261211
Krzysztof Parzyszek [Thu, 18 Feb 2016 13:58:38 +0000 (13:58 +0000)]
[Hexagon] Add support for __builtin_prefetch
llvm-svn: 261210
Alexey Bataev [Thu, 18 Feb 2016 13:48:15 +0000 (13:48 +0000)]
[OPENMP] Fix codegen for lastprivate loop counters.
Patch fixes bug with codegen for lastprivate loop counters. Also it may
improve performance for lastprivates calculations in some cases.
llvm-svn: 261209
Krzysztof Parzyszek [Thu, 18 Feb 2016 13:41:05 +0000 (13:41 +0000)]
[Hexagon] Update the callee-saved register set for EH-aware functions
llvm-svn: 261208
Benjamin Kramer [Thu, 18 Feb 2016 13:23:17 +0000 (13:23 +0000)]
Add parentheses around arithmetic in operand of '|'.
This avoids a operator precedence warning for mixing + and | in an
expression. I checked that this matches the definition in the Split
DWARF proposal.
Patch by Cong Liu!
Differential Revision: http://reviews.llvm.org/D17375
llvm-svn: 261207
Bhushan D. Attarde [Thu, 18 Feb 2016 11:53:28 +0000 (11:53 +0000)]
[LLDB][MIPS] Provide CPU string to compiler for appropriate code generation for MIPS
SUMMARY:
This patch implements ArchSpec::GetClangTargetCPU() that provides string representing current architecture as a target CPU.
This string is then passed to tools like clang so that they generate correct code for that target.
Reviewers: clayborg, zturner
Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
Differential Revision: http://reviews.llvm.org/D17022
llvm-svn: 261206
Tamas Berghammer [Thu, 18 Feb 2016 11:12:18 +0000 (11:12 +0000)]
Improve the handling of missing elf symtab and missing symbol sizes
* Generate artificial symbol names from eh_fame during symbol parsing
so these symbols are already present when we calcualte the size of
the symbols where 0 is specified.
* Fix symbol size calculation for the last symbol in the file where
it have to last until the end of the parent section.
This is the re-commit of the original change after fixing some test
failures on OSX.
Differential revision: http://reviews.llvm.org/D16996
llvm-svn: 261205
Yury Gribov [Thu, 18 Feb 2016 11:08:46 +0000 (11:08 +0000)]
[analyzer] Add --force-analyze-debug-code option to scan-build
to force debug build and hopefully enable more precise warnings.
Static Analyzer is much more efficient when built in debug mode
(-UNDEBUG) so we advice users to enable it manually. This may be
inconvenient in case of large complex projects (think about Linux
distros e.g. Android or Tizen). This patch adds a flag to scan-build
which inserts -UNDEBUG automatically.
Differential Revision: http://reviews.llvm.org/D16200
llvm-svn: 261204
Chandler Carruth [Thu, 18 Feb 2016 11:03:11 +0000 (11:03 +0000)]
[PM] Port the PostOrderFunctionAttrs pass to the new pass manager and
convert one test to use this.
This is a particularly significant milestone because it required
a working per-function AA framework which can be queried over each
function from within a CGSCC transform pass (and additionally a module
analysis to be accessible). This is essentially *the* point of the
entire pass manager rewrite. A CGSCC transform is able to query for
multiple different function's analysis results. It works. The whole
thing appears to actually work and accomplish the original goal. While
we were able to hack function attrs and basic-aa to "work" in the old
pass manager, this port doesn't use any of that, it directly leverages
the new fundamental functionality.
For this to work, the CGSCC framework also has to support SCC-based
behavior analysis, etc. The only part of the CGSCC pass infrastructure
not sorted out at this point are the updates in the face of inlining and
running function passes that mutate the call graph.
The changes are pretty boring and boiler-plate. Most of the work was
factored into more focused preperatory patches. But this is what wires
it all together.
llvm-svn: 261203
Aidan Dodds [Thu, 18 Feb 2016 10:59:46 +0000 (10:59 +0000)]
[Renderscript] Refactor .rs.info parser.
This patch refactors the .rs.info table parser so that its more in line with the current language runtime code.
llvm-svn: 261202
Simon Pilgrim [Thu, 18 Feb 2016 10:17:40 +0000 (10:17 +0000)]
[X86][SSE] Improve PSHUFB shuffle mask decoding.
In cases where the PSHUFB shuffle mask is shared it might not be bitcasted to a vXi8 byte vector. This patch adds support for decoding these wider shuffle masks from the ConstantPool.
The test case in question makes use of this to recognise the shuffle mask is an unary UNPCKL pattern and simplifies accordingly.
llvm-svn: 261201
Junmo Park [Thu, 18 Feb 2016 10:09:20 +0000 (10:09 +0000)]
Minor code cleanup. NFC.
llvm-svn: 261200
Nikolay Haustov [Thu, 18 Feb 2016 10:02:12 +0000 (10:02 +0000)]
Test commit access.
llvm-svn: 261199
Michael Zuckerman [Thu, 18 Feb 2016 09:52:12 +0000 (09:52 +0000)]
[AVX512][PRORQ][PRORD] Change imm8 to int
Differential Revision: http://reviews.llvm.org/D17024
llvm-svn: 261198
Chandler Carruth [Thu, 18 Feb 2016 09:45:17 +0000 (09:45 +0000)]
[PM/AA] Teach the new pass manager to use pass-by-lambda for registering
analysis passes, support pre-registering analyses, and use that to
implement parsing and pre-registering a custom alias analysis pipeline.
With this its possible to configure the particular alias analysis
pipeline used by the AAManager from the commandline of opt. I've updated
the test to show this effectively in use to build a pipeline including
basic-aa as part of it.
My big question for reviewers are around the APIs that are used to
expose this functionality. Are folks happy with pass-by-lambda to do
pass registration? Are folks happy with pre-registering analyses as
a way to inject customized instances of an analysis while still using
the registry for the general case?
Other thoughts of course welcome. The next round of patches will be to
add the rest of the alias analyses into the new pass manager and wire
them up here so that they can be used from opt. This will require
extending the (somewhate limited) functionality of AAManager w.r.t.
module passes.
Differential Revision: http://reviews.llvm.org/D17259
llvm-svn: 261197
Michael Zuckerman [Thu, 18 Feb 2016 09:09:34 +0000 (09:09 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding pmovsx{b|d|w}{w|d|q}{128|256|512} builtin to clang
Differential Revision: http://reviews.llvm.org/D16955
llvm-svn: 261196
David Majnemer [Thu, 18 Feb 2016 08:15:05 +0000 (08:15 +0000)]
[MSVC] Turn C++ EH on my default
Our support for C++ EH is sufficiently good that it makes sense to
enable support for it out of the box.
While we are here, update the MSVCCompatibility doc.
llvm-svn: 261195
NAKAMURA Takumi [Thu, 18 Feb 2016 07:37:17 +0000 (07:37 +0000)]
Make a stub version of MITests, instead of reverting.
Lit tends to find out-of-date unittests in the build tree.
FIXME: It may be reverted several days after.
llvm-svn: 261194
Jonas Hahnfeld [Thu, 18 Feb 2016 07:08:26 +0000 (07:08 +0000)]
[compiler-rt] Return correct size of struct pthread for glibc-2.12.2
There seems to be a difference between 2.12.1 and 2.12.2 in 64-bit build.
Tested on Scientific Linux 6.6, based on RHEL.
Differential Revision: http://reviews.llvm.org/D17190
llvm-svn: 261193
Saleem Abdulrasool [Thu, 18 Feb 2016 06:49:31 +0000 (06:49 +0000)]
Sema: provide an extension warning for enable_if
Clang implements an enable_if attribute as an extension. Hook up `-Wpedantic`
to issue an extension usage warning when __enable_if__ is used.
llvm-svn: 261192
David Majnemer [Thu, 18 Feb 2016 06:37:44 +0000 (06:37 +0000)]
[Parse] Make sure we don't forget to diagnose typos in exprs
If ActOn*Op fails, we will forget to diagnose typos in the LHS of
expressions.
llvm-svn: 261191
Dan Gohman [Thu, 18 Feb 2016 06:32:53 +0000 (06:32 +0000)]
[WebAssembly] Don't use setRequiresStructuredCFG(true).
While we still do want reducible control flow, the RequiresStructuredCFG
flag imposes more strict structure constraints than WebAssembly wants.
Unsetting this flag enables critical edge splitting and tail merging.
Also, disable TailDuplication explicitly, as it doesn't support virtual
registers, and was previously only disabled by the RequiresStructuredCFG
flag.
llvm-svn: 261190
Matthias Braun [Thu, 18 Feb 2016 05:21:43 +0000 (05:21 +0000)]
Revert "LiveIntervalAnalysis: Remove LiveVariables requirement" and LiveIntervalTest
The commit breaks stage2 compilation on PowerPC. Reverting for now while
this is analyzed. I also have to revert the LiveIntervalTest for now as
that depends on this commit.
Revert "LiveIntervalAnalysis: Remove LiveVariables requirement"
This reverts commit r260806.
Revert "Remove an unnecessary std::move to fix -Wpessimizing-move warning."
This reverts commit r260931.
Revert "Fix typo in LiveIntervalTest"
This reverts commit r260907.
Revert "Add unittest for LiveIntervalAnalysis::handleMove()"
This reverts commit r260905.
llvm-svn: 261189
Craig Topper [Thu, 18 Feb 2016 04:54:32 +0000 (04:54 +0000)]
[TableGen,X86] Add NDEBUG check to a variable initialization that's only used by asserts. NFC
llvm-svn: 261188
Craig Topper [Thu, 18 Feb 2016 04:54:29 +0000 (04:54 +0000)]
[TableGen,X86] Remove extra optional operand from RawFrm. RawFrm with 2 immediates is handled by RawFrmImm8/RawFrmImm16.
llvm-svn: 261187
Tom Stellard [Thu, 18 Feb 2016 03:42:32 +0000 (03:42 +0000)]
[AMDGPU] Disassembler: Added basic disassembler for AMDGPU target
Changes:
- Added disassembler project
- Fixed all decoding conflicts in .td files
- Added DecoderMethod=“NONE” option to Target.td that allows to
disable decoder generation for an instruction.
- Created decoding functions for VS_32 and VReg_32 register classes.
- Added stubs for decoding all register classes.
- Added several tests for disassembler
Disassembler only supports:
- VI subtarget
- VOP1 instruction encoding
- 32-bit register operands and inline constants
[Valery]
One of the point that requires to pay attention to is how decoder
conflicts were resolved:
- Groups of target instructions were separated by using different
DecoderNamespace (SICI, VI, CI) using similar to AssemblerPredicate
approach.
- There were conflicts in IMAGE_<> instructions caused by two
different reasons:
1. dmask wasn’t specified for the output (fixed)
2. There are image instructions that differ only by the number of
the address components but have the same encoding by the HW spec. The
actual number of address components is determined by the HW at runtime
using image resource descriptor starting from the VGPR encoded in an
IMAGE instruction. This means that we should choose only one instruction
from conflicting group to be the rule for decoder. I didn’t find the way
to disable decoder generation for an arbitrary instruction and therefore
made a onelinear fix to tablegen generator that would suppress decoder
generation when DecoderMethod is set to “NONE”. This is a change that
should be reviewed and submitted first. Otherwise I would need to
specify different DecoderNamespace for every instruction in the
conflicting group. I haven’t checked yet if DecoderMethod=“NONE” is not
used in other targets.
3. IMAGE_GATHER decoder generation is for now disabled and to be
done later.
[/Valery]
Patch By: Sam Kolton
Differential Revision: http://reviews.llvm.org/D16723
llvm-svn: 261185
Kostya Serebryany [Thu, 18 Feb 2016 02:02:40 +0000 (02:02 +0000)]
[libFuzzer] fix the libFuzzer bot
llvm-svn: 261184
Jim Ingham [Thu, 18 Feb 2016 01:28:22 +0000 (01:28 +0000)]
Add usage instructions for TypeSystemMap::AddToMap.
llvm-svn: 261183
Kostya Serebryany [Thu, 18 Feb 2016 00:49:23 +0000 (00:49 +0000)]
[sanitizer-coverage] allow -fsanitize-coverage=trace-pc w/o any other sanitizer and w/o ...=[func,bb,edge]. This makes this syntax a superset of the GCC's syntax
llvm-svn: 261182
Eric Fiselier [Thu, 18 Feb 2016 00:21:09 +0000 (00:21 +0000)]
Commit tests missing from r261180.
llvm-svn: 261181
Eric Fiselier [Thu, 18 Feb 2016 00:20:34 +0000 (00:20 +0000)]
Get <ext/hash_map> working again
llvm-svn: 261180
Eugene Zelenko [Thu, 18 Feb 2016 00:10:17 +0000 (00:10 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.
llvm-svn: 261179
Kostya Serebryany [Wed, 17 Feb 2016 23:57:17 +0000 (23:57 +0000)]
[sanitizer-coverage] add a deprecation warning for -fsanitize-coverage=[1234]
llvm-svn: 261178
Amaury Sechet [Wed, 17 Feb 2016 23:55:59 +0000 (23:55 +0000)]
Add upport for bitcast in the C API echo test
llvm-svn: 261177
Derek Schuff [Wed, 17 Feb 2016 23:20:43 +0000 (23:20 +0000)]
[WebAssembly] Disable register stackification and coloring when not optimizing
These passes are optimizations, and should be disabled when not
optimizing.
Also create an MCCodeGenInfo so the opt level is correctly plumbed to
the backend pass manager.
Also remove the command line flag for disabling register coloring;
running llc with -O0 should now be useful for debugging, so it's not
necessary.
Differential Revision: http://reviews.llvm.org/D17327
llvm-svn: 261176
Tim Northover [Wed, 17 Feb 2016 23:07:04 +0000 (23:07 +0000)]
AArch64: always clear kill flags up to last eliminated copy
After r261154, we were only clearing flags if the known-zero register was
originally live-in to the basic block, but we have to do it even if not when
more than one COPY has been eliminated, otherwise the user of the first COPY
may still have <kill> marked.
E.g.
BB#N:
%X0 = COPY %XZR
STRXui %X0<kill>, <fi#0>
%X0 = COPY %XZR
STRXui %X0<kill>, <fi#1>
We can eliminate both copies, X0 is not live-in, but we must clear the kill on
the first store.
Unfortunately, I've been unable to come up with a non-fragile test for this.
I've only seen it in the wild with regalloc-created spills, and attempts to
reproduce that in a reasonable way run afoul of COPY coalescing. Even volatile
asm clobbers were moved around. Should fix the aarch64 bot though.
llvm-svn: 261175
Amaury Sechet [Wed, 17 Feb 2016 22:51:03 +0000 (22:51 +0000)]
Add support for memory operations (load/store/gep) in C API echo test
Summary: As per title.
Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17245
llvm-svn: 261174
Zachary Turner [Wed, 17 Feb 2016 22:46:33 +0000 (22:46 +0000)]
[DebugInfoPDB] A few cleanups on PDB Variant class.
Also implements the PDBSymbolCompilandEnv::getValue() method,
which until now had been unimplemented specifically because
variant did not support string values.
llvm-svn: 261173
Amaury Sechet [Wed, 17 Feb 2016 22:41:09 +0000 (22:41 +0000)]
Move LLVMCreateTargetData and LLVMDisposeTargetData together. NFC
llvm-svn: 261172
David Majnemer [Wed, 17 Feb 2016 22:37:45 +0000 (22:37 +0000)]
Don't crash w/ a diagnostic range containing a null byte
We prematurely ended the line at the null byte which caused us to crash
down stream because we tried to reason about columns beyond the end of
the line.
llvm-svn: 261171
Michael J. Spencer [Wed, 17 Feb 2016 22:30:41 +0000 (22:30 +0000)]
[readobj] Remove uneeded braces in case statement.
llvm-svn: 261170
Amaury Sechet [Wed, 17 Feb 2016 22:30:05 +0000 (22:30 +0000)]
Make sure functions are generated even there is no global in the C API echo test
llvm-svn: 261169
Adrian Prantl [Wed, 17 Feb 2016 22:20:08 +0000 (22:20 +0000)]
DwarfDebug: Don't drop the DIExpression just because a variable is
described by an immediate.
Found via http://reviews.llvm.org/D16867
Thanks to Paul Robinson for pointing this out.
<rdar://problem/
24456528>
llvm-svn: 261168
Adrian Prantl [Wed, 17 Feb 2016 22:19:59 +0000 (22:19 +0000)]
DbgVariable: Add an accessor for the common case of a single expression
belonging to a single DBG_VALUE instruction.
NFC
llvm-svn: 261167
Enrico Granata [Wed, 17 Feb 2016 22:14:41 +0000 (22:14 +0000)]
Apple simulator platforms don't have a shared cache to load Objective-C class information from
This code was doing the right thing for the iOS simulator, but not other simulator platforms
Fix it by making the warning not happen for all platforms whose name ends in "-simulator"
Since this code lives in AppleObjCRuntimeV2.cpp, this already only applies to Apple platforms by definition, so I am not too worried about conflicts with other vendors
llvm-svn: 261165
Amaury Sechet [Wed, 17 Feb 2016 22:13:33 +0000 (22:13 +0000)]
Add support for global variables in the C API echo test
Summary: As per title
Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17249
llvm-svn: 261164
Manman Ren [Wed, 17 Feb 2016 22:05:48 +0000 (22:05 +0000)]
Add 'nopartial' qualifier for availability attributes.
An optional nopartial can be placed after the platform name.
int bar() __attribute__((availability(macosx,nopartial,introduced=10.12))
When deploying back to a platform version prior to when the declaration was
introduced, with 'nopartial', Clang emits an error specifying that the function
is not introduced yet; without 'nopartial', the behavior stays the same: the
declaration is `weakly linked`.
A member is added to the end of AttributeList to save the location of the
'nopartial' keyword. A bool member is added to AvailabilityAttr.
The diagnostics for 'nopartial' not-yet-introduced is handled in the same way as
we handle unavailable cases.
Reviewed by Doug Gregor and Jordan Rose.
rdar://
23791325
llvm-svn: 261163
Richard Smith [Wed, 17 Feb 2016 21:52:44 +0000 (21:52 +0000)]
[modules] Cache 'acceptable decl' lookups for namespaces. In projects with
thousands of modules, each of which declares the same namespace, linearly
scanning the redecl chain looking for a visible declaration (once for each leaf
module, for each use) performs very poorly. Namespace visibility can only
decrease when we leave a module during a module build step, and we never care
*which* visible declaration of a namespace we find, so we can cache this very
effectively.
This results in a 35x speedup on one of our internal build steps (2m -> 3.5s),
but is hard to unit test because it requires a very large number of modules.
Ideas for a test appreciated! No functionality change intended other than the
speedup.
llvm-svn: 261161
Kostya Serebryany [Wed, 17 Feb 2016 21:34:43 +0000 (21:34 +0000)]
[sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too
llvm-svn: 261159
Alexey Samsonov [Wed, 17 Feb 2016 21:25:12 +0000 (21:25 +0000)]
PR26606: Make abort_on_error.cc test more portable.
llvm-svn: 261157
Amaury Sechet [Wed, 17 Feb 2016 21:21:29 +0000 (21:21 +0000)]
NFC: Fix formating
llvm-svn: 261156
Tim Northover [Wed, 17 Feb 2016 21:16:59 +0000 (21:16 +0000)]
Fix warning on build without asserts
llvm-svn: 261155
Tim Northover [Wed, 17 Feb 2016 21:16:53 +0000 (21:16 +0000)]
AArch64: improve redundant copy elimination.
Mostly, this fixes the bug that if the CBZ guaranteed Xn but Wn was used, we
didn't sort out the use-def chain properly.
I've also made it check more than just the last instruction for a compatible
CBZ (so it can cope without fallthroughs). I'd have liked to do that
separately, but it's helps writing the test.
Finally, I removed some custom loops in favour of MachineInstr helpers and
refactored the control flow to flatten it and avoid possibly quadratic
iterations in blocks with many copies. NFC for these, just a general tidy-up.
llvm-svn: 261154
Zachary Turner [Wed, 17 Feb 2016 21:13:34 +0000 (21:13 +0000)]
[DebugInfoPDB] Raise getSymIndexId() up to PDBSymbol
Every symbol, no matter what it's tag is, supports the method
getSymIndexId(). However, this was being forwarded on every
concrete symbol type, so if someone had a PDBSymbol that they
didn't know what type it was (or simply didn't have an instance
of the concrete symbol type), they would not be able to get its
index id. This patch moves the method up to PDBSymbol, so that
no matter what type of object you have, you can always get its
id.
llvm-svn: 261153
Zachary Turner [Wed, 17 Feb 2016 21:13:15 +0000 (21:13 +0000)]
[DebugInfoPDB] Teach Variant to support string types.
The IDiaSymbol::getValue() method returns a variant. Until now,
I had never encountered a string value, so the Variant wrapper
did not support VT_BSTR. Now we have need to support string
values, so this patch just adds support for one extra type to
Variant.
llvm-svn: 261152
Akira Hatanaka [Wed, 17 Feb 2016 21:09:50 +0000 (21:09 +0000)]
[CodeGen] Fix an assert in CodeGenFunction::EmitFunctionEpilog
The assert is triggered because isObjCRetainableType() is called on the
canonicalized return type that has been stripped of the typedefs and
attributes attached to it. To fix this assert, this commit gets the
original return type from CurCodeDecl or BlockInfo and uses it instead
of the canoicalized type.
rdar://problem/
24470031
Differential Revision: http://reviews.llvm.org/D16914
llvm-svn: 261151
Alexey Samsonov [Wed, 17 Feb 2016 21:00:50 +0000 (21:00 +0000)]
Fix PR26608: Make sanitizer_common tests more portable.
llvm-svn: 261150
Haicheng Wu [Wed, 17 Feb 2016 21:00:06 +0000 (21:00 +0000)]
[LIR] Avoid turning non-temporal stores into memset
This is to fix PR26645.
llvm-svn: 261149
Alexey Samsonov [Wed, 17 Feb 2016 20:40:10 +0000 (20:40 +0000)]
[TSan] PR26609: Fix two test cases.
llvm-svn: 261148
Adrian Prantl [Wed, 17 Feb 2016 20:02:25 +0000 (20:02 +0000)]
Debug Info: Teach LdStHasDebugValue() (Local.cpp) about DIExpressions.
This function is used to check whether a dbg.value intrinsic has already
been inserted, but without comparing the DIExpression, it would erroneously
fire on split aggregates and only the first scalar would survive.
Found via http://reviews.llvm.org/D16867.
<rdar://problem/
24456528>
llvm-svn: 261145
George Burgess IV [Wed, 17 Feb 2016 19:59:32 +0000 (19:59 +0000)]
Add static/const qualifiers to methods. NFC.
Split out this change as requested in D14933.
llvm-svn: 261144
Kostya Serebryany [Wed, 17 Feb 2016 19:42:34 +0000 (19:42 +0000)]
[libFuzzer] don't timeout when loading the corpus. Be a bit more verbose when loading large corpus.
llvm-svn: 261143
Alexey Samsonov [Wed, 17 Feb 2016 19:35:51 +0000 (19:35 +0000)]
[tests] Slightly improve a fix in r260669.
llvm-svn: 261142
Akira Hatanaka [Wed, 17 Feb 2016 19:35:47 +0000 (19:35 +0000)]
Mention 'notail' attribute in 3.9 release notes.
llvm-svn: 261141
Elena Demikhovsky [Wed, 17 Feb 2016 19:23:04 +0000 (19:23 +0000)]
Create masked gather and scatter intrinsics in Loop Vectorizer.
Loop vectorizer now knows to vectorize GEP and create masked gather and scatter intrinsics for random memory access.
The feature is enabled on AVX-512 target.
Differential Revision: http://reviews.llvm.org/D15690
llvm-svn: 261140
Amaury Sechet [Wed, 17 Feb 2016 19:21:28 +0000 (19:21 +0000)]
Fix load alignement when unpacking aggregates structs
Summary: Store and loads unpacked by instcombine do not always have the right alignement. This explicitely compute the alignement and set it.
Reviewers: dblaikie, majnemer, reames, hfinkel, joker.eph
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17326
llvm-svn: 261139
David Majnemer [Wed, 17 Feb 2016 19:02:36 +0000 (19:02 +0000)]
Revert "Reapply commit r258404 with fix."
This reverts commit r259357, it caused PR26629.
llvm-svn: 261137
Ed Schouten [Wed, 17 Feb 2016 18:56:20 +0000 (18:56 +0000)]
Enable SafeStack for CloudABI.
Summary:
I've got a patchset in my home directory to integrate support for
SafeStack into CloudABI's C library. All of the CloudABI unit tests
still seem to pass. Pretty sweet!
This change adds the necessary changes to Clang to make
-fsanitize=safe-stack work on CloudABI. Without it, passing this command
line flag throws an error.
Reviewers: eugenis, samsonov
Differential Revision: http://reviews.llvm.org/D17243
llvm-svn: 261135
Frederic Riss [Wed, 17 Feb 2016 18:51:27 +0000 (18:51 +0000)]
[ObjCARC] Handle ARCInstKind::ClaimRV in OptimizeIndividualCalls.
When support for objc_unsafeClaimAutoreleasedReturnValue has been added to the
ARC optimizer in r258970, one case was missed which would lead the optimizer
to execute an llvm_unreachable. In this case, just handle ClaimRV in the same
way we handle RetainRV.
llvm-svn: 261134
Colin LeMahieu [Wed, 17 Feb 2016 18:50:21 +0000 (18:50 +0000)]
[Hexagon] Replacing reference/dereference with reference cast.
llvm-svn: 261133
Nico Weber [Wed, 17 Feb 2016 18:48:08 +0000 (18:48 +0000)]
Remove superfluous semicolon.
llvm-svn: 261128
Nico Weber [Wed, 17 Feb 2016 18:47:29 +0000 (18:47 +0000)]
Revert r261070, it caused PR26652 / PR26653.
llvm-svn: 261127
David Majnemer [Wed, 17 Feb 2016 18:37:11 +0000 (18:37 +0000)]
[WinEH] Optimize WinEH state stores
32-bit x86 Windows targets use a linked-list of nodes allocated on the
stack, referenced to via thread-local storage. The personality routine
interprets one of the fields in the node as a 'state number' which
indicates where the personality routine should transfer control.
State transitions are possible only before call-sites which may throw
exceptions. Our previous scheme had us update the state number before
all call-sites which may throw.
Instead, we can try to minimize the number of times we need to store by
reasoning about the nearest store which dominates the current call-site.
If the last store agrees with the current call-site, then we know that
the state-update is redundant and can be elided.
This is largely straightforward: an RPO walk of the blocks allows us to
correctly forward propagate the information when the function is a DAG.
Currently, loops are not handled optimally and may trigger superfluous
state stores.
Differential Revision: http://reviews.llvm.org/D16763
llvm-svn: 261122
Ed Maste [Wed, 17 Feb 2016 18:25:27 +0000 (18:25 +0000)]
[tsan] Fix signal number definitions for FreeBSD
The change in r253983 for OS X also applies to FreeBSD.
llvm-svn: 261121
Ed Maste [Wed, 17 Feb 2016 18:22:50 +0000 (18:22 +0000)]
[tsan] Fix build warnings on FreeBSD
The change in r252165 for OS X applies to FreeBSD as well.
llvm-svn: 261120
Easwaran Raman [Wed, 17 Feb 2016 18:18:47 +0000 (18:18 +0000)]
Add a profile summary class specific to instrumentation profiles.
Modify ProfileSummary class to make it not instrumented profile specific.
Add a new InstrumentedProfileSummary class that inherits from ProfileSummary.
Differential Revision: http://reviews.llvm.org/D17310
llvm-svn: 261119
Colin LeMahieu [Wed, 17 Feb 2016 18:14:05 +0000 (18:14 +0000)]
[Hexagon] Loop instructions don't need special processing. Extension and fitting is performed by generic code and the comment is incorrect, loops don't have a separate extended opcode.
llvm-svn: 261118
Justin Lebar [Wed, 17 Feb 2016 17:46:54 +0000 (17:46 +0000)]
[NVPTX] Annotate convergent intrinsics as convergent.
Summary:
Previously the machine instructions for bar.sync &co. were not marked as
convergent. This resulted in some MI passes (such as TailDuplication,
fixed in an upcoming patch) doing unsafe things to these instructions.
Reviewers: jingyue
Subscribers: llvm-commits, tra, jholewinski, hfinkel
Differential Revision: http://reviews.llvm.org/D17318
llvm-svn: 261115
Justin Lebar [Wed, 17 Feb 2016 17:46:52 +0000 (17:46 +0000)]
[NVPTX] Test that MachineSink won't sink across llvm.cuda.syncthreads.
Summary:
The syncthreads MI is modeled as mayread/maywrite -- convergence doesn't
even come into play here. Nonetheless this property is highly implicit
in the tablegen files, so a test seems appropriate.
Reviewers: jingyue
Subscribers: llvm-commits, jholewinski
Differential Revision: http://reviews.llvm.org/D17319
llvm-svn: 261114
Justin Lebar [Wed, 17 Feb 2016 17:46:50 +0000 (17:46 +0000)]
[NVPTX] Annotate call machine instructions as calls.
Summary:
Otherwise we'll try to do unsafe optimizations on these MIs, such as
sinking loads below calls.
(I suspect that this is not the only bug in the NVPTX instruction
tablegen files; I need to comb through them.)
Reviewers: jholewinski, tra
Subscribers: jingyue, jhen, llvm-commits
Differential Revision: http://reviews.llvm.org/D17315
llvm-svn: 261113
Justin Lebar [Wed, 17 Feb 2016 17:46:47 +0000 (17:46 +0000)]
[IR] Add {is,set,setNot}Convergent() functions to CallSite, CallInstr, and InvokeInstr.
Summary:
(CallSite already has isConvergent() and setConvergent().)
No functional changes.
Reviewers: reames
Subscribers: llvm-commits, jingyue, arsenm
Differential Revision: http://reviews.llvm.org/D17316
llvm-svn: 261112
Justin Lebar [Wed, 17 Feb 2016 17:46:41 +0000 (17:46 +0000)]
Update langref to indicate that calls may be convergent.
Summary:
As previously written, only functions could be convergent. But calls
need to have a notion of convergence as well.
To see why this is important, consider an indirect call. We may or may
not want to disable optimizations around it and behave as though we're
calling a convergent function -- it depends on the semantics of the
language we're compiling. Thus the need for this attr on the call.
Reviewers: jingyue, joker.eph
Subscribers: llvm-commits, tra, jhen, arsenm, chandlerc, hfinkel, resistor
Differential Revision: http://reviews.llvm.org/D17314
llvm-svn: 261111
Justin Lebar [Wed, 17 Feb 2016 17:46:39 +0000 (17:46 +0000)]
Fix typo in comment.
llvm-svn: 261110
David Majnemer [Wed, 17 Feb 2016 17:19:00 +0000 (17:19 +0000)]
Correct more typos in conditional expressions
We didn't correctly handle some edge cases, causing us to bail out
before correcting all the typos.
llvm-svn: 261109
Chris Bieneman [Wed, 17 Feb 2016 16:57:38 +0000 (16:57 +0000)]
[CMake] [NFC] Move macro definitions out of config-ix.cmake
This change should have no functional impact, it just moves some macro definitions out of config-ix.cmake into CompilerRTUtils.cmake.
This step will allow these macros to be re-used by the separated builtin build.
llvm-svn: 261108
Rafael Espindola [Wed, 17 Feb 2016 16:48:00 +0000 (16:48 +0000)]
Represent the dynamic table itself with a DynRegionInfo.
The dynamic table is also an array of a fixed structure, so it can be
represented with a DynReginoInfo.
No major functionality change. The extra error checking is covered by
existing tests with a broken dynamic program header.
Idea extracted from r260488. I did the extra cleanups.
llvm-svn: 261107