Reid Kleckner [Fri, 3 Jan 2014 23:51:09 +0000 (23:51 +0000)]
Fix MSVC warning about missing return in DataLayout
llvm-svn: 198465
Reid Kleckner [Fri, 3 Jan 2014 23:42:00 +0000 (23:42 +0000)]
[ms-cxxabi] Improve vbtable name mangling accuracy
Summary:
This makes us more compatible with MSVC 2012+ and fixes PR17748 where we
would give two tables the same name.
Rather than doing a fresh depth-first traversal of the inheritance graph
for every record's vbtables, now we memoize vbtable paths for each
record. By doing memoization, we end up considering virtual bases of
subobjects that come later in the depth-first traversal. Where
previously we would have ignored a virtual base that we'd already seen,
we now consider it for name mangling purposes without emitting a
duplicate vbtable for it.
Reviewers: majnemer
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2509
llvm-svn: 198462
Adrian Prantl [Fri, 3 Jan 2014 23:34:30 +0000 (23:34 +0000)]
Debug info: Ensure that the last stop point in a function is still within
the lexical block formed by the compound statement that is the function
body.
rdar://problem/
15010825
llvm-svn: 198461
Joey Gouly [Fri, 3 Jan 2014 23:12:02 +0000 (23:12 +0000)]
[MachO] Begin to add some MachO specific File/Atoms, and add the start of
normalizedToAtoms.
llvm-svn: 198459
Marshall Clow [Fri, 3 Jan 2014 22:55:49 +0000 (22:55 +0000)]
Rename ___make_pair_return to __make_pair_return_impl; ___make_tuple_return to __make_tuple_return_impl; and ____iterator_traits to __iterator_traits_impl. Part of a campaign to remove > 2 underscores from libc++. No functionality change.
llvm-svn: 198457
Nico Weber [Fri, 3 Jan 2014 22:53:37 +0000 (22:53 +0000)]
Add a LLVM_DUMP_METHOD macro.
The motivation is to mark dump methods as used in debug builds so that they can
be called from lldb, but to not do so in release builds so that they can be
dead-stripped.
There's lots of potential follow-up work suggested in the thread
"Should dump methods be LLVM_ATTRIBUTE_USED only in debug builds?" on cfe-dev,
but everyone seems to agreen on this subset.
Macro name chosen by fair coin toss.
llvm-svn: 198456
Jack Carter [Fri, 3 Jan 2014 22:18:43 +0000 (22:18 +0000)]
[Mips]Work around MIPS linker issues exposed by commit r198087 until bug 18360 is resolved
llvm-svn: 198451
Jason Molenda [Fri, 3 Jan 2014 22:06:25 +0000 (22:06 +0000)]
Don't enforce ABI stack alignment rules on the sigtramp frame --
its stack frame is a constructed, fake thing that may not conform
correctly to these rules. This fixes a problem where lldb couldn't
backtrace past an asynchronous signal handler (_sigtramp) frame on
a stack on Mac OS X.
<rdar://problem/
15035673>
llvm-svn: 198450
Adrian Prantl [Fri, 3 Jan 2014 21:49:09 +0000 (21:49 +0000)]
FileCheck: Print a nice error message for missing closing ']' in regex vars.
llvm-svn: 198449
Jason Molenda [Fri, 3 Jan 2014 20:46:16 +0000 (20:46 +0000)]
Fix a mistake in the last change I made to ProcessMachCore.cpp.
<rdar://problem/
15745397>
llvm-svn: 198447
Aaron Ballman [Fri, 3 Jan 2014 20:10:54 +0000 (20:10 +0000)]
Refactored Builtin::Context::isPrintfLike and isScanfLike into a helper function. The implementations are identical, except for the format arguments being searched for.
No functional changes intended.
llvm-svn: 198446
Reid Kleckner [Fri, 3 Jan 2014 19:56:20 +0000 (19:56 +0000)]
Revert "For disassembly when adding a symbolic operand that is a C++ symbol name, also put the human readable name in a comment."
This reverts commit r198441.
This change doesn't build on Windows, and doesn't do the right thing on
Linux and other platforms that don't use a _Z prefix instead of __Z for
C++ names.
It also had no tests, so it wasn't clear how to fix it forward.
llvm-svn: 198445
Argyrios Kyrtzidis [Fri, 3 Jan 2014 19:53:09 +0000 (19:53 +0000)]
Fix 80 col violation.
llvm-svn: 198444
Rafael Espindola [Fri, 3 Jan 2014 19:42:04 +0000 (19:42 +0000)]
Fix typo.
Thanks to Owen Anderson for noticing it.
llvm-svn: 198443
Argyrios Kyrtzidis [Fri, 3 Jan 2014 19:39:23 +0000 (19:39 +0000)]
Pass the decl directly to the diagnostic, no need to call getDeclName().
llvm-svn: 198442
Kevin Enderby [Fri, 3 Jan 2014 19:33:09 +0000 (19:33 +0000)]
For disassembly when adding a symbolic operand that is a C++
symbol name, also put the human readable name in a comment.
Also fix a bug in LLVMDisasmInstruction() that was not flushing
the raw_svector_ostream for the disassembled instruction string
before copying it to the output buffer that was causing truncation
of the output.
rdar://
10173828
llvm-svn: 198441
Aaron Ballman [Fri, 3 Jan 2014 19:26:43 +0000 (19:26 +0000)]
Fixing a FIXME; the RetTy template parameter is always bool in practice, and so it has been removed. No functional changes intended.
llvm-svn: 198440
Rafael Espindola [Fri, 3 Jan 2014 19:22:05 +0000 (19:22 +0000)]
Update for llvm's DataLayout including mangling information.
llvm-svn: 198439
Rafael Espindola [Fri, 3 Jan 2014 19:21:54 +0000 (19:21 +0000)]
Make the llvm mangler depend only on DataLayout.
Before this patch any program that wanted to know the final symbol name of a
GlobalValue had to link with Target.
This patch implements a compromise solution where the mangler uses DataLayout.
This way, any tool that already links with Target (llc, clang) gets the exact
behavior as before and new IR files can be mangled without linking with Target.
With this patch the mangler is constructed with just a DataLayout and DataLayout
is extended to include the information the Mangler needs.
llvm-svn: 198438
Ana Pazos [Fri, 3 Jan 2014 19:20:31 +0000 (19:20 +0000)]
[AArch64][NEON] Added SXTL and SXTL2 instruction aliases
llvm-svn: 198437
David Blaikie [Fri, 3 Jan 2014 18:59:42 +0000 (18:59 +0000)]
Revert "Revert "Debug Info: Type Units: Simplify type hashing using IR-provided unique names.""
This reverts commit r198398, thus reapplying r198397.
I had accidentally introduced an endianness issue when applying the hash
to the type unit. Using support::ulittle64_t in the reinterpret_cast in
addDwarfTypeUnitType fixes this issue.
Original commit message:
Debug Info: Type Units: Simplify type hashing using IR-provided unique
names.
What's good for LTO metadata size problems ought to be good for non-LTO
debug info size too, so let's rely on the same uniqueness in both cases.
If it's insufficient for non-LTO for whatever reason (since we now won't
be uniquing CU-local types or any C types - but these are likely to not
be the most significant contributors to type bloat) we should consider a
frontend solution that'll help both LTO and non-LTO alike, rather than
using DWARF-level DIE-hashing that only helps non-LTO debug info size.
It's also much simpler this way and benefits C++ even more since we can
deduplicate lexically separate definitions of the same C++ type since
they have the same mangled name.
llvm-svn: 198436
Aaron Ballman [Fri, 3 Jan 2014 18:51:47 +0000 (18:51 +0000)]
Marked the default constructor as an LLVM_DELETED_FUNCTION.
llvm-svn: 198435
Joerg Sonnenberger [Fri, 3 Jan 2014 18:43:32 +0000 (18:43 +0000)]
Typo
llvm-svn: 198434
Aaron Ballman [Fri, 3 Jan 2014 18:42:48 +0000 (18:42 +0000)]
Removed one of the string versions of getQualifiedNameAsString, and switched over to using printQualifiedName where possible. No functional changes intended.
llvm-svn: 198433
Argyrios Kyrtzidis [Fri, 3 Jan 2014 18:32:18 +0000 (18:32 +0000)]
[objc] Refactor and improve functionality for the -Wunused-property-ivar warning.
- Remove the additions to ObjCMethodDecl & ObjCIVarDecl that were getting de/serialized and consolidate
all functionality for the checking for this warning in Sema::DiagnoseUnusedBackingIvarInAccessor
- Don't check immediately after the method body is finished, check when the @implementation is finished.
This is so we can see if the ivar was referenced by any other method, even if the method was defined after the accessor.
- Don't silence the warning if any method is called from the accessor silence it if the accessor delegates to another method via self.
rdar://
15727325
llvm-svn: 198432
Marshall Clow [Fri, 3 Jan 2014 18:21:14 +0000 (18:21 +0000)]
Patch by Howard. First part of fix for PR18218; add type traits needed to do the right thing. Fix the problems in PR18218 for isnan and pow - they also need to be applied to the other functions in <cmath>. Also, a drive-by fix for the test - now actually calls test_abs()
llvm-svn: 198431
Rafael Espindola [Fri, 3 Jan 2014 18:13:17 +0000 (18:13 +0000)]
Reformat the description strings. No functionality change.
llvm-svn: 198430
Aaron Ballman [Fri, 3 Jan 2014 18:10:25 +0000 (18:10 +0000)]
We haven't cared about VS 2005 in a long time, and VS 2003 in even longer.
llvm-svn: 198429
Aaron Ballman [Fri, 3 Jan 2014 17:59:55 +0000 (17:59 +0000)]
Fixed a FIXME; created a print method for Selectors that accepts a raw_ostream, and started using it in places it made sense.
No functional changes intended, just API cleanliness.
llvm-svn: 198428
Alexander Kornienko [Fri, 3 Jan 2014 17:24:20 +0000 (17:24 +0000)]
A follow-up to r198426: move AnalysisConsumer.h to include/clang/...
llvm-svn: 198427
Alexander Kornienko [Fri, 3 Jan 2014 17:23:10 +0000 (17:23 +0000)]
Make clang::ento::CreateAnalysisConsumer a part of a public interface of the static analyzer.
Summary:
This allows for a better alternative to the FrontendAction hack used in
clang-tidy in order to get static analyzer's ASTConsumer.
Reviewers: jordan_rose, krememek
Reviewed By: jordan_rose
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2505
llvm-svn: 198426
David Peixotto [Fri, 3 Jan 2014 17:20:01 +0000 (17:20 +0000)]
Fix loop rerolling pass failure with non-consant loop lower bound
The loop rerolling pass was failing with an assertion failure from a
failed cast on loops like this:
void foo(int *A, int *B, int m, int n) {
for (int i = m; i < n; i+=4) {
A[i+0] = B[i+0] * 4;
A[i+1] = B[i+1] * 4;
A[i+2] = B[i+2] * 4;
A[i+3] = B[i+3] * 4;
}
}
The code was casting the SCEV-expanded code for the new
induction variable to a phi-node. When the loop had a non-constant
lower bound, the SCEV expander would end the code expansion with an
add insted of a phi node and the cast would fail.
It looks like the cast to a phi node was only needed to get the
induction variable value coming from the backedge to compute the end
of loop condition. This patch changes the loop reroller to compare
the induction variable to the number of times the backedge is taken
instead of the iteration count of the loop. In other words, we stop
the loop when the current value of the induction variable ==
IterationCount-1. Previously, the comparison was comparing the
induction variable value from the next iteration == IterationCount.
This problem only seems to occur on 32-bit targets. For some reason,
the loop is not rerolled on 64-bit targets.
PR18290
llvm-svn: 198425
Aaron Ballman [Fri, 3 Jan 2014 16:23:46 +0000 (16:23 +0000)]
Simplifying the mutual exclusion check now that the diagnostics engine knows how to handle Attr objects directly. Updates an associated test case due to the attribute name being properly quoted again.
llvm-svn: 198424
Alexander Kornienko [Fri, 3 Jan 2014 15:34:40 +0000 (15:34 +0000)]
Clear the diagnostic buffer after flushing it.
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2504
llvm-svn: 198423
Joey Gouly [Fri, 3 Jan 2014 15:11:57 +0000 (15:11 +0000)]
[OpenCL] Add test case for previous commit.
llvm-svn: 198422
Aaron Ballman [Fri, 3 Jan 2014 15:02:58 +0000 (15:02 +0000)]
Using the proper helper function instead of manually doing this work. No functional changes intended.
llvm-svn: 198421
Aaron Ballman [Fri, 3 Jan 2014 14:54:10 +0000 (14:54 +0000)]
Removing some more unnecessary manual quotes from diagnostics.
llvm-svn: 198420
Aaron Ballman [Fri, 3 Jan 2014 14:48:20 +0000 (14:48 +0000)]
Removing an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.
llvm-svn: 198419
Aaron Ballman [Fri, 3 Jan 2014 14:23:03 +0000 (14:23 +0000)]
Removing some more unnecessary manual quotes from diagnostics.
llvm-svn: 198418
Joey Gouly [Fri, 3 Jan 2014 14:16:55 +0000 (14:16 +0000)]
[OpenCL] Variables in the constant address space must be initialized.
llvm-svn: 198417
Aaron Ballman [Fri, 3 Jan 2014 14:06:37 +0000 (14:06 +0000)]
Removing some more unnecessary manual quotes from diagnostics.
llvm-svn: 198416
Aaron Ballman [Fri, 3 Jan 2014 13:56:08 +0000 (13:56 +0000)]
It turns out the problem was a bit more wide-spread. Removing a lot of unneeded typecasts. getScopeRep() already returns a NestedNameSpecifier.
No functional changes intended.
llvm-svn: 198414
Aaron Ballman [Fri, 3 Jan 2014 13:45:46 +0000 (13:45 +0000)]
Removing an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.
llvm-svn: 198413
Aaron Ballman [Fri, 3 Jan 2014 13:34:55 +0000 (13:34 +0000)]
Removing some more unnecessary manual quotes from diagnostics. Updated the related test case to ensure correctness.
llvm-svn: 198412
Daniel Jasper [Fri, 3 Jan 2014 11:50:46 +0000 (11:50 +0000)]
clang-format: Recognize single-line macro usages inside macros.
Before:
#define LIST(L) \
L(FirstElement) L(SecondElement) L(ThirdElement) L(FourthElement) \
L(FifthElement)
After:
#define LIST(L) \
L(FirstElement) \
L(SecondElement) \
L(ThirdElement) \
L(FourthElement) \
L(FifthElement)
llvm-svn: 198407
Alexander Kornienko [Fri, 3 Jan 2014 10:50:17 +0000 (10:50 +0000)]
Rework of r198404 to avoid changes in the build configuration.
llvm-svn: 198405
NAKAMURA Takumi [Fri, 3 Jan 2014 10:24:51 +0000 (10:24 +0000)]
clang-tody: Rework r198403, to fix build.
llvm-svn: 198404
NAKAMURA Takumi [Fri, 3 Jan 2014 09:49:13 +0000 (09:49 +0000)]
clang-tidy: Fix build since r198402 in the case that the source tree of clang-tools-extra is not located on clang/tools/extra.
FIXME: Get rid of private headers in other modules.
llvm-svn: 198403
Alexander Kornienko [Fri, 3 Jan 2014 09:31:57 +0000 (09:31 +0000)]
Refactored Clang-tidy for better reusability.
Summary:
Made ClangTidyAction more slim and moved its declaration to header to
allow easy creation of Clang-tidy ASTConsumer. Don't derive from
clang::ento::AnalysisAction, use clang::ento::CreateAnalysisConsumer instead
(I'll propose making this function a part of a public API in a separate patch).
Use MultiplexConsumer instead of a custom class.
Don't re-filter checkers list for each TU.
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2481
llvm-svn: 198402
Alp Toker [Fri, 3 Jan 2014 07:58:20 +0000 (07:58 +0000)]
MSVC 2010 build fix
Back out the part of r198399 that enabled LLVM_FINAL/LLVM_OVERRIDE on VS 2010.
DwarfUnit.h legitimately uses them on destructors which unfortunately triggers
Compiler Error C3665 (override specifier not allowed on a destructor/finalizer)
prior to MSVC 2012:
virtual ~DwarfCompileUnit() LLVM_OVERRIDE;
llvm-svn: 198401
Arnold Schwaighofer [Fri, 3 Jan 2014 05:47:03 +0000 (05:47 +0000)]
BasicAA: Use reachabilty instead of dominance for checking value equality in phi
cycles
This allows the value equality check to work even if we don't have a dominator
tree. Also add some more comments.
I was worried about compile time impacts and did not implement reachability but
used the dominance check in the initial patch. The trade-off was that the
dominator tree was required.
The llvm utility function isPotentiallyReachable cuts off the recursive search
after 32 visits. Testing did not show any compile time regressions showing my
worries unjustfied.
No compile time or performance regressions at O3 -flto -mavx on test-suite +
externals.
Addresses review comments from r198290.
llvm-svn: 198400
Alp Toker [Fri, 3 Jan 2014 05:00:46 +0000 (05:00 +0000)]
Enable LLVM_FINAL, LLVM_OVERRIDE and LLVM_HAS_VARIADIC_TEMPLATES with more gcc and MSVC versions
The 'sealed' definition of LLVM_FINAL can be dropped once VS 2010 is
decommissioned.
Some of this is speculative so will keep an eye on the waterfall -- ping me if
you see failures.
Incremental work towards C++11 migration.
llvm-svn: 198399
David Blaikie [Fri, 3 Jan 2014 04:49:04 +0000 (04:49 +0000)]
Revert "Debug Info: Type Units: Simplify type hashing using IR-provided unique names."
Reverting due to bot failure I won't have time to investigate until
tomorrow.
This reverts commit r198397.
llvm-svn: 198398
David Blaikie [Fri, 3 Jan 2014 04:20:26 +0000 (04:20 +0000)]
Debug Info: Type Units: Simplify type hashing using IR-provided unique names.
What's good for LTO metadata size problems ought to be good for non-LTO
debug info size too, so let's rely on the same uniqueness in both cases.
If it's insufficient for non-LTO for whatever reason (since we now won't
be uniquing CU-local types or any C types - but these are likely to not
be the most significant contributors to type bloat) we should consider a
frontend solution that'll help both LTO and non-LTO alike, rather than
using DWARF-level DIE-hashing that only helps non-LTO debug info size.
It's also much simpler this way and benefits C++ even more since we can
deduplicate lexically separate definitions of the same C++ type since
they have the same mangled name.
llvm-svn: 198397
Rui Ueyama [Fri, 3 Jan 2014 03:29:15 +0000 (03:29 +0000)]
Use scoped enum.
llvm-svn: 198396
Aaron Ballman [Fri, 3 Jan 2014 02:20:27 +0000 (02:20 +0000)]
Removing some more unnecessary manual quotes from diagnostics.
llvm-svn: 198395
Eric Christopher [Fri, 3 Jan 2014 02:17:35 +0000 (02:17 +0000)]
80-column.
llvm-svn: 198394
Eric Christopher [Fri, 3 Jan 2014 02:16:44 +0000 (02:16 +0000)]
Remove TextSectionSym as it is unused.
llvm-svn: 198393
Aaron Ballman [Fri, 3 Jan 2014 02:14:08 +0000 (02:14 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.
llvm-svn: 198392
Aaron Ballman [Fri, 3 Jan 2014 02:07:43 +0000 (02:07 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.
llvm-svn: 198391
David Blaikie [Fri, 3 Jan 2014 01:30:05 +0000 (01:30 +0000)]
Revert "Reverting r193835 due to weirdness with Go..."
The cgo problem was that it wants dwarf2 which doesn't support direct
constant encoding of the location. So let's add support for dwarf2
encoding (using a location expression) of data member locations.
This reverts commit r198385.
llvm-svn: 198389
Ted Kremenek [Fri, 3 Jan 2014 01:19:28 +0000 (01:19 +0000)]
[analyzer] Don't track return value of NSNull +null for retain/release tracking.
Fixes <rdar://problem/
12858915>.
llvm-svn: 198388
Aaron Ballman [Fri, 3 Jan 2014 01:09:27 +0000 (01:09 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.
llvm-svn: 198387
Tobias Grosser [Fri, 3 Jan 2014 00:56:20 +0000 (00:56 +0000)]
Another formatting fix
llvm-svn: 198386
David Blaikie [Fri, 3 Jan 2014 00:48:38 +0000 (00:48 +0000)]
Reverting r193835 due to weirdness with Go...
Apologies for the noise - we're seeing some Go failures with cgo
interacting with Clang's debug info due to this change.
llvm-svn: 198385
Tobias Grosser [Fri, 3 Jan 2014 00:44:43 +0000 (00:44 +0000)]
Fix formatting issues
llvm-svn: 198384
Reid Kleckner [Fri, 3 Jan 2014 00:36:32 +0000 (00:36 +0000)]
Remove unused variable to fix clang warning
llvm-svn: 198382
Reid Kleckner [Fri, 3 Jan 2014 00:14:35 +0000 (00:14 +0000)]
[ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cpp
Summary:
No functionality change.
This code should live here long-term because we should be able to use it
to compute correct vftable names.
It turns out that the most natural way to implement the naming algorithm
is to use a caching layer similar to what we already have for virtual
table info in VTableContext. Subsequent changes will take advantage of
this to fix PR17748, where we have a vbtable name collision.
Reviewers: majnemer
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2499
llvm-svn: 198380
David Blaikie [Fri, 3 Jan 2014 00:00:41 +0000 (00:00 +0000)]
Fix break introduced in r198377 due to using a local type as a template parameter.
llvm-svn: 198379
David Blaikie [Thu, 2 Jan 2014 23:57:28 +0000 (23:57 +0000)]
Test coverage for non-default-constructible elements in a StringMap
This functionality was enabled by r198374. Here's a test to ensure it
works and we don't regress it.
Based on a patch by Maciej Piechotka.
llvm-svn: 198377
Tobias Grosser [Thu, 2 Jan 2014 23:39:18 +0000 (23:39 +0000)]
Introduce -polly-canonicalize pass
This ModulePass schedules the set of Polly canonicalization passes. It is a
debugging tool that can be used to preoptimize .ll files for Polly processing.
llvm-svn: 198376
Aaron Ballman [Thu, 2 Jan 2014 23:39:11 +0000 (23:39 +0000)]
Removed an unnecessary %select from the alignas diagnostics. The attribute already knows how it was spelled.
llvm-svn: 198375
David Blaikie [Thu, 2 Jan 2014 23:28:39 +0000 (23:28 +0000)]
Remove StringMapEntryInitializer support.
It was never specialized so let's just remove that unused
configurability and always do the default.
llvm-svn: 198374
Aaron Ballman [Thu, 2 Jan 2014 23:22:40 +0000 (23:22 +0000)]
This diagnostic should not have had the manual quotation marks. Its only usage passed in an Attr object, which was already quoted when printing the diagnostic. However, there was no test case that caught this bug -- one has been added.
llvm-svn: 198373
Aaron Ballman [Thu, 2 Jan 2014 23:15:58 +0000 (23:15 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics. Updated the associated testcase because QualType pretty printing was an improvement.
llvm-svn: 198372
Aaron Ballman [Thu, 2 Jan 2014 23:02:01 +0000 (23:02 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.
llvm-svn: 198371
Tobias Grosser [Thu, 2 Jan 2014 22:48:50 +0000 (22:48 +0000)]
RegisterPasses: Do not claim we schedule canonicalization passes at -O0
Also the code makes the impression this was happening, shouldEnablePolly()
always returns false for optlevel equal to zero. This was previously different,
but was accidentally changed by a commit a couple of months ago. As this
behavior was mainly a debugging tool and adding this to clang never really made
sense, we just remove the last traces.
llvm-svn: 198370
Quentin Colombet [Thu, 2 Jan 2014 22:47:22 +0000 (22:47 +0000)]
[RegAlloc] Make tryInstructionSplit less aggressive.
The greedy register allocator tries to split a live-range around each
instruction where it is used or defined to relax the constraints on the entire
live-range (this is a last chance split before falling back to spill).
The goal is to have a big live-range that is unconstrained (i.e., that can use
the largest legal register class) and several small local live-range that carry
the constraints implied by each instruction.
E.g.,
Let csti be the constraints on operation i.
V1=
op1 V1(cst1)
op2 V1(cst2)
V1 live-range is constrained on the intersection of cst1 and cst2.
tryInstructionSplit relaxes those constraints by aggressively splitting each
def/use point:
V1=
V2 = V1
V3 = V2
op1 V3(cst1)
V4 = V2
op2 V4(cst2)
Because of how the coalescer infrastructure works, each new variable (V3, V4)
that is alive at the same time as V1 (or its copy, here V2) interfere with V1.
Thus, we end up with an uncoalescable copy for each split point.
To make tryInstructionSplit less aggressive, we check if the split point
actually relaxes the constraints on the whole live-range. If it does not, we do
not insert it.
Indeed, it will not help the global allocation problem:
- V1 will have the same constraints.
- V1 will have the same interference + possibly the newly added split variable
VS.
- VS will produce an uncoalesceable copy if alive at the same time as V1.
<rdar://problem/
15570057>
llvm-svn: 198369
Aaron Ballman [Thu, 2 Jan 2014 22:45:33 +0000 (22:45 +0000)]
Reworded the NSObject attribute diagnostics to be more consistent with other attribute diagnostics. Also updated the associated test case.
llvm-svn: 198368
Fariborz Jahanian [Thu, 2 Jan 2014 22:42:09 +0000 (22:42 +0000)]
ObjectiveC. Remove false positive warning for missing property
backing ivar by not issuing this warning if ivar is referenced
somewhere and accessor makes method calls. // rdar://
15727325
llvm-svn: 198367
Aaron Ballman [Thu, 2 Jan 2014 22:29:41 +0000 (22:29 +0000)]
Removing some manual quotes from this diagnostic, since the AST diagnostics engine knows how to handle NamedDecl objects.
llvm-svn: 198365
Tobias Grosser [Thu, 2 Jan 2014 22:28:53 +0000 (22:28 +0000)]
ScopInfo: Ensure the RegionInfo analysis is always available
This fixes a crash that appeared when generating dotty graphs for functions
without loops (for which we do not calculate polyhedral information).
llvm-svn: 198364
Hal Finkel [Thu, 2 Jan 2014 22:09:39 +0000 (22:09 +0000)]
[PPC] Fix comment to match function name
llvm-svn: 198362
Eric Christopher [Thu, 2 Jan 2014 22:04:47 +0000 (22:04 +0000)]
Remove comments on CU skeleton construction, they're probably
obvious.
llvm-svn: 198361
Hal Finkel [Thu, 2 Jan 2014 21:38:26 +0000 (21:38 +0000)]
[PPC] Fix the scheduling of CR logicals on the P7
CR logicals (crand, crxor, etc.) on the P7 need to be in the first slot of each
dispatch group. The old itinerary entry was just wrong (but has not mattered
because we don't generate these instructions).
This will matter when, in an upcoming commit, we start generating these
instructions.
llvm-svn: 198359
Eric Christopher [Thu, 2 Jan 2014 21:38:18 +0000 (21:38 +0000)]
Elaborate on comment for skeleton CU construction.
llvm-svn: 198358
Eric Christopher [Thu, 2 Jan 2014 21:38:13 +0000 (21:38 +0000)]
Revert seemingly unnecessary section sym for the data section.
llvm-svn: 198357
Hal Finkel [Thu, 2 Jan 2014 21:26:59 +0000 (21:26 +0000)]
[PPC] Use the correct immediate operands on 64-bit instructions
Several of the 64-bit fixed-point instructions with immediate operands were
using the 32-bit (i32) operand nodes instead of the corresponding 64-bit (i64)
operand definitions (u16imm instead of u16imm64, for example).
This error has had no effect so far, but would have caused type-checking
violations with an upcoming change.
llvm-svn: 198356
Aaron Ballman [Thu, 2 Jan 2014 21:26:14 +0000 (21:26 +0000)]
Updated the wording of two attribute-related diagnostics so that they print the offending attribute name. Also updates the associated test cases.
llvm-svn: 198355
Hal Finkel [Thu, 2 Jan 2014 21:13:43 +0000 (21:13 +0000)]
Disable compare sinking in CodeGenPrepare when multiple condition registers are available
As noted in the comment above CodeGenPrepare::OptimizeInst, which aggressively
sinks compares to reduce pressure on the condition register(s), for targets
such as PowerPC with multiple condition registers, this may not be the right
thing to do. This adds an HasMultipleConditionRegisters boolean to TLI, and
CodeGenPrepare::OptimizeInst is skipped when HasMultipleConditionRegisters is
true.
This functionality will be used by the PowerPC backend in an upcoming commit.
Especially when the PowerPC backend starts tracking individual condition
register bits as separate allocatable entities (which will happen in this
upcoming commit), this sinking from CodeGenPrepare::OptimizeInst is
significantly suboptimial.
llvm-svn: 198354
Andrew Trick [Thu, 2 Jan 2014 21:12:11 +0000 (21:12 +0000)]
indvars: cleanup the IV visitor. It does more than gather sext/zext info.
llvm-svn: 198353
Matt Arsenault [Thu, 2 Jan 2014 21:09:05 +0000 (21:09 +0000)]
Fix all the verifier tests I added for address spaces.
I originally had these using opt -verify, and I never removed the
-verify when converting them to use llvm-as instead, so these were
failing because of using the -verify argument which llvm-as doesn't have
instead of what it's actually supposed to be testing.
llvm-svn: 198352
Eric Christopher [Thu, 2 Jan 2014 21:03:28 +0000 (21:03 +0000)]
Fix up a couple of review comments:
Use an if statement instead of a pair of ternary operators checking
the same condition.
Use a cheap method call rather than returning the local symbol.
llvm-svn: 198351
Eric Christopher [Thu, 2 Jan 2014 21:03:22 +0000 (21:03 +0000)]
Simplify conditional.
llvm-svn: 198350
Matt Arsenault [Thu, 2 Jan 2014 20:55:01 +0000 (20:55 +0000)]
Allow addrspacecast in global aliases
llvm-svn: 198349
Hal Finkel [Thu, 2 Jan 2014 20:47:09 +0000 (20:47 +0000)]
[TableGen] Correctly generate implicit anonymous prototype defs in multiclasses
Even within a multiclass, we had been generating concrete implicit anonymous
defs when parsing values (generally in value lists). This behavior was
incorrect, and led to errors when multiclass parameters were used in the
parameter list of the implicit anonymous def.
If we had some multiclass:
multiclass mc<string n> {
... : SomeClass<SomeOtherClass<n> >
The capture of the multiclass parameter 'n' would not work correctly, and
depending on how the implicit SomeOtherClass was used, either TableGen would
ignore something it shouldn't, or would crash.
To fix this problem, when inside a multiclass, we generate prototype anonymous
defs for implicit anonymous defs (just as we do for explicit anonymous defs).
Within the multiclass, the current record prototype is populated with a node
that is essentially: !cast<SomeOtherClass>(!strconcat(NAME, anon_value_name)).
This is then resolved to the correct concrete anonymous def, in the usual way,
when NAME is resolved during multiclass instantiation.
llvm-svn: 198348
Hal Finkel [Thu, 2 Jan 2014 20:47:05 +0000 (20:47 +0000)]
[TableGen] Handle ValueType in CodeGenDAGPatterns GetNumNodeResults
A ValueType in a pattern dag is a type cast, and GetNumNodeResults should
handle it (the type cast has only one result).
This comes up, for example, during the type checking of pattern fragments, for
example, AArch64's Neon_combine_2d fragment is:
dag Operands = (ops node:$Rm, node:$Rn);
dag Fragment = (v2f64 (concat_vectors (v1f64 node:$Rm), (v1f64 node:$Rn)));
llvm-svn: 198347
Matt Arsenault [Thu, 2 Jan 2014 20:01:43 +0000 (20:01 +0000)]
Delete unread globals through addrspacecast
llvm-svn: 198346
Matt Arsenault [Thu, 2 Jan 2014 19:53:49 +0000 (19:53 +0000)]
Fix addrspacecast with metadata globals
llvm-svn: 198345
Jordan Rose [Thu, 2 Jan 2014 19:47:45 +0000 (19:47 +0000)]
[CMake] Add missing set_output_directory after Takumi's change in r198205.
Plugins need to go in build/Debug/lib as well (rather than build/lib/Debug).
Also, fix the SHLIBDIR path for Xcode, which by default includes Xcode build
settings rather than a simple %(build_mode)s parameter.
llvm-svn: 198344