David Blaikie [Tue, 24 Oct 2017 17:29:14 +0000 (17:29 +0000)]
BinaryFormat/MachO.h Don't mark header functions as file-scope static
This creates ODR violations if the function is called from another inline function in a header and also creates binary bloat from duplicate definitions.
llvm-svn: 316477
David Blaikie [Tue, 24 Oct 2017 17:29:14 +0000 (17:29 +0000)]
ValueTracking.h Don't mark header functions as file-scope static
This creates ODR violations if the function is called from another inline function in a header and also creates binary bloat from duplicate definitions.
llvm-svn: 316476
David Blaikie [Tue, 24 Oct 2017 17:29:13 +0000 (17:29 +0000)]
MemoryBuiltins.h: Don't mark header functions as file-scope static
This creates ODR violations if the function is called from another inline function in a header and also creates binary bloat from duplicate definitions.
llvm-svn: 316475
David Blaikie [Tue, 24 Oct 2017 17:29:12 +0000 (17:29 +0000)]
IndirectCallSiteVisitor.h:findIndirectCallSites Don't mark header functions as file-scope static
This creates ODR violations if the function is called from another inline function in a header and also creates binary bloat from duplicate definitions.
llvm-svn: 316474
David Blaikie [Tue, 24 Oct 2017 17:29:12 +0000 (17:29 +0000)]
StringExtras.h Don't mark header functions as file-scope static
This creates ODR violations if the function is called from another inline function in a header and also creates binary bloat from duplicate definitions.
llvm-svn: 316473
David Blaikie [Tue, 24 Oct 2017 17:29:11 +0000 (17:29 +0000)]
SmallVector.h:capacity_in_bytes Don't mark header functions as file-scope static
This creates ODR violations if the function is called from another inline
function in a header and also creates binary bloat from duplicate definitions.
llvm-svn: 316472
David Blaikie [Tue, 24 Oct 2017 17:29:11 +0000 (17:29 +0000)]
DenseMap.h:capacity_in_bytes Don't mark header functions as file-scope static
This creates ODR violations if the function is called from another inline
function in a header and also creates binary bloat from duplicate definitions.
llvm-svn: 316471
David Blaikie [Tue, 24 Oct 2017 17:29:08 +0000 (17:29 +0000)]
BitVector.h:capacity_in_bytes Don't mark header functions as file-scope static
This creates ODR violations if the function is called from another
inline function in a header and also creates binary bloat from duplicate
definitions.
llvm-svn: 316470
Yonghong Song [Tue, 24 Oct 2017 17:29:03 +0000 (17:29 +0000)]
bpf: fix a bug in bpf-isel trunc-op optimization
In BPF backend, we try to optimize away redundant
trunc operations so that kernel verifier rewrite
remains valid. Previous implementation only works
for a single function.
This patch fixed the issue for multiple functions.
It clears internal map data structure before
performing optimization for each function.
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 316469
Aaron Ballman [Tue, 24 Oct 2017 17:28:39 +0000 (17:28 +0000)]
Added instructions for obtaining clang-tools-extra to the Getting Started page.
llvm-svn: 316468
Alex Lorenz [Tue, 24 Oct 2017 17:23:53 +0000 (17:23 +0000)]
Add missing clangRewrite lib dependency for clangToolingRefactor
llvm-svn: 316467
Adrian Prantl [Tue, 24 Oct 2017 17:23:40 +0000 (17:23 +0000)]
Doxygenify comments.
llvm-svn: 316466
Alex Lorenz [Tue, 24 Oct 2017 17:18:45 +0000 (17:18 +0000)]
[refactor] Initial outline of implementation of "extract function" refactoring
This commit adds an initial, skeleton outline of the "extract function"
refactoring. The extracted function doesn't capture variables / rewrite code
yet, it just basically does a simple copy-paste.
The following initiation rules are specified:
- extraction can only be done for executable code in a function/method/block.
This means that you can't extract a global variable initialize into a function
right now.
- simple literals and references are not extractable.
This commit also adds support for full source ranges to clang-refactor's test
mode.
Differential Revision: https://reviews.llvm.org/D38982
llvm-svn: 316465
Michael Kruse [Tue, 24 Oct 2017 17:17:27 +0000 (17:17 +0000)]
[opt] Initialize WriteBitcode pass.
Probably due to a change of how some pass initializes its dependencies,
the -write-bitcode pass (Bitcode/Writer/BitcodeWriterPass.cpp) is not
initialized in opt anymore and therefore not usable with
opt -write-bitcode
Explicitly call initializeWriteBitcodePassPass() to make it available
in opt again.
Differential Revision: https://reviews.llvm.org/D39223
llvm-svn: 316464
Daniel Sanders [Tue, 24 Oct 2017 17:08:43 +0000 (17:08 +0000)]
[globalisel][tablegen] Multi-insn emission requires that BuildMIAction support not being linked to an InstructionMatcher. NFC
When multi-instruction emission is supported, it will no longer be guaranteed
that every BuildMIAction has a corresponding matched instruction. BuildMIAction
should support not having one to cover the case where a rule produces more
instructions than it matched.
llvm-svn: 316463
Simon Pilgrim [Tue, 24 Oct 2017 17:04:57 +0000 (17:04 +0000)]
[X86][AVX] ComputeNumSignBitsForTargetNode - add support for X86ISD::VTRUNC
llvm-svn: 316462
Reid Kleckner [Tue, 24 Oct 2017 17:02:40 +0000 (17:02 +0000)]
[codeview] Fix handling of S_HEAPALLOCSITE
The type index is from the TPI stream, not the IPI stream. Fix the
dumper, fix type index discovery, and add a test in LLD.
Also improve the log message we emit when we fail to rewrite type
indices in LLD. That's how I found this bug.
llvm-svn: 316461
Konstantin Zhuravlyov [Tue, 24 Oct 2017 17:01:40 +0000 (17:01 +0000)]
LLD/ELF: Allow targets to set e_flags
Differential Revision: https://reviews.llvm.org/D39139
llvm-svn: 316460
Michael Kruse [Tue, 24 Oct 2017 16:40:34 +0000 (16:40 +0000)]
[ZoneAlgo] Translate addArrayWriteAccess to isl++. NFC.
llvm-svn: 316459
Alex Lorenz [Tue, 24 Oct 2017 16:39:37 +0000 (16:39 +0000)]
[code completion] Complete ObjC methods in @implementation without leading
'-'/'+' prefix
rdar://
12040840
llvm-svn: 316458
Simon Pilgrim [Tue, 24 Oct 2017 16:38:38 +0000 (16:38 +0000)]
[SelectionDAG] Add VSELECT support to ComputeNumSignBits
llvm-svn: 316457
Marshall Clow [Tue, 24 Oct 2017 16:30:06 +0000 (16:30 +0000)]
Mark string_view's constructor from (ptr,len) as noexcept (an extension). Update the tests to check this (and other noexcept bits
llvm-svn: 316456
Rafael Espindola [Tue, 24 Oct 2017 16:27:31 +0000 (16:27 +0000)]
Refactor duplicated comment. NFC.
llvm-svn: 316455
Saleem Abdulrasool [Tue, 24 Oct 2017 16:19:56 +0000 (16:19 +0000)]
PowerPC: support the separator character in the IAS
PowerPC uses ; as a comment leader and the @ as a separator character.
Support this properly.
llvm-svn: 316454
Erich Keane [Tue, 24 Oct 2017 16:16:34 +0000 (16:16 +0000)]
Remove repeated function name in doxygen comment.
llvm-svn: 316453
Jonathan Peyton [Tue, 24 Oct 2017 16:10:09 +0000 (16:10 +0000)]
Disable threadprivate data cleanup if runtime is terminating
The problem is due to the runtime's threadprivate cleanup code which tries to
access data that was already destroyed by one of the root threads.
__kmp_init_gtid is used as a checker here since it is set to false before actual
resource cleanup is done in __kmp_cleanup().
Patch by Hansang Bae
llvm-svn: 316452
Pavel Labath [Tue, 24 Oct 2017 16:07:50 +0000 (16:07 +0000)]
Revert "[lldbtests] Handle errors instead of crashing."
The commit breaks the case where you specify just a filename to the
compiler. Previously, it would look up the compiler in your path, now it
complains that the compiler is not found. One of the lldb buildbots is
depending on this. It seems like a nice feature to have, as it means
less typing and being able to avoid hard-coding the system compiler path
in the bot config.
This reverts commit r316393.
llvm-svn: 316451
Craig Topper [Tue, 24 Oct 2017 15:50:55 +0000 (15:50 +0000)]
[TableGen] Fix some formatting quirks in the subtarget output file.
llvm-svn: 316450
Craig Topper [Tue, 24 Oct 2017 15:50:53 +0000 (15:50 +0000)]
[TableGen] Simplify some of the subtarget emission by removing code that avoids printing commas at the end of arrays and enums.
The C++ standard allows for trailing commas. We already do this in many other emitters.
llvm-svn: 316449
Simon Pilgrim [Tue, 24 Oct 2017 15:38:16 +0000 (15:38 +0000)]
[X86] truncateVectorCompareWithPACKSS - use PACKSSDW/PACKSSWB instead of just PACKSSWB.
By using the widest type possible for PACKSS truncation we have a better chance of being able to peek through bitcasts and improves other combines driven by ComputeNumSignBits.
llvm-svn: 316448
Erich Keane [Tue, 24 Oct 2017 15:34:59 +0000 (15:34 +0000)]
Fix spelling in comment, field is isMsStruct, not Strust
llvm-svn: 316447
Sanjay Patel [Tue, 24 Oct 2017 15:27:47 +0000 (15:27 +0000)]
[x86] add more vector ISA variants for memcmp expansion; NFC
...because every swiss cheese has different holes.
llvm-svn: 316446
Michael Kruse [Tue, 24 Oct 2017 15:19:46 +0000 (15:19 +0000)]
[ISLTools] Translate computeReachingWrite to isl++. NFC.
llvm-svn: 316445
Vassil Vassilev [Tue, 24 Oct 2017 14:52:35 +0000 (14:52 +0000)]
[modules] Add a regression test for merging anon decls in extern C contexts.
llvm-svn: 316444
Sanjay Patel [Tue, 24 Oct 2017 14:32:52 +0000 (14:32 +0000)]
[utils] make retq/retl regex an option that is off by default
Ideally, we should compare 32- and 64-bit versions to see if the
ret line is the only difference and then insert the regex only
in that case. But this is a quick hack to avoid a bunch of noise
as existing tests are updated.
llvm-svn: 316443
Oliver Stannard [Tue, 24 Oct 2017 14:20:13 +0000 (14:20 +0000)]
[ARM] Tighten up CHECK lines in a test
These tests checked for the line number without a leading ":", so for example,
a missed diagnostic on line 123 could match one on line 1123, 2123, etc,
desynchronising the test for hundreds of lines.
This couldn't cause it to incorrectly pass or fail, but made it hard to track
down test failures.
Differential revision: https://reviews.llvm.org/D39238
llvm-svn: 316442
Oliver Stannard [Tue, 24 Oct 2017 14:19:08 +0000 (14:19 +0000)]
[ARM] Error for invalid shift in memory operand
Report a diagnostic when we fail to parse a shift in a memory operand because
the shift type is not an identifier. Without this, we were silently ignoring
the whole instruction.
Differential revision: https://reviews.llvm.org/D39237
llvm-svn: 316441
Simon Pilgrim [Tue, 24 Oct 2017 14:18:32 +0000 (14:18 +0000)]
[X86] truncateVectorCompareWithPACKSS - remove duplicate variables. NFCI.
llvm-svn: 316440
Marshall Clow [Tue, 24 Oct 2017 14:06:00 +0000 (14:06 +0000)]
Mark string_view literals as 'noexcept'. Fixes PR#25054. Thanks to Pavel K for the bug report.
llvm-svn: 316439
Erich Keane [Tue, 24 Oct 2017 13:51:07 +0000 (13:51 +0000)]
Add Forgotten test for: Fix template parameter default args missed if redecled
Addendum to differential revision: https://reviews.llvm.org/D39127
llvm-svn: 316437
Erik Verbruggen [Tue, 24 Oct 2017 13:46:58 +0000 (13:46 +0000)]
Do not add a colon chunk to the code completion of class inheritance access modifiers
With enabled CINDEXTEST_CODE_COMPLETE_PATTERNS env option (which enables
IncludeCodePatterns in completion options) code completion after colon
currently suggests access modifiers with 2 completion chunks which is
incorrect.
Example:
class A : <Cursor>B
{
}
Currently we get 'NotImplemented:{TypedText public}{Colon :} (40)'
but the correct line is just 'NotImplemented:{TypedText public} (40)'
The fix introduces more specific scope that occurs between ':' and '{'
It allows us to determine when we don't need to add ':' as a second
chunk to the public/protected/private access modifiers.
Patch by Ivan Donchevskii!
Differential Revision: https://reviews.llvm.org/D38618
llvm-svn: 316436
Andrew V. Tischenko [Tue, 24 Oct 2017 13:38:30 +0000 (13:38 +0000)]
Update f16c instruction scheduling on btver2.
Differential Revision: https://reviews.llvm.org/D39051
llvm-svn: 316435
Zvi Rackover [Tue, 24 Oct 2017 13:24:26 +0000 (13:24 +0000)]
X86CallFrameOptimization: Update comments and variable names. NFCI.
Following up on D38738.
llvm-svn: 316434
Eric Liu [Tue, 24 Oct 2017 13:10:58 +0000 (13:10 +0000)]
[Tooling] Add a factory method for CommonOptionsParser
Summary: This returns error instead of exiting the program in case of error.
Reviewers: klimek, hokein
Reviewed By: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39042
llvm-svn: 316433
Michael Kruse [Tue, 24 Oct 2017 13:05:24 +0000 (13:05 +0000)]
[DeLICM] Do not try to map to multiple array elements.
Add check and skip when the store used to determine the target accesses
multiple array elements. Only a single array location should for
mapping the scalar. Having multiple creates problems when deciding which
element to load from. While MemoryAccess::getAddressFunction() should
select just one of them, other problems arise in code that assumes
that there is just one target element per statement instance.
This fixes llvm.org/PR34989
This also reverts r313902 which fixed llvm.org/PR34485 also caused by
a non-functional target array element. This patch avoids the situation
to occur in the first place.
llvm-svn: 316432
Zvi Rackover [Tue, 24 Oct 2017 12:13:05 +0000 (12:13 +0000)]
X86CallFrameOptimization: Recognize 'store 0/-1 using and/or' idioms
Summary:
r264440 added or/and patterns for storing -1 or 0 with the intention of decreasing code size. However,
X86CallFrameOptimization does not recognize these memory accesses so it will not replace them with push's when profitable.
This patch fixes this problem by teaching X86CallFrameOptimization these store 0/-1 idioms.
An alternative fix would be to prevent the 'store 0/1 idioms' patterns from firing when accessing the stack. This would save
the need to teach the pass about these idioms. However, because X86CallFrameOptimization does not always fire we may result
in cases where neither X86CallFrameOptimization not the patterns for 'store 0/1 idioms' fire.
Fixes pr34863
Reviewers: DavidKreitzer, guyblank, aymanmus
Reviewed By: aymanmus
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38738
llvm-svn: 316431
Bjorn Pettersson [Tue, 24 Oct 2017 12:08:11 +0000 (12:08 +0000)]
[ConstantFolding] Avoid assert when folding ptrtoint of vectorized GEP
Summary:
Got asserts in llvm::CastInst::getCastOpcode saying:
`DestBits == SrcBits && "Illegal cast to vector (wrong type or size)"' failed.
Problem seemed to be that llvm::ConstantFoldCastInstruction did
not handle ptrtoint cast of a getelementptr returning a vector
correctly. I assume such situations are quite rare, since the
GEP needs to be considered as a constant value (base pointer
being null).
The solution used here is to simply avoid the constant fold
of ptrtoint when the value is a vector. It is not supported,
and by bailing out we do not fail on assertions later on.
Reviewers: craig.topper, majnemer, davide, filcab, efriedma
Reviewed By: efriedma
Subscribers: efriedma, filcab, llvm-commits
Differential Revision: https://reviews.llvm.org/D38546
llvm-svn: 316430
Bjorn Pettersson [Tue, 24 Oct 2017 11:59:20 +0000 (11:59 +0000)]
[LangRef] Update description of Constant Expressions
Summary:
When describing trunc/zext/sext/ptrtoint/inttoptr in the chapter
about Constant Expressions we now simply refer to the Instruction
Reference. As far as I know there are no difference when it comes
to the semantics and the argument constraints. The only difference
is that the syntax is slighly different for the constant expressions,
regarding the use of parenthesis in constant expressions.
Referring to the Instruction Reference is the same solution as
already used for several other operations, such as bitcast.
The main goal was to add information that vector types are allowed
also in trunc/zext/sext/ptrtoint/inttoptr constant expressions.
That was not explicitly mentioned earlier, and resulted in some
questions in the review of https://reviews.llvm.org/D38546
Reviewers: efriedma, majnemer
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39165
llvm-svn: 316429
George Rimar [Tue, 24 Oct 2017 11:44:19 +0000 (11:44 +0000)]
[llvm-dwarfdump] - Cleanup of gnu_call_site.s. NFC.
This change fixes values of test so that it passes
-verify without errors and also adds comments.
Test was introduced in D39119 and intention was to check
that tool is able to dump few
DW_*GNU_call_site* tags and attributes, so that
change is NFC cleanup.
llvm-svn: 316428
Marek Olsak [Tue, 24 Oct 2017 10:27:13 +0000 (10:27 +0000)]
AMDGPU: Add new intrinsic llvm.amdgcn.kill(i1)
Summary:
Kill the thread if operand 0 == false.
llvm.amdgcn.wqm.vote can be applied to the operand.
Also allow kill in all shader stages.
Reviewers: arsenm, nhaehnle
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D38544
llvm-svn: 316427
Marek Olsak [Tue, 24 Oct 2017 10:26:59 +0000 (10:26 +0000)]
AMDGPU: Add llvm.amdgcn.wqm.vote intrinsic
Reviewers: arsenm, nhaehnle
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye
Differential Revision: https://reviews.llvm.org/D38543
llvm-svn: 316426
Jan Korous [Tue, 24 Oct 2017 10:23:10 +0000 (10:23 +0000)]
[docs] Code example fix
llvm-svn: 316425
Peter Smith [Tue, 24 Oct 2017 09:51:55 +0000 (09:51 +0000)]
[AArch64] Fix PR34625 -mtune without -mcpu should not set -target-cpu
When -mtune is used on AArch64 the -target-cpu is passed the value of the
cpu given to -mtune. As well as setting micro-architectural features of the
-mtune cpu, this will also add the architectural features such as support
for instructions. This can result in the backend using instructions that
are supported in the -mtune cpu but not supported in the target
architecture. For example use of the v8.1-a LSE extensions with -march=v8.
This change removes the setting of -target-cpu for -mtune, the -mcpu must
be used to set -target-cpu. This has the effect of removing all non-hard
coded benefits of mtune but it does produce correct output when -mtune cpu
with a later architecture than v8 is used.
Fixes PR34625
Differential Revision: https://reviews.llvm.org/D39179
llvm-svn: 316424
Oliver Stannard [Tue, 24 Oct 2017 09:46:56 +0000 (09:46 +0000)]
[ARM] Replace development diagnostics with normal DEBUG macro
* Remove the -arm-asm-parser-dev-diags option.
* Use normal DEBUG(dbgs()) printing for the extra development information about
missing diagnostics.
Differential Revision: https://reviews.llvm.org/D39194
llvm-svn: 316423
Serguei Katkov [Tue, 24 Oct 2017 09:42:55 +0000 (09:42 +0000)]
Restore the fix rL316059 eliminated by rL316372
rL316059 fixed the potential build failure when compiling
with -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON.
rL316372 just reverted the part of the fix, so restore it.
llvm-svn: 316422
Oliver Stannard [Tue, 24 Oct 2017 09:03:33 +0000 (09:03 +0000)]
[ARM] tSETEND needs IsThumb
This is the Thumb encoding, so the Requires list must include IsThumb.
No test because we happen to select the ARM one first, but that's just luck.
Differential Revision: https://reviews.llvm.org/D39190
llvm-svn: 316421
Oliver Stannard [Tue, 24 Oct 2017 08:55:36 +0000 (08:55 +0000)]
[ARM] Remove tCPS alias which just crashed
This alias caused a crash when trying to print the "cps #0" instruction in a
diagnostic for thumbv6 (which doesn't have that instruction).
The comment was incorrect, this instruction is UNPREDICTABLE if no flag bits
are set, so I don't think it's worth keeping.
Differential Revision: https://reviews.llvm.org/D39191
llvm-svn: 316420
Sam McCall [Tue, 24 Oct 2017 08:30:19 +0000 (08:30 +0000)]
Support formatv of TimePoint with strftime-style formats.
Summary:
Support formatv of TimePoint with strftime-style formats.
Extensions for millis/micros/nanos are added.
Inital use case is HH:MM:SS.MMM timestamps in clangd logs.
Reviewers: bkramer, ilya-biryukov
Subscribers: labath, llvm-commits
Differential Revision: https://reviews.llvm.org/D38992
llvm-svn: 316419
George Rimar [Tue, 24 Oct 2017 08:26:32 +0000 (08:26 +0000)]
[ELF] - Do not collect SHT_REL[A] sections unconditionally when --gc-sections and --emit-relocs used together.
This is "Bug 34836 - --gc-sections remove relocations from --emit-relocs",
When --emit-relocs is used, LLD currently always drops SHT_REL[A] sections from
output if --gc-sections is present. Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D38724
llvm-svn: 316418
Clement Courbet [Tue, 24 Oct 2017 08:05:07 +0000 (08:05 +0000)]
[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)
Refactor ExpandMemcmp:
- Stop duplicating the logic for computation of the sequence of loads to
generate (thsi was done in three different places), this is now done
only once in MemCmpExpansion::MemCmpExpansion().
- Add a FIXME to expose a bug with the computation of the number of loads
when not all sizes are loadable. For example, on X86-32 + SSE, possible
loads are {16,4,2,1} bytes. The current code considers that all loads
starting at MaxLoadSize are possible. This is not an issue right now as
vector loads are not enabled, so I'm not fixing the issue here to keep
the change as small as possible. I'm going to address this in a
subsequent revision, where I enable vector loads.
See https://bugs.llvm.org/show_bug.cgi?id=34887
Differential Revision: https://reviews.llvm.org/D38498
llvm-svn: 316417
Zvi Rackover [Tue, 24 Oct 2017 07:38:29 +0000 (07:38 +0000)]
X86: Fix X86CallFrameOptimization to search for the COPY StackPointer
SelectionDAG inserts a copy of ESP into a virtual register.
X86CallFrameOptimization assumed that the COPY, if present, is always
right after the call-frame setup instruction (ADJCALLSTACKDOWN). This was a
wrong assumption as the COPY can be located anywhere between the call-frame setup
instruction and its first use. If the COPY happened to be located in a different
location than what X86CallFrameOptimization assumed, visiting it while
processing the call chain would lead to a conservative bail-out.
The fix is quite straightfoward, scan ahead for the stack-pointer copy and make note
of it so it can be ignored while processing the call chain.
Fixes pr34903
Differential Revision: https://reviews.llvm.org/D38730
llvm-svn: 316416
Martin Storsjo [Tue, 24 Oct 2017 07:16:40 +0000 (07:16 +0000)]
Add missing checks for register number
Most other cases that touch savedRegisters[reg] have got this check,
but these three seemed to lack it.
Differential Revision: https://reviews.llvm.org/D39206
llvm-svn: 316415
Bruno Cardoso Lopes [Tue, 24 Oct 2017 06:18:52 +0000 (06:18 +0000)]
[Modules] Add module for Config/llvm-config.h
Besides all the goodness from modularizing a header, this is necessary
to compile ToT with modules with the clang host compiler from Xcode 9 in
macOS 10.13, which our bots don't use yet.
rdar://problem/
35038151
llvm-svn: 316414
Omer Paparo Bivas [Tue, 24 Oct 2017 06:16:03 +0000 (06:16 +0000)]
[MC] Adding code padding for performance stability - infrastructure. NFC.
Infrastructure designed for padding code with nop instructions in key places such that preformance improvement will be achieved.
The infrastructure is implemented such that the padding is done in the Assembler after the layout is done and all IPs and alignments are known.
This patch by itself in a NFC. Future patches will make use of this infrastructure to implement required policies for code padding.
Reviewers:
aaboud
zvi
craig.topper
gadi.haber
Differential revision: https://reviews.llvm.org/D34393
Change-Id: I92110d0c0a757080a8405636914a93ef6f8ad00e
llvm-svn: 316413
Zvi Rackover [Tue, 24 Oct 2017 05:47:07 +0000 (05:47 +0000)]
X86: Register the X86CallFrameOptimization pass
Summary:
The motivation of this change is to enable .mir testing for this pass.
Added one test case to cover the functionality, this same case will be improved by
a future patch.
Reviewers: igorb, guyblank, DavidKreitzer
Reviewed By: guyblank, DavidKreitzer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38729
llvm-svn: 316412
Tim Shen [Tue, 24 Oct 2017 03:11:02 +0000 (03:11 +0000)]
[test] Fix clang-test for FreeBSD and NetBSD
Lit tries to inject the shared library paths, but no action is taken
when platform.system() is not recognized, results in an environment
variable with an empty name, which is illegal.
The patch fixes this mechanism for FreeBSD and NetBSD, and gives an
warning on other platforms, so that the latecomers don't have to spend
time on debugging lit.
Thanks Zhihao Yuan for the patch!
Differential Revision: https://reviews.llvm.org/D39162
llvm-svn: 316411
Dean Michael Berris [Tue, 24 Oct 2017 02:43:49 +0000 (02:43 +0000)]
[XRay][compiler-rt] More fixups.
Follow-up to D39175.
llvm-svn: 316410
Dean Michael Berris [Tue, 24 Oct 2017 02:36:32 +0000 (02:36 +0000)]
[XRay][compiler-rt] Fixup shadowing
Follow-up to D39175.
llvm-svn: 316409
Jordan Rose [Tue, 24 Oct 2017 02:17:07 +0000 (02:17 +0000)]
Unnamed bitfields don't block constant evaluation of constexpr ctors
C++14 [dcl.constexpr]p4 states that in the body of a constexpr
constructor,
> every non-variant non-static data member and base class sub-object
shall be initialized
However, [class.bit]p2 notes that
> Unnamed bit-fields are not members and cannot be initialized.
Therefore, we should make sure to filter them out of the check that
all fields are initialized.
Fixing this makes the constant evaluator a bit smarter, and
specifically allows constexpr constructors to avoid tripping
-Wglobal-constructors when the type contains unnamed bitfields.
Reviewed at https://reviews.llvm.org/D39035.
llvm-svn: 316408
Daniel Sanders [Tue, 24 Oct 2017 01:48:34 +0000 (01:48 +0000)]
[globalisel][tablegen] Remove unused InstructionMatcher's. NFC
llvm-svn: 316407
Dean Michael Berris [Tue, 24 Oct 2017 01:39:59 +0000 (01:39 +0000)]
[XRay][compiler-rt] Remove C++ STL from the buffer queue implementation
Summary:
This change removes the dependency on C++ standard library
types/functions in the implementation of the buffer queue. This is an
incremental step in resolving llvm.org/PR32274.
Reviewers: dblaikie, pelikan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39175
llvm-svn: 316406
Erich Keane [Tue, 24 Oct 2017 01:39:56 +0000 (01:39 +0000)]
Fix template parameter default args missed if redecled
This bug was found via self-build on lld, and worked around
here: https://reviews.llvm.org/rL316180
The issue is that the 'using' causes the lookup to pick up the
first decl. However, when setting inherited default parameters,
we only update 'forward', not 'backward'. SO, only the newest param
list has all the information about the default arguments.
This patch ensures that the list of parameters we look through checks
the newest decl's template parameter list so it doesn't miss a default.
Differential Revision: https://reviews.llvm.org/D39127
llvm-svn: 316405
Bob Haarman [Tue, 24 Oct 2017 01:26:22 +0000 (01:26 +0000)]
[raw_fd_ostream] report actual error in error messages
Summary:
Previously, we would emit error messages like "IO failure on output
stream". This change causes use to include information about what
actually went wrong, e.g. "No space left on device".
Reviewers: sunfish, rnk
Reviewed By: rnk
Subscribers: mehdi_amini, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D39203
llvm-svn: 316404
George Karpenkov [Tue, 24 Oct 2017 01:09:43 +0000 (01:09 +0000)]
[Analyzer] Fix for the memory leak: fix typo in if-statement.
llvm-svn: 316403
George Karpenkov [Tue, 24 Oct 2017 00:13:18 +0000 (00:13 +0000)]
[Analyzer] Handle implicit function reference in bodyfarming std::call_once
Differential Revision: https://reviews.llvm.org/D39201
llvm-svn: 316402
Saleem Abdulrasool [Tue, 24 Oct 2017 00:09:10 +0000 (00:09 +0000)]
ObjCARC: do not increment past the end of the BB
The `BasicBlock::getFirstInsertionPt` call may return `std::end` for the
BB. Dereferencing the end iterator results in an assertion failure
"(!NodePtr->isKnownSentinel()), function operator*". Ensure that the
returned iterator is valid before dereferencing it. If the end is
returned, move one position backward to get a valid insertion point.
llvm-svn: 316401
George Karpenkov [Mon, 23 Oct 2017 23:59:52 +0000 (23:59 +0000)]
[Analyzer] Do not use static storage to for implementations created in BodyFarm.cpp
Differential Revision: https://reviews.llvm.org/D39208
llvm-svn: 316400
Alexander Shaposhnikov [Mon, 23 Oct 2017 23:46:06 +0000 (23:46 +0000)]
[analyzer] Fix handling of labels in getLValueElement
In getLValueElement Base may represent the address of a label
(as in the newly-added test case), in this case it's not a loc::MemRegionVal
and Base.castAs<loc::MemRegionVal>() triggers an assert, this diff makes
getLValueElement return UnknownVal instead.
Differential revision: https://reviews.llvm.org/D39174
llvm-svn: 316399
Reid Kleckner [Mon, 23 Oct 2017 23:43:40 +0000 (23:43 +0000)]
[codeview] Add support for inlinee lists
This adds type index discovery and dumper support for symbol record kind
0x1168, which is a list of inlined function ids. This symbol kind is
undocumented, but S_INLINEES is consistent with the existing
nomenclature.
Fixes PR34222
llvm-svn: 316398
Justin Lebar [Mon, 23 Oct 2017 23:42:05 +0000 (23:42 +0000)]
[PM] Fix Typo
Patch by Nick Sarnie.
llvm-svn: 316397
Jessica Paquette [Mon, 23 Oct 2017 23:36:46 +0000 (23:36 +0000)]
[MachineOutliner] Add optimisation remarks for successful outlining
This commit adds optimisation remarks for outlining which fire when a function
is successfully outlined.
To do this, OutlinedFunctions must now contain references to their Candidates.
Since the Candidates must still be sorted and worked on separately, this is
done by working on everything in terms of shared_ptrs to Candidates. This is
good; it means that we can easily move everything to outlining in terms of
the OutlinedFunctions rather than the individual Candidates. This is far more
intuitive than what's currently there!
(Remarks are output when a function is created for some group of Candidates.
In a later commit, all of the outlining logic should be rewritten so that we
loop over OutlinedFunctions rather than over Candidates.)
llvm-svn: 316396
Alex Shlyapnikov [Mon, 23 Oct 2017 23:24:33 +0000 (23:24 +0000)]
[Sanitizers-libFuzzer] Addressing coding style issues.
Summary: The result of clang-format and few manual changes (as prompted on D39155).
Reviewers: vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39211
llvm-svn: 316395
Marshall Clow [Mon, 23 Oct 2017 23:19:30 +0000 (23:19 +0000)]
More fuzzing interfaces
llvm-svn: 316394
Davide Italiano [Mon, 23 Oct 2017 23:17:53 +0000 (23:17 +0000)]
[lldbtests] Handle errors instead of crashing.
If you pass an invalid compiler/debugger path on the cmdline to `dotest.py` this is what you get.
Traceback (most recent call last):
[...]
File "dotest.py", line 7, in <module>
lldbsuite.test.run_suite()
[...]
And with the patch applied:
/home/davide/work/build-lldb/bin/clandasfasg is not a valid path, exiting
Differential Revision: https://reviews.llvm.org/D39199
llvm-svn: 316393
Reid Kleckner [Mon, 23 Oct 2017 23:15:40 +0000 (23:15 +0000)]
[PDB] Add test for S_THUNK32 records
I locally reverted r316385 and confirmed that this test fails without
it.
Really fixes the cause of PR35014.
llvm-svn: 316392
Pavel Labath [Mon, 23 Oct 2017 23:15:37 +0000 (23:15 +0000)]
Use ipv4 localhost address in lldb-server tests
Since the ipv6 patch, we've experienced occasional flakyness in
lldb-server tests. This was due to the fact that lldb-server was trying
to listen on both v4 and v6 localhost sockets (and consider it a success
if at least one of them succeeded), while the test framework was only
trying to connect to the v4 one.
This change makes sure lldb-server only listens on the v4 socket.
llvm-svn: 316391
Davide Italiano [Mon, 23 Oct 2017 23:14:17 +0000 (23:14 +0000)]
[Symbol] Remove dead code. NFCI.
llvm-svn: 316390
Konstantin Zhuravlyov [Mon, 23 Oct 2017 23:02:39 +0000 (23:02 +0000)]
AMDGPU: Initialize WavefrontSize from TD files
Differential Revision: https://reviews.llvm.org/D39205
llvm-svn: 316389
Aditya Nandakumar [Mon, 23 Oct 2017 22:53:08 +0000 (22:53 +0000)]
[GISel][ARM]: Fix illegal Generic copies in tests
This is in preparation for a verifier check that makes sure
copies are of the same size (when generic virtual registers are involved).
llvm-svn: 316388
Aditya Nandakumar [Mon, 23 Oct 2017 22:53:04 +0000 (22:53 +0000)]
[GISel][AArch64]: Fix illegal Generic copies in tests
This is in preparation for a verifier check that makes sure copies are
of the same size (when generic virtual registers are involved).
llvm-svn: 316387
Reid Kleckner [Mon, 23 Oct 2017 22:44:51 +0000 (22:44 +0000)]
[PDB] Fix logging of bad type indices
llvm-svn: 316386
Reid Kleckner [Mon, 23 Oct 2017 22:44:24 +0000 (22:44 +0000)]
[codeview] Recognize two records with no type index fields
Thunk records do not have types and frame cookies do not have types.
These were found while linking libconcrt.lib from MSVC.
llvm-svn: 316385
Rong Xu [Mon, 23 Oct 2017 22:21:29 +0000 (22:21 +0000)]
[PM] Add pgo-memop-opt pass to the new pass manager
This pass adds pgo-memop-opt pass to the new pass manager.
It is in the old pass manager but somehow left out in the new pass manager.
Differential Revision: http://reviews.llvm.org/D39145
llvm-svn: 316384
Simon Pilgrim [Mon, 23 Oct 2017 22:05:02 +0000 (22:05 +0000)]
[X86][SSE] combineBitcastvxi1 - use PACKSSWB directly to pack v8i16 to v16i8
Avoid difficulties determining the number of sign bits later on in shuffle lowering to lower to PACKSS
llvm-svn: 316383
Alex Shlyapnikov [Mon, 23 Oct 2017 22:04:30 +0000 (22:04 +0000)]
[libFuzzer] Periodically purge allocator's quarantine to prolong fuzzing sessions.
Summary:
Fuzzing targets that allocate/deallocate a lot of memory tend to consume
a lot of RSS when ASan quarantine is enabled. Purging quarantine between
iterations and returning memory to OS keeps RSS down and should not
reduce the quarantine effectiveness provided the fuzz target does not
preserve state between iterations (in this case this feature can be turned off).
Based on D39153.
Reviewers: vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39155
llvm-svn: 316382
Volodymyr Sapsai [Mon, 23 Oct 2017 22:01:41 +0000 (22:01 +0000)]
[Sema] Add support for flexible array members in Obj-C.
Allow Obj-C ivars with incomplete array type but only as the last ivar.
Also add a requirement for ivars that contain a flexible array member to
be at the end of class too. It is possible to add in a subclass another
ivar at the end but we'll emit a warning in this case. Also we'll emit a
warning if a variable sized ivar is declared in class extension or in
implementation because subclasses won't know they should avoid adding
new ivars.
In ARC incomplete array objects are treated as __unsafe_unretained so
require them to be marked as such.
Prohibit synthesizing ivars with flexible array members because order of
synthesized ivars is not obvious and tricky to control. Spelling out
ivar explicitly gives control to developers and helps to avoid surprises
with unexpected ivar ordering.
For C and C++ changed diagnostic to tell explicitly a field is not the
last one and point to the next field. It is not as useful as in Obj-C
but it is an improvement and it is consistent with Obj-C. For C for
unions emit more specific err_flexible_array_union instead of generic
err_field_incomplete.
rdar://problem/
21054495
Reviewers: rjmccall, theraven
Reviewed By: rjmccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38773
llvm-svn: 316381
Bob Wilson [Mon, 23 Oct 2017 21:51:50 +0000 (21:51 +0000)]
Add a new Simulator entry for the target triple environment.
Apple's iOS, tvOS and watchOS simulator platforms have never been clearly
distinguished in the target triples. Even though they are intended to
behave similarly to the corresponding device platforms, they have separate
SDKs and are really separate platforms from the compiler's perspective.
Clang now defines a macro when building for one of these simulator platforms
(r297866) but that relies on the very indirect mechanism of checking to see
which option was used to specify the minimum deployment target. That is not
so great. Swift would also like to distinguish these simulator platforms in
a similar way, but unlike Clang, Swift does not use a separate option to
specify the minimum deployment target -- it uses a -target option to
specify the target triple directly, including the OS version number.
Using a different target triple for the simulator platforms is a much
more direct and obvious way to specify this. Putting the "simulator" in
the environment component of the triple means the OS values can stay the
same and existing code the looks at the OS field will not be affected.
https://reviews.llvm.org/D39143
rdar://problem/
34729432
llvm-svn: 316380
Petr Hosek [Mon, 23 Oct 2017 21:31:05 +0000 (21:31 +0000)]
[Driver] Use ld.lld directly for Fuchsia rather than passing flavor
Passing a flavor to LLD requires command line argument, but if these
are being passed through a response file, this will fail because LLD
needs to know which driver to use before processing the response file.
Use ld.lld directly instead to avoid this issue.
Differential Revision: https://reviews.llvm.org/D39176
llvm-svn: 316379
Rafael Espindola [Mon, 23 Oct 2017 21:12:19 +0000 (21:12 +0000)]
Make Ctx a plain pointer again.
If a struct has a std::unique_ptr member, the logical interpretation
is that that member will be destroyed with the struct.
That is not the case for Ctx. It is has to be deleted earlier and its
lifetime is defined by the functions where the AddressState is
created.
llvm-svn: 316378
George Burgess IV [Mon, 23 Oct 2017 21:08:02 +0000 (21:08 +0000)]
Fix buildbot breakage
SP is only used in an assert. Caused by r316374.
llvm-svn: 316377