Rui Ueyama [Tue, 1 Apr 2014 21:55:36 +0000 (21:55 +0000)]
Greatly simplify InputGraph.
InputGraph has too many knobs and controls that are not being used. This
patch is to remove dead code, unused features and a class. There are two
things that worth noting, besides simple dead code removal:
1. ControlNode class is removed. We had it as the base class of Group
class, but it provides no functionality particularly meaningful. We now
have shallower class hierarchy that is easier to understand.
2. InputGraph provides a feature to replace a node with its internal data.
It is being used to "expand" some type of node, such as a Linker Script
node, with its actual files. We used to have two options when replacing
it -- ExpandOnly or ExpandAndReplace. ExpandOnly was to expand it but not
remove the node from the tree. There is no use of that option in the code,
so it was a dead feature.
Differential Revision: http://llvm-reviews.chandlerc.com/D3252
llvm-svn: 205363
Greg Fitzgerald [Tue, 1 Apr 2014 21:54:56 +0000 (21:54 +0000)]
Allow the user to override the compiler used for testing
Change-Id: I76d4708a26f17185efb746f4b836aa32f3f8a44f
llvm-svn: 205362
David Blaikie [Tue, 1 Apr 2014 21:54:52 +0000 (21:54 +0000)]
Add inequality operator for MachineLocation.
Fixes the build I broke in r205360
llvm-svn: 205361
David Blaikie [Tue, 1 Apr 2014 21:49:04 +0000 (21:49 +0000)]
DebugInfo: Split DebugLocEntry into its own file.
It seems big enough that it deserves its own file - but it is header
only, so there's no need for another cpp file, etc.
llvm-svn: 205360
Aaron Ballman [Tue, 1 Apr 2014 21:43:23 +0000 (21:43 +0000)]
Updating the capability attribute diagnostics to be more capability-neutral. Instead of using terminology such as "lock", "unlock" and "locked", the new terminology is "acquire", "release" and "held". Additionally, the capability attribute's name argument is now reported as part of the diagnostic, instead of hard coding as "mutex."
llvm-svn: 205359
Adrian Prantl [Tue, 1 Apr 2014 21:04:24 +0000 (21:04 +0000)]
Add a comment about the DIDescriptor class hierarchy.
llvm-svn: 205358
Adrian Prantl [Tue, 1 Apr 2014 21:04:18 +0000 (21:04 +0000)]
DwarfDebug: Prevent DebugLocEntry merging from coalescing two different
constants into only the first one.
rdar://
14874886.
llvm-svn: 205357
Enrico Granata [Tue, 1 Apr 2014 19:37:14 +0000 (19:37 +0000)]
Use continue instead of next
llvm-svn: 205354
Fariborz Jahanian [Tue, 1 Apr 2014 19:32:35 +0000 (19:32 +0000)]
Objective-C modern translator. Fix declaration of
__NSConstantStringImpl's length field to accomodate
window's 64bit LLP64 mode. // rdar://
16489050
llvm-svn: 205353
Hal Finkel [Tue, 1 Apr 2014 19:24:27 +0000 (19:24 +0000)]
[PowerPC] Add some missing VSX bitcast patterns
llvm-svn: 205352
Richard Smith [Tue, 1 Apr 2014 19:18:16 +0000 (19:18 +0000)]
Simplify FunctionDecl::getMinRequiredArguments().
llvm-svn: 205351
Rui Ueyama [Tue, 1 Apr 2014 19:00:21 +0000 (19:00 +0000)]
Remove dynamic casts.
Asserting with cast<T> did not actually make much sense because there was no
need to use dynamic casting in the first place. We could make the compiler to
statically type check these objects.
llvm-svn: 205350
Yaron Keren [Tue, 1 Apr 2014 18:52:55 +0000 (18:52 +0000)]
If isKnownWindowsMSVCEnvironment then getOS == Triple::Win32 and
Environment == Triple::MSVC so it will never be MinGW or Cygwin.
llvm-svn: 205349
Hal Finkel [Tue, 1 Apr 2014 18:50:34 +0000 (18:50 +0000)]
Implement X86TTI::getUnrollingPreferences
This provides an initial implementation of getUnrollingPreferences for x86.
getUnrollingPreferences is used by the generic (concatenation) unroller, which
is distinct from the unrolling done by the loop vectorizer. Many modern x86
cores have some kind of uop cache and loop-stream detector (LSD) used to
efficiently dispatch small loops, and taking full advantage of this requires
unrolling small loops (small here means 10s of uops).
These caches also have limits on the number of taken branches in the loop, and
so we also cap the loop unrolling factor based on the maximum "depth" of the
loop. This is currently calculated with a partial DFS traversal (partial
because it will stop early if the path length grows too much). This is still an
approximation, and one that is both conservative (because it does not account
for branches eliminated via block placement) and optimistic (because it is only
recording the maximum depth over minimum paths). Nevertheless, because the
loops that fit in these uop caches are so small, it is not clear how much the
details matter.
The original set of patches posted for review produced the following test-suite
performance results (from the TSVC benchmark) at that time:
ControlLoops-dbl - 13% speedup
ControlLoops-flt - 15% speedup
Reductions-dbl - 7.5% speedup
llvm-svn: 205348
Hal Finkel [Tue, 1 Apr 2014 18:50:30 +0000 (18:50 +0000)]
Add some additional fields to TTI::UnrollingPreferences
In preparation for an upcoming commit implementing unrolling preferences for
x86, this adds additional fields to the UnrollingPreferences structure:
- PartialThreshold and PartialOptSizeThreshold - Like Threshold and
OptSizeThreshold, but used when not fully unrolling. These are necessary
because we need different thresholds for full unrolling from those used when
partially unrolling (the full unrolling thresholds are generally going to be
larger).
- MaxCount - A cap on the unrolling factor when partially unrolling. This can
be used by a target to prevent the unrolled loop from exceeding some
resource limit independent of the loop size (such as number of branches).
There should be no functionality change for any in-tree targets.
llvm-svn: 205347
Hal Finkel [Tue, 1 Apr 2014 18:50:06 +0000 (18:50 +0000)]
Use TopTTI->getGEPCost from within getUserCost
The implementation of getUserCost had duplicated (and hard-coded) the default
logic in getGEPCost. Instead, it is better to use getGEPCost directly, which
limits the default logic to the implementation of one function, and allows
targets to override the behavior.
No functionality change intended.
llvm-svn: 205346
Ed Maste [Tue, 1 Apr 2014 18:47:58 +0000 (18:47 +0000)]
Use libc++ on FreeBSD as on Darwin
llvm-svn: 205345
Joerg Sonnenberger [Tue, 1 Apr 2014 18:39:58 +0000 (18:39 +0000)]
Move __addsf3 and __adddf3 into the corresponding blocks that define
fp_t.
llvm-svn: 205344
Kai Nacke [Tue, 1 Apr 2014 18:35:26 +0000 (18:35 +0000)]
[mips] Add Octeon cnMips instructions mtmX and mtpX
Adds the Octeon cnMips instructions "load multiplier register MPLx" and "load product register Px".
Includes tests.
Reviews by: Daniel.Sanders@imgtec.com
llvm-svn: 205343
Reid Kleckner [Tue, 1 Apr 2014 18:34:21 +0000 (18:34 +0000)]
Support segmented stacks on Win64
Identical to Win32 method except the GS segment register is used for TLS
instead of FS and pvArbitrary is at TEB offset 0x28 instead of 0x14.
llvm-svn: 205342
Matt Arsenault [Tue, 1 Apr 2014 18:34:13 +0000 (18:34 +0000)]
Fix missing RUN line in test
llvm-svn: 205341
Richard Smith [Tue, 1 Apr 2014 18:33:50 +0000 (18:33 +0000)]
Fix self-referential comment.
llvm-svn: 205340
Richard Smith [Tue, 1 Apr 2014 18:32:16 +0000 (18:32 +0000)]
More tests for DR1.
llvm-svn: 205339
Yaron Keren [Tue, 1 Apr 2014 18:15:34 +0000 (18:15 +0000)]
isTargetWindows() renamed to isTargetKnownWindowsMSVC()
to reflect its current functionality.
Based on Takumi NAKAMURA suggestion.
llvm-svn: 205338
Ed Maste [Tue, 1 Apr 2014 18:14:06 +0000 (18:14 +0000)]
Implement ProcessMonitor::Kill for Linux
On FreeBSD ptrace(PT_KILL) is used to terminate the traced process
(as if PT_CONTINUE had been used with SIGKILL as the signal to be
delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy.
On Linux, after ptrace(PTRACE_KILL) the traced process still exists
and can be interrogated. It is only upon resume that it exits as though
it received SIGKILL.
As the Linux PTRACE_KILL behaviour is not used by LLDB, rename
BringProcessIntoLimbo to Kill, and change the implementation to simply
call kill() instead of using ptrace.
Thanks to Todd F for testing (Ubuntu 12.04, gcc 4.8.2).
Sponsored by: DARPA, AFRL
Differential Revision: http://llvm-reviews.chandlerc.com/D3159
llvm-svn: 205337
Matt Arsenault [Tue, 1 Apr 2014 18:13:26 +0000 (18:13 +0000)]
Make isSetCCEquivalent respect the TargetBooleanContents
llvm-svn: 205336
Matt Arsenault [Tue, 1 Apr 2014 18:13:22 +0000 (18:13 +0000)]
Add helpers for checking if a value is a target boolean constant.
llvm-svn: 205335
Ed Maste [Tue, 1 Apr 2014 18:06:45 +0000 (18:06 +0000)]
Add mips64 to the list of 64-bit Host architectures
llvm-svn: 205333
Rui Ueyama [Tue, 1 Apr 2014 18:04:56 +0000 (18:04 +0000)]
s/dyn_cast/cast/ where return value should never be null.
cast<X> asserts the type is correct and does not return null on failure.
So we should use cast<X> rather than dyn_cast<X> at such places where we
don't expect type conversion could fail.
llvm-svn: 205332
Adrian Prantl [Tue, 1 Apr 2014 17:52:06 +0000 (17:52 +0000)]
Debug info: fix a crash when emitting IndirectFieldDecls, which were
previously not handled at all.
rdar://problem/
16348575
llvm-svn: 205331
Ed Maste [Tue, 1 Apr 2014 17:27:25 +0000 (17:27 +0000)]
mips64: clean up register context storage
Store the gpr data in a DataBufferHeap and use a DataExtractor to
extract register values with appropriate endianness. This avoids hard-
coding the register count, and with some further work would allow this
class to provide generic register context storage for any CPU.
llvm-svn: 205329
Jordan Rose [Tue, 1 Apr 2014 16:40:06 +0000 (16:40 +0000)]
[analyzer] Extract a helper for finding the target region for a C++ constructor.
No functionality change.
Patch by Alex McCarthy!
llvm-svn: 205328
Jordan Rose [Tue, 1 Apr 2014 16:39:59 +0000 (16:39 +0000)]
[analyzer] Remove incorrect workaround for unimplemented temporary destructors.
If we're trying to get the zero element region of something that's not a region,
we should be returning UnknownVal, which is what ProgramState::getLValue will
do for us.
Patch by Alex McCarthy!
llvm-svn: 205327
Jordan Rose [Tue, 1 Apr 2014 16:39:33 +0000 (16:39 +0000)]
[analyzer] Fix a CFG printing bug.
Also, add several destructor-related tests. Most of them don't work yet, but it's
good to have them recorded.
Patch by Alex McCarthy!
llvm-svn: 205326
Aaron Ballman [Tue, 1 Apr 2014 16:30:35 +0000 (16:30 +0000)]
Fixing the MSVC 2012 build bot, which cannot do initializer lists yet. Amends r205307.
llvm-svn: 205325
David Blaikie [Tue, 1 Apr 2014 16:17:41 +0000 (16:17 +0000)]
DebugInfo: Factor out common functionality for rendering debug_loc and debug_loc.dwo location list entries
In preparation for refactoring this function into two, one for
debug_loc, one for debug_loc.dwo.
llvm-svn: 205324
David Blaikie [Tue, 1 Apr 2014 16:13:29 +0000 (16:13 +0000)]
Cleanup remaining use of removed variable to fix the build
llvm-svn: 205323
David Blaikie [Tue, 1 Apr 2014 16:09:49 +0000 (16:09 +0000)]
Simplify debug_loc.dwo handling slightly.
llvm-svn: 205322
Duncan P. N. Exon Smith [Tue, 1 Apr 2014 16:05:15 +0000 (16:05 +0000)]
InstrProfile: Use SANITIZER_COMMON_LIT_TEST_DEPS
Take advantage of the SANITIZER_COMMON_LIT_TEST_DEPS variable.
<rdar://problem/
16458307>
llvm-svn: 205321
Tobias Grosser [Tue, 1 Apr 2014 16:01:33 +0000 (16:01 +0000)]
Delete trivial PHI nodes (aka stack slot sharing)
During code preperation trivial PHI nodes (mainly introduced by lcssa) are
deleted to decrease the number of introduced allocas (==> dependences). However
simply replacing them by their only incoming value would cause the independent
block pass to introduce new allocas. To prevent this we try to share stack slots
during code preperarion, hence to reuse a already created alloca 'to demote' the
trivial PHI node. This works if we know that the value stored in this alloca
will be the incoming value of the trivial PHI at the end of the predecessor
block of this trivial PHI.
Contributed-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 205320
Duncan P. N. Exon Smith [Tue, 1 Apr 2014 15:56:05 +0000 (15:56 +0000)]
InstrProf: Turn on test for Linux
Enabling test/profile on Linux to get feedback from the buildbots. I'm
hoping this just works...
<rdar://problem/
16458307>
llvm-svn: 205319
Duncan P. N. Exon Smith [Tue, 1 Apr 2014 15:29:27 +0000 (15:29 +0000)]
InstrProf: Remove LTO dependency from test
The -flto flag relies on linker features that are not available on all
platforms.
<rdar://problem/
16458307>
llvm-svn: 205318
Christian Pirker [Tue, 1 Apr 2014 15:19:30 +0000 (15:19 +0000)]
ARM: rename ARMle/ARMbe with ARMLE/ARMBE, and Thumble/Thumbbe with ThumbLE/ThumbBE
llvm-svn: 205317
Alexander Potapenko [Tue, 1 Apr 2014 15:07:09 +0000 (15:07 +0000)]
[tsan] Remove an accidentally committed debug print.
llvm-svn: 205316
Ed Maste [Tue, 1 Apr 2014 14:30:56 +0000 (14:30 +0000)]
Implement ProcessMonitor::Kill for FreeBSD
On FreeBSD ptrace(PT_KILL) is used to terminate the traced process
(as if PT_CONTINUE had been used with SIGKILL as the signal to be
delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy.
On Linux, after ptrace(PTRACE_KILL) the traced process still exists
and can be interrogated. It is only upon resume that it exits as though
it received SIGKILL.
For now I'm committing only the FreeBSD change, until the Linux change
(review D3159) is successfully tested.
http://llvm.org/pr18894
llvm-svn: 205315
Tim Northover [Tue, 1 Apr 2014 14:10:07 +0000 (14:10 +0000)]
ARM: teach LLVM that Cortex-A7 is very similar to A8.
llvm-svn: 205314
Aaron Ballman [Tue, 1 Apr 2014 13:56:35 +0000 (13:56 +0000)]
Attempting to fix r205124, which had failed asserts when built with MSVC.
Suggestion from Yaron Keren.
llvm-svn: 205313
Joerg Sonnenberger [Tue, 1 Apr 2014 13:42:56 +0000 (13:42 +0000)]
Add support for IEEE754 quad precision comparison functions.
From GuanHong Liu.
Differential Revision: http://llvm-reviews.chandlerc.com/D2797
llvm-svn: 205312
Alexey Samsonov [Tue, 1 Apr 2014 13:42:16 +0000 (13:42 +0000)]
[ASan] Fix Android build
llvm-svn: 205311
Alexey Samsonov [Tue, 1 Apr 2014 13:31:10 +0000 (13:31 +0000)]
Add support for dynamic ASan runtime (on Linux) to Clang driver.
Based on http://llvm-reviews.chandlerc.com/D3043 by Yuri Gribov!
llvm-svn: 205310
Tim Northover [Tue, 1 Apr 2014 13:22:02 +0000 (13:22 +0000)]
ARM: add cyclone CPU with ZeroCycleZeroing feature.
The Cyclone CPU is similar to swift for most LLVM purposes, but does have two
preferred instructions for zeroing a VFP register. This teaches LLVM about
them.
llvm-svn: 205309
Alexey Samsonov [Tue, 1 Apr 2014 13:16:30 +0000 (13:16 +0000)]
[ASan] Optional support for dynamic ASan runtime on Linux.
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov!
llvm-svn: 205308
Daniel Jasper [Tue, 1 Apr 2014 12:55:11 +0000 (12:55 +0000)]
clang-format: Support configurable list of foreach-macros.
This fixes llvm.org/PR17242.
Patch by Brian Green, thank you!
llvm-svn: 205307
Ed Maste [Tue, 1 Apr 2014 12:49:21 +0000 (12:49 +0000)]
Add errno import missed in r205246
llvm-svn: 205306
Daniel Sanders [Tue, 1 Apr 2014 12:35:23 +0000 (12:35 +0000)]
[mips] Renamed ParseAnyRegisterWithoutDollar to MatchAnyRegisterWithoutDollar
This is for consistency with other functions. The Parse* functions consume
tokens and the Match* functions don't.
No functional change.
llvm-svn: 205305
Aaron Ballman [Tue, 1 Apr 2014 12:24:25 +0000 (12:24 +0000)]
Fixing an MSVC warning about widening the result of a 32-bit shift implicitly. No functional change intended.
llvm-svn: 205304
Tim Northover [Tue, 1 Apr 2014 12:23:08 +0000 (12:23 +0000)]
ARM64: add a few bits of polynomial intrinsic codegen.
llvm-svn: 205303
Tim Northover [Tue, 1 Apr 2014 12:22:37 +0000 (12:22 +0000)]
ARM64: add intrinsic for pmull (p64 x p64 = p128) operations.
llvm-svn: 205302
Aaron Ballman [Tue, 1 Apr 2014 12:22:20 +0000 (12:22 +0000)]
Fixing warnings in the MSVC build. No functional changes intended.
llvm-svn: 205301
Alexey Samsonov [Tue, 1 Apr 2014 11:51:50 +0000 (11:51 +0000)]
[TSan] Make this test more portable
llvm-svn: 205300
Kostya Serebryany [Tue, 1 Apr 2014 11:35:55 +0000 (11:35 +0000)]
[sanitizer] one more stress test for the deadlock detector; this one stresses the slow path with a global lock
llvm-svn: 205299
Daniel Sanders [Tue, 1 Apr 2014 10:41:48 +0000 (10:41 +0000)]
[mips] Extend ParseJumpTarget to support the full symbol expression syntax.
Summary:
This should fix the issues the D3222 caused in lld. Testcase is based on
the one that failed in the buildbot.
Depends on D3233
Reviewers: matheusalmeida, vmedic
Reviewed By: matheusalmeida
Differential Revision: http://llvm-reviews.chandlerc.com/D3234
llvm-svn: 205298
Daniel Sanders [Tue, 1 Apr 2014 10:40:14 +0000 (10:40 +0000)]
[mips] Use AsmLexer::peekTok() to resolve the conflict between $reg and $sym
Summary:
Parsing registers no longer consume the $ token before it's confirmed whether it really has a register or not, therefore it's no longer impossible to match symbols if registers were tried first.
Depends on D3232
Reviewers: matheusalmeida, vmedic
Reviewed By: matheusalmeida
Differential Revision: http://llvm-reviews.chandlerc.com/D3233
llvm-svn: 205297
Tim Northover [Tue, 1 Apr 2014 10:37:47 +0000 (10:37 +0000)]
ARM64: add missing ldN/stN intrinsics and enable tests.
llvm-svn: 205296
Daniel Sanders [Tue, 1 Apr 2014 10:37:46 +0000 (10:37 +0000)]
[mips] Hoist Parser.Lex() calls out of MatchAnyRegisterNameWithoutDollar()
Summary:
No functional change
Depends on D3222
Reviewers: matheusalmeida, vmedic
Reviewed By: matheusalmeida
Differential Revision: http://llvm-reviews.chandlerc.com/D3232
llvm-svn: 205295
Tim Northover [Tue, 1 Apr 2014 10:37:09 +0000 (10:37 +0000)]
ARM64: add patterns for more lane-wise ld1/st1 operations.
llvm-svn: 205294
Tim Northover [Tue, 1 Apr 2014 10:37:03 +0000 (10:37 +0000)]
ARM64: fix bug in ld3r (1d) SelectionDAG.
llvm-svn: 205293
Daniel Sanders [Tue, 1 Apr 2014 10:35:28 +0000 (10:35 +0000)]
[mips] Rewrite MipsAsmParser and MipsOperand.
Summary:
Highlights:
- Registers are resolved much later (by the render method).
Prior to that point, GPR32's/GPR64's are GPR's regardless of register
size. Similarly FGR32's/FGR64's/AFGR64's are FGR's regardless of register
size or FR mode. Numeric registers can be anything.
- All registers are parsed the same way everywhere (even when handling
symbol aliasing)
- One consequence is that all registers can be specified numerically
almost anywhere (e.g. $fccX, $wX). The exception is symbol aliasing
but that can be easily resolved.
- Removes the need for the hasConsumedDollar hack
- Parenthesis and Bracket suffixes are handled generically
- Micromips instructions are parsed directly instead of going through the
standard encodings first.
- rdhwr accepts all 32 registers, and the following instructions that previously
xfailed now work:
ddiv, ddivu, div, divu, cvt.l.[ds], se[bh], wsbh, floor.w.[ds], c.ngl.d,
c.sf.s, dsbh, dshd, madd.s, msub.s, nmadd.s, nmsub.s, swxc1
- Diagnostics involving registers point at the correct character (the $)
- There's only one kind of immediate in MipsOperand. LSA immediates are handled
by the predicate and renderer.
Lowlights:
- Hardcoded '$zero' in the div patterns is handled with a hack.
MipsOperand::isReg() will return true for a k_RegisterIndex token
with Index == 0 and getReg() will return ZERO for this case. Note that it
doesn't return ZERO_64 on isGP64() targets.
- I haven't cleaned up all of the now-unused functions.
Some more of the generic parser could be removed too (integers and relocs
for example).
- insve.df needed a custom decoder to handle the implicit fourth operand that
was needed to make it parse correctly. The difficulty was that the matcher
expected a Token<'0'> but gets an Imm<0>. Adding an implicit zero solved this.
Reviewers: matheusalmeida, vmedic
Reviewed By: matheusalmeida
Differential Revision: http://llvm-reviews.chandlerc.com/D3222
llvm-svn: 205292
Viktor Kutuzov [Tue, 1 Apr 2014 10:34:21 +0000 (10:34 +0000)]
Add FreeBSD support to sanitizers' procmaps facilities
llvm-svn: 205291
Viktor Kutuzov [Tue, 1 Apr 2014 10:29:42 +0000 (10:29 +0000)]
Fix definition of the __sanitizer_passwd structure on FreeBSD
llvm-svn: 205290
Renato Golin [Tue, 1 Apr 2014 09:51:49 +0000 (09:51 +0000)]
Recover TableGen/LangRef, make it official
Making the new TableGen documentation official and marking the old file as
"Moved". Also, reverting the original LangRef as the normative formal
description of the language, while keeping the "new" LangRef as LangIntro
for the less inlcined to reading language grammars.
We should remove TableGenFundamentals.rst one day, but for now, just a
warning that it moved will have to do, while we make sure there are no more
links to it from elsewhere.
llvm-svn: 205289
Alexey Volkov [Tue, 1 Apr 2014 08:13:07 +0000 (08:13 +0000)]
[x86] Do not convert to cmp32 for Atom arch by Sergey Okunev
Differential Revision: http://llvm-reviews.chandlerc.com/D2824
llvm-svn: 205288
David Blaikie [Tue, 1 Apr 2014 08:07:52 +0000 (08:07 +0000)]
DebugInfo: Avoid creating unnecessary/empty line tables and remove the special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference
This moves one case of raw text checking down into the MCStreamer
interfaces in the form of a virtual function, even if we ultimately end
up consolidating on the one-or-many line tables issue one day, this is
nicer in the interim. This just generally streamlines a bunch of use
cases into a common code path.
llvm-svn: 205287
David Blaikie [Tue, 1 Apr 2014 07:35:52 +0000 (07:35 +0000)]
DebugInfo: Emit relocation to debug_line section when emitting asm for asm
I don't think this is reachable by any frontend (why would you transform
asm to asm+debug info?) but it helps tidy up some of this code, avoid
the weird special case of "emit the first CU, store the label, then emit
the rest" in MCDwarfLineTable::Emit by instead having the
DWARF-for-assembly case use the same codepath as DwarfDebug.cpp, by
registering the label of the debug_line section, thus causing it to be
emitted. (with a special case in asm output to just emit the label since
asm output uses the .loc directives, etc, rather than the debug_loc
directly)
llvm-svn: 205286
Ted Kremenek [Tue, 1 Apr 2014 07:23:18 +0000 (07:23 +0000)]
Add defensive check that argument may be null in call to compareConversionFunctions() on incorrect code.
I'm looking into getting a reduced test case, but it's not
immediately available.
Fixes <rdar://problem/
16344806>
llvm-svn: 205285
Rui Ueyama [Tue, 1 Apr 2014 06:18:19 +0000 (06:18 +0000)]
[PECOFF] Make PECOFFFileNode::parse idempotent.
PECOFFFileNode::parse can be called twice -- once by WinLink driver and
once more by Driver. We want to make sure that the second call won't mess
up the internal data.
llvm-svn: 205284
Rui Ueyama [Tue, 1 Apr 2014 06:11:09 +0000 (06:11 +0000)]
[PECOFF] Treat .imp as an import library file.
Some Clang build uses .imp not .lib file extension for an import library file,
so we need to treat such file as a library file.
Ideally we should not rely on file extensions to detect file type. Instead
we should use magic bytes at beginning of a file. The GNU-compatible driver
actually does that but it made writing unit tests hard, so I chose an ad-hoc
approach for now.
llvm-svn: 205283
David Majnemer [Tue, 1 Apr 2014 05:29:46 +0000 (05:29 +0000)]
MS ABI: Support mangling of return-types deducing to local types
The MS ABI forces us into catch-22 when it comes to functions which
return types which are local:
- A function is mangled with it's return type.
- A type is mangled with it's surrounding context.
Avoid this by mangling auto and decltype(autp) directly into the
function's return type. Using this mangling has the double advantage of
being compatible with the C++ standard without crashing the compiler.
N.B. For the curious, the MSVC mangling leads to collisions amongst
template functions and either crashes when faced with local types or is
otherwise incapable of returning them.
llvm-svn: 205282
Adrian Prantl [Tue, 1 Apr 2014 03:50:01 +0000 (03:50 +0000)]
Remove FIXMEs. The scope of a Variable is always a lexical scope; there is
nothing to be gained from switching this over to a DIScopeRef.
llvm-svn: 205281
Shankar Easwaran [Tue, 1 Apr 2014 03:49:55 +0000 (03:49 +0000)]
[core] support .gnu.linkonce sections
.gnu.linkonce sections are similar to section groups.
They were supported before section groups existed and provided a way
to resolve COMDAT sections using a different design.
There are few implementations that use .gnu.linkonce sections
to store simple floating point constants which doesnot require complex section
group support but need a way to store only one copy of the floating point
constant in a binary.
.gnu.linkonce based symbol resolution achieves that.
Review : http://llvm-reviews.chandlerc.com/D3242
llvm-svn: 205280
Adrian Prantl [Tue, 1 Apr 2014 03:41:04 +0000 (03:41 +0000)]
LTO type uniquing: store the Decl field of a DIImportedEntity as a DIRef.
No other functionality changes, DIBuilder testcase is included in a paired
CFE commit.
This relaxes the assertion in isScopeRef to also accept subclasses of
DIScope.
llvm-svn: 205279
Adrian Prantl [Tue, 1 Apr 2014 03:41:01 +0000 (03:41 +0000)]
Adapt CGDebugInfo to interface changes in DIBuilder/DIImportedEntity.
The Decl field in a DIImportedEntity is now a DIRef.
Paired commit with LLVM.
llvm-svn: 205278
Adrian Prantl [Tue, 1 Apr 2014 03:40:59 +0000 (03:40 +0000)]
Add a comment about type-uniquing ObjC types.
llvm-svn: 205277
Jordan Rose [Tue, 1 Apr 2014 03:40:53 +0000 (03:40 +0000)]
[analyzer] Lock checker: Allow pthread_mutex_init to reinitialize a destroyed lock.
Patch by Daniel Fahlgren!
llvm-svn: 205276
Jordan Rose [Tue, 1 Apr 2014 03:40:47 +0000 (03:40 +0000)]
[analyzer] Lock checker: make sure locks aren't used after being destroyed.
Patch by Daniel Fahlgren!
llvm-svn: 205275
Jordan Rose [Tue, 1 Apr 2014 03:40:38 +0000 (03:40 +0000)]
[analyzer] Add double-unlock detection to PthreadLockChecker.
We've decided to punt on supporting recursive locks for now; the common case
is non-recursive.
Patch by Daniel Fahlgren!
llvm-svn: 205274
Richard Smith [Tue, 1 Apr 2014 01:58:11 +0000 (01:58 +0000)]
Add failing testcase for DR305. Looks like we didn't implement the resolution
here in the simple-template-id case.
llvm-svn: 205273
Bob Wilson [Tue, 1 Apr 2014 01:38:16 +0000 (01:38 +0000)]
Disable this-return optimizations when targeting iOS 5 and earlier.
Clang implements the part of the ARM ABI saying that certain functions
(e.g., constructors and destructors) return "this", but Apple's version of
gcc and llvm-gcc did not. The libstdc++ dylib on iOS 5 was built with
llvm-gcc, which means that clang cannot safely assume that code from the C++
runtime will correctly follow the ABI. It is also possible to run into this
problem when linking with other libraries built with gcc or llvm-gcc. Even
though there is no way to reliably detect that situation, it is most likely
to come up when targeting older versions of iOS. Disabling the optimization
for any code targeting iOS 5 solves the libstdc++ problem and has a reasonably
good chance of fixing the issue for other older libraries as well.
<rdar://problem/
16377159>
llvm-svn: 205272
David Blaikie [Tue, 1 Apr 2014 00:27:28 +0000 (00:27 +0000)]
Fix up compression related test cases
Fallout from r205261, ensure it doesn't matter how we disable compressed
debug info, even if zlib is missing and that we warn when we don't have
zlib and don't warn when we do, all while silently suppressing these
tests on the systems they weren't intended for...
llvm-svn: 205271
David Majnemer [Tue, 1 Apr 2014 00:05:57 +0000 (00:05 +0000)]
MS ABI: Simplify MangleByte further
It turns out that the ranges where the '?' <letter> manglings occur are
identical to the ranges of ASCII characters OR'd with 0x80.
Thanks to Richard Smith for the insight!
No functional change.
llvm-svn: 205270
David Blaikie [Mon, 31 Mar 2014 23:50:20 +0000 (23:50 +0000)]
Comment to describe the debug_loc.dwo constants
Code review feedback from Eric Christopher on r204697
llvm-svn: 205268
David Blaikie [Mon, 31 Mar 2014 23:47:13 +0000 (23:47 +0000)]
Comment necessity of early initialization
Code review feedback from Eric Christopher on r204261.
I didn't want to go into too much detail (the revision history should
provide the full stuff) - but I can add more if that's preferred.
Also moved this up to right by the construction of the MCAsmInfo so
there's less chance that other things might sneak in in between.
llvm-svn: 205267
Saleem Abdulrasool [Mon, 31 Mar 2014 23:42:23 +0000 (23:42 +0000)]
MCJIT: ensure that cygwin is identified properly
Cygwin is now a proper environment rather than an OS. This updates the MCJIT
tests to avoid execution on Cygwin. This fixes native cygwin tests.
llvm-svn: 205266
David Blaikie [Mon, 31 Mar 2014 23:29:38 +0000 (23:29 +0000)]
Warn when requesting compress-debug-sections and zlib is not available
Another shot in the dark, since I do have zlib installed. Will be
watching the bots for fallout.
llvm-svn: 205265
Hal Finkel [Mon, 31 Mar 2014 23:23:51 +0000 (23:23 +0000)]
Move partial/runtime unrolling late in the pipeline
The generic (concatenation) loop unroller is currently placed early in the
standard optimization pipeline. This is a good place to perform full unrolling,
but not the right place to perform partial/runtime unrolling. However, most
targets don't enable partial/runtime unrolling, so this never mattered.
However, even some x86 cores benefit from partial/runtime unrolling of very
small loops, and follow-up commits will enable this. First, we need to move
partial/runtime unrolling late in the optimization pipeline (importantly, this
is after SLP and loop vectorization, as vectorization can drastically change
the size of a loop), while keeping the full unrolling where it is now. This
change does just that.
llvm-svn: 205264
Duncan P. N. Exon Smith [Mon, 31 Mar 2014 23:14:28 +0000 (23:14 +0000)]
InstrProf: lit.cfg magic for running tests from source
Implement magic in compiler-rt to enable llvm-lit to be invoked on the
source tree in lib/profile. This relies on a paired commit in the llvm
tree that exposes a new built-in parameter.
<rdar://problem/
16458307>
llvm-svn: 205263
Duncan P. N. Exon Smith [Mon, 31 Mar 2014 23:14:10 +0000 (23:14 +0000)]
lit: Set a base directory for compiler-rt tests
Setting this parameter enables llvm-lit to run on source directories for
compiler-rt test suites that implement magic in their lit.cfg.
<rdar://problem/
16458307>
llvm-svn: 205262
David Blaikie [Mon, 31 Mar 2014 23:13:30 +0000 (23:13 +0000)]
DebugInfo compression: Enable compression before any sections are created.
For those playing at home this produced some fairly subtle behavior. The
sections created in InitMCObjectFileInfo were created without compressed
debug info (a mistake, but not necessarily /broken). Since these
sections were almost always referenced by the existing MCSection object,
this almost worked.
This got weird when we got to handling the relocations for a section.
See ELFObjectWriter::WriteSection where we compute the true section for
a relocation section by simply stripping the ".rela" prefix and then
looking up that section - doing so hit the compression codepath, looked
up .zdebug_blah and found a newly constructed empty section... thus,
things got weird.
This is untestable without a cross-project test (let me know if people
would prefer that to no testing).
llvm-svn: 205261
Arnold Schwaighofer [Mon, 31 Mar 2014 23:05:56 +0000 (23:05 +0000)]
Revert "SLPVectorizer: Ignore users that are insertelements we can reschedule them"
This reverts commit r205018.
Conflicts:
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/X86/insert-element-build-vector.ll
This is breaking libclc build.
llvm-svn: 205260
Enrico Granata [Mon, 31 Mar 2014 23:02:25 +0000 (23:02 +0000)]
<rdar://problem/
16424592>
For some reason, the libc++ vector<bool> data formatter was essentially a costly no-up, doing everything required of it, except actually generating the child values!
This restores its functionality
llvm-svn: 205259