Greg Clayton [Fri, 7 Feb 2014 19:21:56 +0000 (19:21 +0000)]
Fix a bug where we will crash if we have a class "B" that is contained inside a class "A" in the DWARF where "A" is a forward declaration.
<rdar://problem/
14673945>
<rdar://problem/
15682781>
llvm-svn: 200985
Enrico Granata [Fri, 7 Feb 2014 19:21:09 +0000 (19:21 +0000)]
rdar://
15648942
Provide a filter for libc++ std::atomic<T>
This just hides some implementation clutter and promotes the actual content to only child status
llvm-svn: 200984
Rafael Espindola [Fri, 7 Feb 2014 19:04:43 +0000 (19:04 +0000)]
Don't internalize linkonce_odr non constant variables.
llvm-svn: 200983
Ben Langmuir [Fri, 7 Feb 2014 17:56:29 +0000 (17:56 +0000)]
Fix test from r200979 on non-Darwin systems
Add a darwin triple to get the behaviour from isysroot that the test
expects.
llvm-svn: 200982
Alexander Kornienko [Fri, 7 Feb 2014 17:42:30 +0000 (17:42 +0000)]
Fix an invalid check for duplicate option categories.
An intermediate solution until the problems with analyzer plugins linking with
llvm/Support and causing assertions due to duplicate GeneralCategory are solved.
llvm-svn: 200981
Jordan Rose [Fri, 7 Feb 2014 17:35:04 +0000 (17:35 +0000)]
[analyzer] Just silence all warnings coming out of std::basic_string.
This means always walking the whole call stack for the end path node, but
we'll assume that's always fairly tractable.
<rdar://problem/
15952973>
llvm-svn: 200980
Ben Langmuir [Fri, 7 Feb 2014 17:31:11 +0000 (17:31 +0000)]
Stat system dependencies when using -verify-pch
We don't stat the system headers to check for stalenes during regular
PCH loading for performance reasons. When explicitly saying
-verify-pch, we want to check all the dependencies - user or system.
llvm-svn: 200979
Sasa Stankovic [Fri, 7 Feb 2014 17:16:40 +0000 (17:16 +0000)]
[mips] Forbid the use of registers t6, t7 and t8 if the target is NaCl.
Differential Revision: http://llvm-reviews.chandlerc.com/D2694
llvm-svn: 200978
Rafael Espindola [Fri, 7 Feb 2014 16:21:30 +0000 (16:21 +0000)]
Fix a bug with .weak_def_can_be_hidden: Mutable variables cannot use it.
Thanks to John McCall for noticing it.
llvm-svn: 200977
Rafael Espindola [Fri, 7 Feb 2014 16:07:11 +0000 (16:07 +0000)]
Refactor logic into a function predicate.
No functionality change.
llvm-svn: 200976
Dmitri Gribenko [Fri, 7 Feb 2014 15:00:22 +0000 (15:00 +0000)]
ASTUnit: ArrayRef'ize RemappedFiles
llvm-svn: 200975
Daniel Jasper [Fri, 7 Feb 2014 13:45:27 +0000 (13:45 +0000)]
clang-format: Fix column limit violation for merged lines in macros.
Before (81 columns):
#define A \
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() { return
aaaaaaaa; } \
int i;
After:
#define A \
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() { \
return
aaaaaaaa; \
} \
int i;
llvm-svn: 200974
Benjamin Kramer [Fri, 7 Feb 2014 12:05:36 +0000 (12:05 +0000)]
Try to unbreak the mingw32 build.
llvm-svn: 200973
Dmitry Vyukov [Fri, 7 Feb 2014 11:48:06 +0000 (11:48 +0000)]
tsan: improve the test
remove TSAN_OPTIONS from the test, so that it runs in the presubmit script
add a CHECK, so that it can run with FileCheck as well
llvm-svn: 200972
Oliver Stannard [Fri, 7 Feb 2014 11:25:57 +0000 (11:25 +0000)]
Fix AAPCS compliance for HFAs containing doubles and long doubles
An HFA is defined as a struct containing floating point values of the
same machine type. In the 32-bit ABI, double and long double have the
same machine type, so a struct with a mixture of these types must be an
HFA (assuming it meets the other criteria).
llvm-svn: 200971
Oliver Stannard [Fri, 7 Feb 2014 11:19:53 +0000 (11:19 +0000)]
LLVM-1163: AAPCS-VFP violation when CPRC allocated to stack
According to the AAPCS, when a CPRC is allocated to the stack, all other
VFP registers should be marked as unavailable.
I have also modified the rules for allocating non-CPRCs to the stack, to make
it more explicit that all GPRs must be made unavailable. I cannot think of a
case where the old version would produce incorrect answers, so there is no test
for this.
llvm-svn: 200970
Sasa Stankovic [Fri, 7 Feb 2014 11:16:02 +0000 (11:16 +0000)]
Changed comment.
llvm-svn: 200969
Daniel Jasper [Fri, 7 Feb 2014 10:09:46 +0000 (10:09 +0000)]
clang-format: Fix range-based for-loop formatting.
Before:
for (
aaaaaaaaa aaaaaaaaaaaaaaaaaaaaa :
aaaaaaaaaaaa.
aaaaaaaaaaaa()
.
aaaaaaaaa()
.a()) {
}
After:
for (
aaaaaaaaa aaaaaaaaaaaaaaaaaaaaa :
aaaaaaaaaaaa.
aaaaaaaaaaaa().
aaaaaaaaa().a()) {
}
llvm-svn: 200968
Dmitri Gribenko [Fri, 7 Feb 2014 09:31:00 +0000 (09:31 +0000)]
Document return value for FileManager::getNoncachedStatValue()
llvm-svn: 200967
Dmitry Vyukov [Fri, 7 Feb 2014 09:28:57 +0000 (09:28 +0000)]
tsan: run user OnInitialize callback later
when global and thread state are initialized,
this allows to do more things in the callback.
llvm-svn: 200966
Venkatraman Govindaraju [Fri, 7 Feb 2014 09:06:52 +0000 (09:06 +0000)]
[Sparc] Add support for parsing synthetic instruction 'mov'.
llvm-svn: 200965
Argyrios Kyrtzidis [Fri, 7 Feb 2014 08:33:28 +0000 (08:33 +0000)]
Revert r194097: "With this patch -Wwrite-strings is still implemented with the terrible
hack of passing -fconst-strings to -cc1"
Passing or not a language option based on diagnostic settings is a bad idea, it breaks
using a PCH that was compiled with different diagnostic settings.
Also add a test case to make sure we don't regress.
llvm-svn: 200964
Venkatraman Govindaraju [Fri, 7 Feb 2014 07:34:49 +0000 (07:34 +0000)]
[Sparc] Emit correct encoding for atomic instructions. Also, add support for parsing CAS instructions to test the CAS encoding.
llvm-svn: 200963
Venkatraman Govindaraju [Fri, 7 Feb 2014 05:54:20 +0000 (05:54 +0000)]
[Sparc] Emit relocations for Thread Local Storage (TLS) when integrated assembler is used.
llvm-svn: 200962
Venkatraman Govindaraju [Fri, 7 Feb 2014 04:24:35 +0000 (04:24 +0000)]
[Sparc] Emit correct relocations for PIC code when integrated assembler is used.
llvm-svn: 200961
Venkatraman Govindaraju [Fri, 7 Feb 2014 02:36:06 +0000 (02:36 +0000)]
[Sparc] Use SparcMCExpr::VariantKind itself as MachineOperand's target flags.
llvm-svn: 200960
David Majnemer [Fri, 7 Feb 2014 00:43:07 +0000 (00:43 +0000)]
MS ABI: Don't be so hasty to judge an inheritance model
If we are in the middle of defining the class, don't attempt to
validate previously annotated declarations. We may not have seen base
specifiers or virtual method declarations yet.
llvm-svn: 200959
Manman Ren [Fri, 7 Feb 2014 00:38:56 +0000 (00:38 +0000)]
PGO branch weight: fix PR18752.
Fix a bug triggered in IfConverterTriangle when CvtBB has multiple predecessors
by getting the weights before removing a successor.
llvm-svn: 200958
Jim Grosbach [Fri, 7 Feb 2014 00:16:33 +0000 (00:16 +0000)]
X86: Resolve a long standing FIXME and properly isel pextr[bw].
Generalize the AArch64 .td nodes for AssertZext and AssertSext. Use
them to match the relevant pextr store instructions.
The test widen_load-2.ll requires a slight change because with the
stores gone, the remaining instructions are scheduled in a different
order.
Add test cases for SSE4 and AVX variants.
Resolves rdar://
13414672.
Patch by Adam Nemet <anemet@apple.com>.
llvm-svn: 200957
Nick Kledzik [Thu, 6 Feb 2014 23:48:52 +0000 (23:48 +0000)]
[mach-o] use new way to copy StringRefs
llvm-svn: 200956
Rafael Espindola [Thu, 6 Feb 2014 23:35:22 +0000 (23:35 +0000)]
Convert test to FileCheck.
llvm-svn: 200955
Richard Smith [Thu, 6 Feb 2014 23:35:16 +0000 (23:35 +0000)]
Temporary fix for PR18473: Don't try to evaluate the initializer for a
type-dependent variable, even if the initializer isn't value-dependent. This
happens for ParenListExprs composed of non-value-dependent subexpressions, for
instance.
We should really give ParenListExprs (and InitListExprs) the type of the
initialized entity if they're used to represent a dependent initialization (and
if so, set them to be type-, value- and instantiation-dependent).
llvm-svn: 200954
Richard Trieu [Thu, 6 Feb 2014 23:26:23 +0000 (23:26 +0000)]
Fixes PR18762, stop the StmtPrinter for ObjCPropertyRefExpr from crashing on
certain receiver types.
llvm-svn: 200953
Nick Lewycky [Thu, 6 Feb 2014 22:57:16 +0000 (22:57 +0000)]
The diagnostic printer expects the LangOptions to still be alive. Give it one that lives at least as long as all the uses of it. This is still wrong though, we should be passing in the correct LangOpts for a given source file.
llvm-svn: 200952
Sean Callanan [Thu, 6 Feb 2014 22:25:20 +0000 (22:25 +0000)]
Lock the JIT before using it.
<rdar://problem/
15958296>
llvm-svn: 200951
Sean Callanan [Thu, 6 Feb 2014 22:24:11 +0000 (22:24 +0000)]
Removed spurious lookup of the $__lldb_expr
selector when compiling an expression in an
Objective-C context.
<rdar://problem/
15797390>
llvm-svn: 200950
Peter Collingbourne [Thu, 6 Feb 2014 21:52:24 +0000 (21:52 +0000)]
Add isListInitialization matcher.
Differential Revision: http://llvm-reviews.chandlerc.com/D2708
llvm-svn: 200949
Richard Smith [Thu, 6 Feb 2014 21:49:08 +0000 (21:49 +0000)]
PR18128: a lambda capture-default is not permitted for a non-local lambda
expression.
llvm-svn: 200948
Quentin Colombet [Thu, 6 Feb 2014 21:44:56 +0000 (21:44 +0000)]
[CodeGenPrepare] Move away sign extensions that get in the way of addressing
mode.
Basically the idea is to transform code like this:
%idx = add nsw i32 %a, 1
%sextidx = sext i32 %idx to i64
%gep = gep i8* %myArray, i64 %sextidx
load i8* %gep
Into:
%sexta = sext i32 %a to i64
%idx = add nsw i64 %sexta, 1
%gep = gep i8* %myArray, i64 %idx
load i8* %gep
That way the computation can be folded into the addressing mode.
This transformation is done as part of the addressing mode matcher.
If the matching fails (not profitable, addressing mode not legal, etc.), the
matcher will revert the related promotions.
<rdar://problem/
15519855>
llvm-svn: 200947
Joerg Sonnenberger [Thu, 6 Feb 2014 21:04:32 +0000 (21:04 +0000)]
Use correct ld emulation for EABI hardware float triple on NetBSD.
llvm-svn: 200946
Sergey Matveev [Thu, 6 Feb 2014 20:39:33 +0000 (20:39 +0000)]
[sanitizer] Intercept if_indextoname() and if_nametoindex().
llvm-svn: 200945
James Dennett [Thu, 6 Feb 2014 20:16:05 +0000 (20:16 +0000)]
Fix indentation of a code example in LibTooling's documentation.
llvm-svn: 200944
Greg Clayton [Thu, 6 Feb 2014 20:10:16 +0000 (20:10 +0000)]
Implement ObjectFileMachO::SetLoadAddress().
llvm-svn: 200943
Sergey Matveev [Thu, 6 Feb 2014 19:36:10 +0000 (19:36 +0000)]
[sanitizer] Fix build.
llvm-svn: 200942
Andrew Trick [Thu, 6 Feb 2014 19:20:41 +0000 (19:20 +0000)]
Track register pressure a bit more carefully (weird corner case).
This solves a problem where a def machine operand has no uses but has
not been marked dead. In this case, the initial RP analysis was being
extra precise and determining from LiveIntervals the the register was
actually dead. This caused us to omit the register from the RP
tracker's block live out. That's all good, but the per-instruction
summary still accounted for it as a valid def. This could cause an
assertion in the tracker later when we underflow pressure.
This is from a bug report on an out-of-tree target. It is not
reproducible on well-behaved targets. I'm just making an obvious fix
without unit test.
llvm-svn: 200941
David Majnemer [Thu, 6 Feb 2014 19:14:16 +0000 (19:14 +0000)]
Silence build-bots from the fallout of r200921
llvm-svn: 200940
Steve Pucci [Thu, 6 Feb 2014 19:02:19 +0000 (19:02 +0000)]
Factor some methods that were in DynamicLoaderPOSIXDYLD.
Move some code that was in DynamicLoaderPOSIXDLYD into the
base class DynamicLoader. In the case of UpdateLoadedSections(),
the test to see whether a file is loadable (its address is zero)
is not generally applicable so that test is changed to a more
universally applicable check for the SHF_ALLOC flag on the section.
Also make it explicit that the reading of the module_id in
DynamicLoaderPOSIXDYLD::GetThreadLocalData() is using a hardcoded
size (of module_id) of 4, which might not be appropriate on
big-endian 64-bit systems, leaving a FIXME comment in place.
llvm-svn: 200939
Ben Langmuir [Thu, 6 Feb 2014 18:53:25 +0000 (18:53 +0000)]
Move -verify-pch to use VerifyJobAction
Use the verify hook rather than the compile hook to represent the
-verify-pch action, and move the exising --verify-debug-info action
into its own subclass of VerifyJobAction. Incidentally change the name
printed by -ccc-print-phases for --verify-debug-info.
llvm-svn: 200938
Evan Cheng [Thu, 6 Feb 2014 18:51:34 +0000 (18:51 +0000)]
Revert r200095 and r200152. It turns out when compiling with -arch armv7 -mcpu=cortex-m3, the triple would still set iOS as the OS so the hack is still needed. rdar://
15984891
llvm-svn: 200937
Sergey Matveev [Thu, 6 Feb 2014 18:48:23 +0000 (18:48 +0000)]
[sanitizer] One does not simply intercept getifaddrs().
Upgrade the interceptor, and attempt to fix the Android build.
llvm-svn: 200936
Tom Stellard [Thu, 6 Feb 2014 18:36:41 +0000 (18:36 +0000)]
R600/SI: Add a MUBUF store pattern for Reg+Imm offsets
llvm-svn: 200935
Tom Stellard [Thu, 6 Feb 2014 18:36:39 +0000 (18:36 +0000)]
R600/SI: Add a MUBUF store pattern for Imm offsets
llvm-svn: 200934
Tom Stellard [Thu, 6 Feb 2014 18:36:38 +0000 (18:36 +0000)]
R600/SI: Add a MUBUF load pattern for Reg+Imm offsets
llvm-svn: 200933
Tom Stellard [Thu, 6 Feb 2014 18:36:34 +0000 (18:36 +0000)]
R600/SI: Use immediates offsets for SMRD instructions whenever possible
There was a problem with the old pattern, so we were copying some
larger immediates into registers when we could have been encoding
them in the instruction.
llvm-svn: 200932
Quentin Colombet [Thu, 6 Feb 2014 18:30:43 +0000 (18:30 +0000)]
Wired-up the new LLVM diagnostic system into clang diagnostic system.
The approach is similar to the existing inline-asm reporting, just more
general.
<rdar://problem/
15886278>
llvm-svn: 200931
Greg Clayton [Thu, 6 Feb 2014 18:22:44 +0000 (18:22 +0000)]
The "-n" and "-p" options to the lldb driver no longer worked after recent IOHandler changes, this is now fixed.
<rdar://problem/
15962763>
llvm-svn: 200930
David Peixotto [Thu, 6 Feb 2014 18:19:40 +0000 (18:19 +0000)]
Remove const_cast for STI when parsing inline asm
In a previous commit (r199818) we added a const_cast to an existing
subtarget info instead of creating a new one so that we could reuse
it when creating the TargetAsmParser for parsing inline assembly.
This cast was necessary because we needed to reuse the existing STI
to avoid generating incorrect code when the inline asm contained
mode-switching directives (e.g. .code 16).
The root cause of the failure was that there was an implicit sharing
of the STI between the parser and the MCCodeEmitter. To fix a
different but related issue, we now explicitly pass the STI to the
MCCodeEmitter (see commits r200345-r200351).
The const_cast is no longer necessary and we can now create a fresh
STI for the inline asm parser to use.
Differential Revision: http://llvm-reviews.chandlerc.com/D2709
llvm-svn: 200929
Tim Northover [Thu, 6 Feb 2014 18:18:36 +0000 (18:18 +0000)]
X86: add costs for 64-bit vector ext/trunc & rebalance
The most important part of this is probably adding any cost at all for
operations like zext <8 x i8> to <8 x i32>. Before they were being
recorded as extremely costly (24, I believe) which made LLVM fall back
on a 4-wide vectorisation of a loop.
It also rebalances the values for sext, zext and trunc. Lacking any
other sane metric that might work across CPU microarchitectures I went
for instructions. This seems to be in reasonable accord with the rest
of the table (sitofp, ...) though no doubt at least one value is
sub-optimal for some bizarre reason.
Finally, separate AVX and AVX2 values are provided where appropriate.
The CodeGen is quite different in many cases.
rdar://problem/
15981990
llvm-svn: 200928
Eli Bendersky [Thu, 6 Feb 2014 18:01:56 +0000 (18:01 +0000)]
Add a -suppress-warnings option to bitcode linking.
llvm-svn: 200927
Sergey Matveev [Thu, 6 Feb 2014 17:42:36 +0000 (17:42 +0000)]
[sanitizer] Intercept getifaddrs().
llvm-svn: 200926
Sergey Matveev [Thu, 6 Feb 2014 15:12:56 +0000 (15:12 +0000)]
[sanitizer] Intercept getresuid and getresgid.
llvm-svn: 200925
Alexander Kornienko [Thu, 6 Feb 2014 14:50:10 +0000 (14:50 +0000)]
Improve clang-tidy diagnostic output and filtering.
Summary:
This patch introduces several improvements to clang-tidy diagnostic;
1. Make filtering of messages from non-user code more reliable. Output an
error when it or any of the related notes touches user code. This fixes an
assertion when an error has a location in a system header, and one of the
notes relates to user code.
2. In order for 1. to work, subscribe to the static analyzer diagnostics using
a custom PathDiagnosticConsumer.
3. Enable colors on supported terminals.
4. Output FixItHints.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2714
llvm-svn: 200924
Alexander Potapenko [Thu, 6 Feb 2014 14:06:12 +0000 (14:06 +0000)]
[TSan] Add a regression test for https://code.google.com/p/thread-sanitizer/issues/detail?id=47
llvm-svn: 200923
Alexander Potapenko [Thu, 6 Feb 2014 13:37:14 +0000 (13:37 +0000)]
[TSan] Don't flush all file streams on program shutdown to avoid deadlocks on file stream locks.
This should fix https://code.google.com/p/thread-sanitizer/issues/detail?id=47.
llvm-svn: 200922
David Majnemer [Thu, 6 Feb 2014 12:46:52 +0000 (12:46 +0000)]
MS ABI: Handle indirect field decls in template args
Properly support fields that come from anonymous unions and structs
when used as template arguments for pointer to data member params.
llvm-svn: 200921
David Majnemer [Thu, 6 Feb 2014 10:59:19 +0000 (10:59 +0000)]
MS ABI: Tweak pointer-to-member mangling/inheritance model selection
Properly determine the inheritance model when dealing with nullptr:
- If a nullptr template argument is being checked against
pointer-to-member parameter, nail down an inheritance model.
N.B. We will chose an inheritance model even if we won't ultimately
choose the template to instantiate! Cooky, right?
- Null pointer-to-datamembers have a virtual base table offset of -1,
not zero. Previously, we chose an offset of 0.
llvm-svn: 200920
Puyan Lotfi [Thu, 6 Feb 2014 09:57:39 +0000 (09:57 +0000)]
Yet another patch to reduce compile time for small programs:
The aim in this patch is to reduce work that VirtRegRewriter needs to do when
telling MachineRegisterInfo which physregs are in use. Up until now
VirtRegRewriter::rewrite has been doing rewriting and populating def info and
then proceeding to set whether a physreg is used based this info for every
physreg that the target provides. This can be expensive when a target has an
unusually high number of supported physregs, and is a noticeable chunk of
compile time for small programs on such targets.
So to reduce compile time, this patch simply adds the use of a SparseSet to the
rewrite function that is used to flag each physreg that is encountered in a
MachineFunction. Afterward, rather than iterating over the set of all physregs
for a given target to set the physregs used in MachineRegisterInfo, the new way
is to iterate over the set of physregs that were actually encountered and set
in the SparseSet. This improves compile time because the existing rewrite
function was iterating over all MachineOperands already, and because the
iterations afterward to setPhysRegUsed is reduced by use of the SparseSet data.
llvm-svn: 200919
Tim Northover [Thu, 6 Feb 2014 09:54:51 +0000 (09:54 +0000)]
X86: deduplicate V[SZ]EXT_MOVL and V[SZ]EXT nodes
I believe VZEXT_MOVL means "zero all vector elements except the first" (and
should have identical input & output types) whereas VZEXT means "zero extend
each element of a vector (discarding higher elements if necessary)".
For example:
(v4i32 (vzext (v16i8 ...)))
should zero extend the low 4 bytes of the incoming vector to 32-bits,
discarding higher bytes.
However, somewhere in the past, these two concepts had become confused, even
leading to a nonsensical VSEXT_MOVL.
This re-merges the nodes where appropriate (all VSEXT_MOVL -> VSEXT, VZEXT_MOVL
-> VZEXT when it's an actual extension).
rdar://problem/
15981990
llvm-svn: 200918
Puyan Lotfi [Thu, 6 Feb 2014 09:23:24 +0000 (09:23 +0000)]
The following patch' purpose is to reduce compile time for compilation of small
programs on targets with large register files. The root of the compile time
overhead was in the use of llvm::SmallVector to hold PhysRegEntries, which
resulted in slow-down from calling llvm::SmallVector::assign(N, 0). In contrast
std::vector uses the faster __platform_bzero to zero out primitive buffers when
assign is called, while SmallVector uses an iterator.
The fix for this was simply to replace the SmallVector with a dynamically
allocated buffer and to initialize or reinitialize the buffer based on the
total registers that the target architecture requires. The changes support
cases where a pass manager may be reused for different targets, and note that
the PhysRegEntries is allocated using calloc mainly for good for, and also to
quite tools like Valgrind (see comments for more info on this).
There is an rdar to track the fact that SmallVector doesn't have platform
specific speedup optimizations inside of it for things like this, and I'll
create a bugzilla entry at some point soon as well.
TL;DR: This fix replaces the expensive llvm::SmallVector<unsigned
char>::assign(N, 0) with a call to calloc for N bytes which is much faster
because SmallVector's assign uses iterators.
llvm-svn: 200917
Dmitry Vyukov [Thu, 6 Feb 2014 09:23:12 +0000 (09:23 +0000)]
tsan: simplify Go build script
we don't use assembly files
llvm-svn: 200916
Dmitry Vyukov [Thu, 6 Feb 2014 09:22:50 +0000 (09:22 +0000)]
tsan: remove unused functions
llvm-svn: 200915
Dmitry Vyukov [Thu, 6 Feb 2014 09:22:29 +0000 (09:22 +0000)]
tsan: improve error message for Go
llvm-svn: 200914
Puyan Lotfi [Thu, 6 Feb 2014 08:42:01 +0000 (08:42 +0000)]
This small change reduces compile time for small programs on targets that have
large register files. The omission of Queries.clear() is perfectly safe because
LiveIntervalUnion::Query doesn't contain any data that needs freeing and
because LiveRegMatrix::runOnFunction happens to reset the OwningArrayPtr
holding Queries every time it is run, so there's no need to zero out the
queries either. Not having to do this for very large numbers of physregs
is a noticeable constant cost reduction in compilation of small programs.
llvm-svn: 200913
Simon Atanasyan [Thu, 6 Feb 2014 07:35:16 +0000 (07:35 +0000)]
Accept and handle absolute symbols with empty name.
llvm-svn: 200911
Kostya Serebryany [Thu, 6 Feb 2014 07:19:52 +0000 (07:19 +0000)]
[asan] fix testing on Mac
llvm-svn: 200910
NAKAMURA Takumi [Thu, 6 Feb 2014 07:15:59 +0000 (07:15 +0000)]
check-clang: Introduce the feature "utf8-capable-terminal".
clang/test/FixIt/fixit-unicode-with-utf8-output.c has begun complained since LLVM r200885.
Although it is changes for StringRef, it brought LLVM_ON_WIN32 to Support/Locale.cpp.
Before r200885, LLVM_ON_WIN32 was undefined in Locale.cpp!
FIXME: We should consider i18n on win32.
llvm-svn: 200909
Kostya Serebryany [Thu, 6 Feb 2014 06:56:22 +0000 (06:56 +0000)]
[asan] introduce two functions that will allow implementations of C++ garbage colection to work with asan's fake stack
llvm-svn: 200908
Nick Lewycky [Thu, 6 Feb 2014 06:29:19 +0000 (06:29 +0000)]
A memcpy out of an fresh alloca is a no-op, delete it. Patch by Patrick Walton!
llvm-svn: 200907
Craig Topper [Thu, 6 Feb 2014 06:27:59 +0000 (06:27 +0000)]
Delete all of the CodeGenInstructions from CodeGenTarget destructor.
llvm-svn: 200906
Chandler Carruth [Thu, 6 Feb 2014 05:17:02 +0000 (05:17 +0000)]
[PM] Fix horrible typos that somehow didn't cause a failure in a C++11
build but spectacularly changed behavior of the C++98 build. =]
This shows my one problem with not having unittests -- basic API
expectations aren't well exercised by the integration tests because they
*happen* to not come up, even though they might later. I'll probably add
a basic unittest to complement the integration testing later, but
I wanted to revive the bots.
llvm-svn: 200905
Marshall Clow [Thu, 6 Feb 2014 04:47:02 +0000 (04:47 +0000)]
Fix PR17221 - can't catch virtual base classes when throwing derived NULL pointers. Specifically, libc++abi would crash when you tried it.
llvm-svn: 200904
Chandler Carruth [Thu, 6 Feb 2014 04:37:03 +0000 (04:37 +0000)]
[PM] Add a new "lazy" call graph analysis pass for the new pass manager.
The primary motivation for this pass is to separate the call graph
analysis used by the new pass manager's CGSCC pass management from the
existing call graph analysis pass. That analysis pass is (somewhat
unfortunately) over-constrained by the existing CallGraphSCCPassManager
requirements. Those requirements make it *really* hard to cleanly layer
the needed functionality for the new pass manager on top of the existing
analysis.
However, there are also a bunch of things that the pass manager would
specifically benefit from doing differently from the existing call graph
analysis, and this new implementation tries to address several of them:
- Be lazy about scanning function definitions. The existing pass eagerly
scans the entire module to build the initial graph. This new pass is
significantly more lazy, and I plan to push this even further to
maximize locality during CGSCC walks.
- Don't use a single synthetic node to partition functions with an
indirect call from functions whose address is taken. This node creates
a huge choke-point which would preclude good parallelization across
the fanout of the SCC graph when we got to the point of looking at
such changes to LLVM.
- Use a memory dense and lightweight representation of the call graph
rather than value handles and tracking call instructions. This will
require explicit update calls instead of some updates working
transparently, but should end up being significantly more efficient.
The explicit update calls ended up being needed in many cases for the
existing call graph so we don't really lose anything.
- Doesn't explicitly model SCCs and thus doesn't provide an "identity"
for an SCC which is stable across updates. This is essential for the
new pass manager to work correctly.
- Only form the graph necessary for traversing all of the functions in
an SCC friendly order. This is a much simpler graph structure and
should be more memory dense. It does limit the ways in which it is
appropriate to use this analysis. I wish I had a better name than
"call graph". I've commented extensively this aspect.
This is still very much a WIP, in fact it is really just the initial
bits. But it is about the fourth version of the initial bits that I've
implemented with each of the others running into really frustrating
problms. This looks like it will actually work and I'd like to split the
actual complexity across commits for the sake of my reviewers. =] The
rest of the implementation along with lots of wiring will follow
somewhat more rapidly now that there is a good path forward.
Naturally, this doesn't impact any of the existing optimizer. This code
is specific to the new pass manager.
A bunch of thanks are deserved for the various folks that have helped
with the design of this, especially Nick Lewycky who actually sat with
me to go through the fundamentals of the final version here.
llvm-svn: 200903
Chandler Carruth [Thu, 6 Feb 2014 04:32:33 +0000 (04:32 +0000)]
[PM] Back out one hunk of the patch in r200901 that was *supposed* to go
in my next patch. Sorry for the breakage.
llvm-svn: 200902
Chandler Carruth [Thu, 6 Feb 2014 04:25:13 +0000 (04:25 +0000)]
[PM] Wire up the analysis managers in the opt driver. This isn't really
necessary until we add analyses to the driver, but I have such an
analysis ready and wanted to split this out. This is actually exercised
by the existing tests of the new pass manager as the analysis managers
are cross-checked and validated by the function and module managers.
llvm-svn: 200901
Juergen Ributzka [Thu, 6 Feb 2014 04:09:06 +0000 (04:09 +0000)]
[DAG] Don't pull the binary operation though the shift if the operands have opaque constants.
During DAGCombine visitShiftByConstant assumes that certain binary operations
with only constant operands can always be folded successfully. This is no longer
true when the constant is opaque. This commit fixes visitShiftByConstant by not
performing the optimization for opaque constants. Otherwise we would end up in
an infinite DAGCombine loop.
llvm-svn: 200900
Serge Pavlov [Thu, 6 Feb 2014 03:49:11 +0000 (03:49 +0000)]
Allow transformation of VariableArray to ConstantArray.
In the following code:
struct A { static const int sz; };
template<class T> void f() { T arr[A::sz]; }
the array 'arr' is represented as a variable size array in the template.
If 'A::sz' gets value below in the translation unit, the array in
instantiation can turn into constant size array.
This change fixes PR18633.
Differential Revision: http://llvm-reviews.chandlerc.com/D2688
llvm-svn: 200899
Manman Ren [Thu, 6 Feb 2014 01:59:22 +0000 (01:59 +0000)]
Set default of inlinecold-threshold to 225.
225 is the default value of inline-threshold. This change will make sure
we have the same inlining behavior as prior to r200886.
As Chandler points out, even though we don't have code in our testing
suite that uses cold attribute, there are larger applications that do
use cold attribute.
r200886 + this commit intend to keep the same behavior as prior to r200886.
We can later on tune the inlinecold-threshold.
The main purpose of r200886 is to help performance of instrumentation based
PGO before we actually hook up inliner with analysis passes such as BPI and BFI.
For instrumentation based PGO, we try to increase inlining of hot functions and
reduce inlining of cold functions by setting inlinecold-threshold.
Another option suggested by Chandler is to use a boolean flag that controls
if we should use OptSizeThreshold for cold functions. The default value
of the boolean flag should not change the current behavior. But it gives us
less freedom in controlling inlining of cold functions.
llvm-svn: 200898
Richard Smith [Thu, 6 Feb 2014 01:31:33 +0000 (01:31 +0000)]
DR101, PR12770: If a function is declared in the same context as a
using-declaration, and they declare the same function (either because
the using-declaration is in the same namespace as the declaration it
imports, or because they're both extern "C"), they do not conflict.
llvm-svn: 200897
Kevin Enderby [Thu, 6 Feb 2014 01:21:15 +0000 (01:21 +0000)]
Update the X86 assembler for .intel_syntax to accept
the << and >> bitwise operators.
rdar://
15975725
llvm-svn: 200896
Rafael Espindola [Thu, 6 Feb 2014 01:06:31 +0000 (01:06 +0000)]
don't set HasReliableSymbolDifference for ELF.
It is only used in MachObjectWriter.cpp. Another leftover from early days
of ELF in MC.
llvm-svn: 200895
Rafael Espindola [Thu, 6 Feb 2014 00:54:53 +0000 (00:54 +0000)]
doesSectionRequireSymbols is meaningless on ELF, remove.
This is a nop. doesSectionRequireSymbols is only used from
isSymbolLinkerVisible. isSymbolLinkerVisible only use from ELF was in
if (!Asm.isSymbolLinkerVisible(Symbol) && !Symbol.isUndefined())
return false;
if (Symbol.isTemporary())
return false;
If the symbol is a temporary this code returns false and it is irrelevant if
we take the first if or not. If the symbol is not a temporary,
Asm.isSymbolLinkerVisible returns true without ever calling
doesSectionRequireSymbols.
This was an horrible leftover from when support for ELF was first added.
llvm-svn: 200894
Manman Ren [Thu, 6 Feb 2014 00:08:15 +0000 (00:08 +0000)]
Simplify code by combining ifs.
llvm-svn: 200893
Paul Robinson [Thu, 6 Feb 2014 00:07:05 +0000 (00:07 +0000)]
Disable most IR-level transform passes on functions marked 'optnone'.
Ideally only those transform passes that run at -O0 remain enabled,
in reality we get as close as we reasonably can.
Passes are responsible for disabling themselves, it's not the job of
the pass manager to do it for them.
llvm-svn: 200892
Manman Ren [Thu, 6 Feb 2014 00:03:20 +0000 (00:03 +0000)]
Fix Werror introduced at r200874.
llvm-svn: 200891
Rafael Espindola [Thu, 6 Feb 2014 00:03:15 +0000 (00:03 +0000)]
Just returning false is the default.
llvm-svn: 200890
Nick Lewycky [Wed, 5 Feb 2014 23:53:29 +0000 (23:53 +0000)]
Fix -Wunused-variable 'FD' by using it instead of ND when they're equal but FD
has a more precise type.
llvm-svn: 200889
Matt Arsenault [Wed, 5 Feb 2014 23:16:05 +0000 (23:16 +0000)]
Pass address space to allowsUnalignedMemoryAccesses
llvm-svn: 200888
Matt Arsenault [Wed, 5 Feb 2014 23:15:53 +0000 (23:15 +0000)]
Add address space argument to allowsUnalignedMemoryAccess.
On R600, some address spaces have more strict alignment
requirements than others.
llvm-svn: 200887
Manman Ren [Wed, 5 Feb 2014 22:53:44 +0000 (22:53 +0000)]
Inliner uses a smaller inline threshold for callees with cold attribute.
Added command line option inlinecold-threshold to set threshold for inlining
functions with cold attribute. Listen to the cold attribute when it would
decrease the inline threshold.
llvm-svn: 200886
Nick Kledzik [Wed, 5 Feb 2014 22:22:56 +0000 (22:22 +0000)]
Fix layering StringRef copy using BumpPtrAllocator.
Now to copy a string into a BumpPtrAllocator and get a StringRef to the copy:
StringRef myCopy = myStr.copy(myAllocator);
llvm-svn: 200885