Ahmed Bougacha [Tue, 17 Mar 2015 03:19:18 +0000 (03:19 +0000)]
[AArch64] Factor out N->getOperand()s; format. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232458
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 17 Mar 2015 02:36:51 +0000 (02:36 +0000)]
Fix ODR violations caused by putting anonymous namespaces in header files (and
then using the symbols from those anonymous namespaces from outside the
anonymous namespace).
This was "detected" by causing the modules selfhost to fail in some cases.
The corresponding Clang bug was fixed in r232455.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232457
91177308-0d34-0410-b5e6-
96231b3b80d8
Shankar Easwaran [Tue, 17 Mar 2015 02:12:35 +0000 (02:12 +0000)]
[Object][ELF] ELFEntityIterator : Add operators for random access
Add operators add/subtract for random access. This is essentially used by
lld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232453
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 17 Mar 2015 01:40:24 +0000 (01:40 +0000)]
[IRCE] Re-commit tests cases.
Re-commit the test cases added in r232444. These now use
-irce-print-changed-loops and -irce-print-range-checks so they run
correctly on a without asserts build of llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232452
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 17 Mar 2015 01:40:22 +0000 (01:40 +0000)]
[IRCE] Add a -irce-print-range-checks option.
-irce-print-range-checks prints out the set of range checks recognized
by IRCE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232451
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 17 Mar 2015 01:14:40 +0000 (01:14 +0000)]
MapMetadata: Allow unresolved metadata if it won't change
Allow unresolved nodes through the `MapMetadata()` if
`RF_NoModuleLevelChanges`, since there's no remapping to do anyway.
This fixes PR22929. I'll add a clang test as a follow-up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232449
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 17 Mar 2015 00:54:50 +0000 (00:54 +0000)]
[IRCE] Delete two tests.
I accidentally checked in two tests that used -debug-only -- these fail
on a release LLVM build. Temporarily delete these from the repo to keep
the bots green while I fix this locally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232446
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 17 Mar 2015 00:42:16 +0000 (00:42 +0000)]
[IRCE] Add comments, NFC.
This change adds some comments that justify why a potentially
overflowing operation is safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232445
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 17 Mar 2015 00:42:13 +0000 (00:42 +0000)]
[IRCE] Support half-range checks.
This change to IRCE gets it to recognize "half" range checks. Half
range checks are range checks that only either check if the index is
`slt` some positive integer ("length") or if the index is `sge` `0`.
The range solver does not try to be clever / aggressive about solving
half-range checks -- it transforms "I < L" to "0 <= I < L" and "0 <= I"
to "0 <= I < INT_SMAX". This is safe, but not always optimal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232444
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 17 Mar 2015 00:18:51 +0000 (00:18 +0000)]
llvm-cov: Warn instead of error if a .gcda has arcs from an exit block
Patch by Vanderson M. Rosario. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232443
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 17 Mar 2015 00:16:35 +0000 (00:16 +0000)]
AsmWriter: Assert on unresolved metadata nodes
Assert that `MDNode::isResolved()`. While in theory the `Verifier`
should catch this, it doesn't descend into all debug info, and the
`DebugInfoVerifier` doesn't call into the `Verifier`. Besides, this
helps to catch bugs when `-disable-verify=true`.
Note that I haven't come across a place where this fails with clang
today, so no testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232442
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 16 Mar 2015 23:52:03 +0000 (23:52 +0000)]
GCOV: Make the exit block placement from r223193 optional
By default we want our gcov emission to stay 4.2 compatible, which
means we need to continue emit the exit block last by default. We add
an option to emit it before the body for users that need it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232438
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 16 Mar 2015 23:36:24 +0000 (23:36 +0000)]
LowerBitSets: do not use private aliases at all on Darwin.
LLVM currently turns these into linker-private symbols, which can be dead
stripped by the Darwin linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232435
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 16 Mar 2015 22:29:29 +0000 (22:29 +0000)]
Pass in a "const Triple &T" instead of a raw StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232429
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 16 Mar 2015 22:06:15 +0000 (22:06 +0000)]
Remove unused argument. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232428
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 16 Mar 2015 22:03:50 +0000 (22:03 +0000)]
Add testing for mismatched explicit type on a gep operator when loading from bitcode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232427
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 16 Mar 2015 21:48:46 +0000 (21:48 +0000)]
Add testing for mismatched explicit type on a load instruction when loading from bitcode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232424
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 16 Mar 2015 21:43:42 +0000 (21:43 +0000)]
There is only one Asm streamer, there is no need for targets to register it.
Instead, have the targets register a TargetStreamer to be use with the
asm streamer (if any).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232423
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 16 Mar 2015 21:40:18 +0000 (21:40 +0000)]
InstrProf: Fix CoverageMappingReader on big endian
This makes the reader check the endianness of the object file its
given and behave appropriately. For the test I dug up a really old
linker and created a ppc-apple-darwin file for llvm-cov to read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232422
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 16 Mar 2015 21:36:38 +0000 (21:36 +0000)]
CodeGen: @llvm.eh.typeid.for replaced @llvm.eh.typeid.for.i32
We removed @llvm.eh.typeid.for.i32 and replaced it with
@llvm.eh.typeid.for quite some time ago. Fix up some test cases which
never got updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232421
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 16 Mar 2015 21:35:48 +0000 (21:35 +0000)]
Test bitcode parsing error-handling for incorrect explicit type
(turns out I had regressed this when sinking handling of this type down
into GetElementPtrInst::Create - since that asserted before the error
handling was performed)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232420
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 21:23:56 +0000 (21:23 +0000)]
Verifier: Don't call debug info verifier if the module is broken
If `Verifier` has already found a failure, don't call
`DebugInfoVerifier`. The latter sometimes crashes in `DebugInfoFinder`
when the former would give a nice message. The only two cases I found
it crashing are explicit verifier tests I've added:
- test/Verifier/llvm.dbg.declare-expression.ll
- test/Verifier/llvm.dbg.value-expression.ll
However, I assume frontends with bugs will create invalid IR as well.
IMO, the `DebugInfoVerifier` should never crash (instead, it should fail
to verify), but subtleties like that will be easier to work out once
it's enabled again.
This is part of PR22777.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232418
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 21:21:10 +0000 (21:21 +0000)]
AsmWriter: Handle broken metadata nodes
Print out temporary `MDNode`s so we don't crash in the verifier (or
during `dump()` output).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232417
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 21:10:12 +0000 (21:10 +0000)]
DebugInfo: Fix testcases that fail -verify-debug-info=true
As part of PR22777, fix testcases that fail the debug info verifier.
The changes fall into the following categories:
- Empty `filename:` fields in `MDFile`s. Compile units and some types
require non-empty filenames. A number of testcases have empty
filenames, probably due to hand-reduction of testcases.
- Not-quite empty arrays: `!{i32 0}`. This used to be equivalent in
the debug info schema to `!{}`. They cause problems for
`!MDSubroutineType`'s `types:` array, since it requires all operands
to be valid types. (Note that `!{null}` is the correct type array
for functions that take no arguments and return `void`.)
- Significantly bitrotted testcases. Nodes got left behind a few
upgrades ago because of missing or invalid tags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232415
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 21:05:33 +0000 (21:05 +0000)]
Verifier: Simplify logic in processCallInst(), NFC
No need for local variables here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232413
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 21:03:55 +0000 (21:03 +0000)]
IR: Take advantage of -verify checks for MDExpression
Now that we check `MDExpression` during `-verify` (r232299), make
the `DIExpression` wrapper more strict:
- remove redundant checks in `DebugInfoVerifier`,
- overload `get()` to `cast_or_null<MDExpression>` (superseding
`getRaw()`),
- stop checking for null in any accessor, and
- remove `DIExpression::Verify()` entirely in favour of
`MDExpression::isValid()`.
There is still some logic in this class, mostly to do with high-level
iterators; I'll defer cleaning up those until the rest of the wrappers
are similarly strict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232412
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 20:46:27 +0000 (20:46 +0000)]
DebugInfo: Simplify logic in DIType::Verify(), NFC
Clarify the logic in `DIType::Verify()` by checking `isBasicType()`
earlier, by skipping `else` after `return`s, and by documenting an
otherwise opaque check.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232410
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 20:24:02 +0000 (20:24 +0000)]
Verifier: Remove unnecessary double-checks
Turns out `visitIntrinsicFunctionCall()` descends into all operands
already, so explicitly descending in `visitDbgIntrinsic()` (part of
r232296) isn't useful.
Updating a testcase that doesn't really need `-verify-debug-info` (since
r231082) as confirmation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232408
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Mon, 16 Mar 2015 20:08:09 +0000 (20:08 +0000)]
Add the options, -dylibs-used and -dylib-id to llvm-objdump used with -macho
to print the Mach-O dynamic shared libraries used by a linked image or the
library id of a shared library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232406
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 16 Mar 2015 20:02:28 +0000 (20:02 +0000)]
Don't repeat names in comments. Remove unused default value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232405
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 19:01:54 +0000 (19:01 +0000)]
AsmParser: Stop requiring 'name:' when it's not printed
r230877 optimized which fields are written out for `CHECK`-ability, but
apparently missed changing some of them to optional in `LLParser`.
Fixes PR22921.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232400
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 16 Mar 2015 18:24:28 +0000 (18:24 +0000)]
fixed to test feature, not CPU
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232398
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 16 Mar 2015 18:18:32 +0000 (18:18 +0000)]
Remove dead file (was only used by the C backend)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232397
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Mon, 16 Mar 2015 18:15:27 +0000 (18:15 +0000)]
Tom is also responsible for the 3.6 branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232395
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 16 Mar 2015 18:06:57 +0000 (18:06 +0000)]
Fix uses of reserved identifiers starting with an underscore followed by an uppercase letter
This covers essentially all of llvm's headers and libs. One or two weird
cases I wasn't sure were worth/appropriate to fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232394
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 16 Mar 2015 18:02:16 +0000 (18:02 +0000)]
[AsmPrinter] Use the per-function subtarget to emit inline asm instructions that
are not at the file level.
Previously, the default subtarget created from the target triple was used to
emit inline asm instructions. Compilation would fail in cases where the feature
bits necessary to assemble an inline asm instruction in a function weren't set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232392
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 16 Mar 2015 17:59:07 +0000 (17:59 +0000)]
add CHECK-LABELs for more reliable testing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232391
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 16 Mar 2015 17:49:03 +0000 (17:49 +0000)]
Fix doxygen comments from r232268
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232388
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 16 Mar 2015 17:01:34 +0000 (17:01 +0000)]
fixed to test feature, not CPU; removed unnecessary declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232387
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 16 Mar 2015 15:53:55 +0000 (15:53 +0000)]
R600/SI: don't try min3/max3/med3 with f64
There are no opcodes for this. This also adds a test case.
v2: make test more robust
Patch by: Grigori Goronzy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232386
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 16 Mar 2015 15:38:48 +0000 (15:38 +0000)]
fix comments to match code; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232385
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Mon, 16 Mar 2015 15:01:09 +0000 (15:01 +0000)]
[MIPS] Fix justify error for small structures
Fix justify error for small structures bigger than 32 bits in fixed
arguments for MIPS64 big endian. There was a problem when small structures
are passed as fixed arguments. The structures that are bigger than 32 bits
but smaller than 64 bits were not left justified properly on MIPS64 big
endian. This is fixed by shifting the value to make it left justified when
appropriate.
Patch by Aleksandar Beserminji.
Differential Revision: http://reviews.llvm.org/D8174
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232382
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 16 Mar 2015 14:25:08 +0000 (14:25 +0000)]
Use the i8 immediate cmp instructions when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232378
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Mar 2015 14:21:22 +0000 (14:21 +0000)]
Revert r232374: [hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory constraints.
2007-12-17-InvokeAsm.ll fails on the buildbot but not on my own system. Will investigate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232376
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 16 Mar 2015 14:05:49 +0000 (14:05 +0000)]
Don't repeat names in comments and clang-format this function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232375
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Mar 2015 13:54:19 +0000 (13:54 +0000)]
[hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory constraints.
Summary:
But still handle them the same way since I don't know how they differ on
this target.
No functional change intended.
Reviewers: kparzysz, adasgupt
Reviewed By: kparzysz, adasgupt
Subscribers: colinl, llvm-commits
Differential Revision: http://reviews.llvm.org/D8204
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232374
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Mar 2015 13:13:41 +0000 (13:13 +0000)]
Make each target map all inline assembly memory constraints to InlineAsm::Constraint_m. NFC.
Summary:
This is instead of doing this in target independent code and is the last
non-functional change before targets begin to distinguish between
different memory constraints when selecting code for the ISD::INLINEASM
node.
Next, each target will individually move away from the idea that all
memory constraints behave like 'm'.
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D8173
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232373
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Mon, 16 Mar 2015 12:03:39 +0000 (12:03 +0000)]
[mips] [IAS] Outline NOP creation. NFC.
Summary: Make the code more readable by outlining NOP creation.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8320
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232371
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Horvath [Mon, 16 Mar 2015 10:19:53 +0000 (10:19 +0000)]
Fix build failure on MSVC compilers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232368
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Horvath [Mon, 16 Mar 2015 09:53:42 +0000 (09:53 +0000)]
[llvm] Replacing asserts with static_asserts where appropriate
Summary:
This patch consists of the suggestions of clang-tidy/misc-static-assert check.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: xazax.hun, llvm-commits
Differential Revision: http://reviews.llvm.org/D8343
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232366
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Vyukov [Mon, 16 Mar 2015 08:04:26 +0000 (08:04 +0000)]
asan: fix overflows in isSafeAccess
As pointed out in http://reviews.llvm.org/D7583
The current checks can cause overflows when object size/access offset cross Quintillion bytes.
http://reviews.llvm.org/D8193
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232358
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 08:00:27 +0000 (08:00 +0000)]
One more try with unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232357
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 07:46:34 +0000 (07:46 +0000)]
Add in an unreachable after a covered switch to appease certain bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232356
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 07:34:17 +0000 (07:34 +0000)]
Remove a used that snuck in that seems to be triggering the MSVC buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232355
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 16 Mar 2015 07:29:49 +0000 (07:29 +0000)]
InstrProf: Remove xfails for big-endian from coverage tests
This still doesn't actually work correctly for big endian input files,
but since these tests all use little endian input files they don't
actually fail. I'll be committing a real fix for big endian soon, but
I don't have proper tests for it yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232354
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 07:02:39 +0000 (07:02 +0000)]
[objc-arc] Fix indentation of debug logging so it is easy to read the output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232352
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 07:02:36 +0000 (07:02 +0000)]
[objc-arc] Make the ARC optimizer more conservative by forcing it to be non-safe in both direction, but mitigate the problem by noting that we just care if there was a further use.
The problem here is the infamous one direction known safe. I was
hesitant to turn it off before b/c of the potential for regressions
without an actual bug from users hitting the problem. This is that bug ;
).
The main performance impact of having known safe in both directions is
that often times it is very difficult to find two releases without a use
in-between them since we are so conservative with determining potential
uses. The one direction known safe gets around that problem by taking
advantage of many situations where we have two retains in a row,
allowing us to avoid that problem. That being said, the one direction
known safe is unsafe. Consider the following situation:
retain(x)
retain(x)
call(x)
call(x)
release(x)
Then we know the following about the reference count of x:
// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
retain(x)
// rc(x) == N+2
call A(x)
call B(x)
// rc(x) >= 1 (since we can not release a deallocated pointer).
release(x)
// rc(x) >= 0
That is all the information that we can know statically. That means that
we know that A(x), B(x) together can release (x) at most N+1 times. Lets
say that we remove the inner retain, release pair.
// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
call A(x)
call B(x)
// rc(x) >= 1
release(x)
// rc(x) >= 0
We knew before that A(x), B(x) could release x up to N+1 times meaning
that rc(x) may be zero at the release(x). That is not safe. On the other
hand, consider the following situation where we have a must use of
release(x) that x must be kept alive for after the release(x)**. Then we
know that:
// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
retain(x)
// rc(x) == N+2
call A(x)
call B(x)
// rc(x) >= 2 (since we know that we are going to release x and that that release can not be the last use of x).
release(x)
// rc(x) >= 1 (since we can not deallocate the pointer since we have a must use after x).
…
// rc(x) >= 1
use(x)
Thus we know that statically the calls to A(x), B(x) can together only
release rc(x) N times. Thus if we remove the inner retain, release pair:
// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
call A(x)
call B(x)
// rc(x) >= 1
…
// rc(x) >= 1
use(x)
We are still safe unless in the final … there are unbalanced retains,
releases which would have caused the program to blow up anyways even
before optimization occurred. The simplest form of must use is an
additional release that has not been paired up with any retain (if we
had paired the release with a retain and removed it we would not have
the additional use). This fits nicely into the ARC framework since
basically what you do is say that given any nested releases regardless
of what is in between, the inner release is known safe. This enables us to get
back the lost performance.
<rdar://problem/
19023795>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232351
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 07:02:32 +0000 (07:02 +0000)]
[objc-arc] Treat memcpy, memove, memset as just using pointers, not decrementing them.
This will be tested in the next commit (which required it). The commit
is going to update a bunch of tests at the same time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232350
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 07:02:30 +0000 (07:02 +0000)]
[objc-arc] Rename ConnectTDBUTraversals => PairUpRetainsReleases.
This is a name that is more descriptive of what the method really does. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232349
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 07:02:27 +0000 (07:02 +0000)]
[objc-arc] Move initialization of ARCMDKindCache into the class itself. I also made it lazy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232348
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 16 Mar 2015 07:02:24 +0000 (07:02 +0000)]
[objc-arc] Change EntryPointType to an enum class outside of ARCRuntimeEntryPoints called ARCRuntimeEntryPointKind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232347
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 16 Mar 2015 06:55:45 +0000 (06:55 +0000)]
InstrProf: Do a better job of reading coverage mapping data.
This code was casting regions of a memory buffer to a couple of
different structs. This is wrong in a few ways:
1. It breaks aliasing rules.
2. If the buffer isn't aligned, it hits undefined behaviour.
3. It completely ignores endianness differences.
4. The structs being defined for this aren't specifying their padding
properly, so this doesn't even represent the data properly on some
platforms.
This commit is mostly NFC, except that it fixes reading coverage for
32 bit binaries as a side effect of getting rid of the mispadded
structs. I've included a test for that.
I've also baked in that we only handle little endian more explicitly,
since that was true in practice already. I'll fix this to handle
endianness properly in a followup commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232346
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Mon, 16 Mar 2015 02:05:10 +0000 (02:05 +0000)]
[dsymutil] Add support to generate .debug_pubnames and .debug_pubtypes
The information gathering part of the patch stores a bit more information
than what is strictly necessary for these 2 sections. The rest will
become useful when we start emitting __apple_* type accelerator tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232342
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 16 Mar 2015 00:40:47 +0000 (00:40 +0000)]
Rework r232337. Let llvm/test/tools/dsymutil/X86/basic-linking-x86.test dospath-tolerant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232339
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 15 Mar 2015 23:07:16 +0000 (23:07 +0000)]
Suppress llvm/test/tools/dsymutil/X86/basic-linking-x86.test for now. Will fix later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232337
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 15 Mar 2015 23:07:05 +0000 (23:07 +0000)]
llvm/test/tools/dsymutil/X86/basic-lto-*-linking-x86.test: Relax expressions to meet dos path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232336
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Sun, 15 Mar 2015 22:20:28 +0000 (22:20 +0000)]
[dsymutil] Add missing raw_svector_stream::resync() calls.
Also, after looking at the raw_svector_stream internals, increase the
size of the SmallString used with it to prevent heap allocation.
Issue found by the Asan bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232335
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Sun, 15 Mar 2015 21:15:48 +0000 (21:15 +0000)]
Adding commit msg guidelines to dev policy
After much bike shed discussions, we seem to agree to a few loose
but relevant guidelines on how to prepare a commit message. It also
points the attribution section to the new commit messages section
to deduplicate information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232334
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Sun, 15 Mar 2015 20:45:43 +0000 (20:45 +0000)]
[dsymutil] Add support for linking line tables.
This code comes with a lot of cruft that is meant to mimic darwin's
dsymutil behavior. A much simpler approach (described in the numerous
FIXMEs that I put in there) gives the right output for the vast
majority of cases. The extra corner cases that are handled differently
need to be investigated: they seem to correctly handle debug info that
is in the input, but that info looks suspicious in the first place.
Anyway, the current code needs to handle this, but I plan to revisit it
as soon as the big round of validation against the classic dsymutil is
over.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232333
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Sun, 15 Mar 2015 20:45:39 +0000 (20:45 +0000)]
[MCDwarf] Do not emit useless line table opcode.
No need to emit a DW_LNS_advance_pc with a 0 increment. Found out while
comparing dsymutil's and LLVM's line table encoding. Not a correctenss
fix, just a small encoding size optimization.
I'm not sure how to generate a sequence that triggers this, and moreover
llvm-dwardump doesn't dump the line table program, thus the effort
involved in creating a testcase for this trivial patch seemed out of
proportion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232332
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 15 Mar 2015 19:47:42 +0000 (19:47 +0000)]
Use SDValue bool check to tidyup some possible combines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232331
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 15 Mar 2015 18:16:04 +0000 (18:16 +0000)]
remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232328
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 15 Mar 2015 18:11:35 +0000 (18:11 +0000)]
fix typo: NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232327
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 15 Mar 2015 17:21:35 +0000 (17:21 +0000)]
Use SDValue bool check to tidyup some possible combines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232325
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 15 Mar 2015 16:19:15 +0000 (16:19 +0000)]
[SSE} Added tests for float4-float3 conversions (PR11580)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232324
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 15 Mar 2015 13:26:03 +0000 (13:26 +0000)]
Factor the iterators of ImmutableSet/ImmutableMap into a common base class
This simplifies code quite a bit and brings the iterators closer to
C++'s iterator concept. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232319
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 15 Mar 2015 07:09:20 +0000 (07:09 +0000)]
ImmutableSet: Rename Self to SelfTy to make it more clear it is a type
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232317
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 15 Mar 2015 07:09:18 +0000 (07:09 +0000)]
PostOrderIterator: Remove stray semicolon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232316
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 06:53:32 +0000 (06:53 +0000)]
IR: Default the Metadata::dump() argument "harder" after r232275
Use an overload instead of a default argument for `Metadata::dump()`.
The latter seems to require calling `dump(nullptr)` explicitly when
using a debugger, where as the former doesn't.
Other than utility for debugging, there's NFC here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232315
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 15 Mar 2015 06:11:24 +0000 (06:11 +0000)]
Restore the gcc build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232314
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 03:21:20 +0000 (03:21 +0000)]
Remove iterator I accidentally left behind
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232312
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 03:18:21 +0000 (03:18 +0000)]
Remove use of reserved identifier _Iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232311
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 03:17:28 +0000 (03:17 +0000)]
Remove use of reserved identifiers in Twine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232310
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 03:11:26 +0000 (03:11 +0000)]
Remove use of reserved identifier and some excess 'inline' usage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232309
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 03:11:24 +0000 (03:11 +0000)]
Remove reserved identifier & some unnecessary 'inline'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232308
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 03:03:41 +0000 (03:03 +0000)]
Remove use of reserved identifier
& some unnecessary 'inline' keywords
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232307
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Sun, 15 Mar 2015 02:02:53 +0000 (02:02 +0000)]
[dsymutil] Add an way to iterate over a DebugMapObject symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232305
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 01:42:28 +0000 (01:42 +0000)]
Remove use of unreserved identifier (_Self)
And some unnecessary inline keywords
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232304
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 01:40:42 +0000 (01:40 +0000)]
Remove use of a reserved identifier
(& some unnecessary 'inline' keywords, too)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232303
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 01:37:01 +0000 (01:37 +0000)]
Remove use of reserved identifier
The C++ standard reserves all identifiers starting with an underscore
followed by an uppercase letter for the implementation for any use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232302
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 15 Mar 2015 01:30:58 +0000 (01:30 +0000)]
llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump
llvm-vtabledump has grown enough functionality not related to vtables
that it deserves a name which is more descriptive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232301
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Sun, 15 Mar 2015 01:29:30 +0000 (01:29 +0000)]
[dsymutil] Add function size to the debug map.
The debug map embedded by ld64 in binaries conatins function sizes.
These sizes are less precise than the ones given by the debug information
(byte granularity vs linker atom granularity), but they might cover code
that is referenced in the line table but not in the DIE tree (that might
very well be a compiler bug that I need to investigate later).
Anyway, extracting that information is necessary to be able to mimic
dsymutil's behavior exactly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232300
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 01:23:20 +0000 (01:23 +0000)]
DbgIntrinsicInst: Downcast to specialized MDNodes in accessors
Change accessors to downcast to `MDLocalVariable` and `MDExpression`,
now that we have -verify checks in place to confirm that it's safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232299
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 01:21:37 +0000 (01:21 +0000)]
Remove some unnecessary 'inline' keywords
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232298
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 01:21:34 +0000 (01:21 +0000)]
IntervalIterator: Add move semantics rather than relying on broken implicit copy ctor (found with -Wdeprecated)
We were just getting lucky because the copy ctor would be elided by RVO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232297
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 01:21:30 +0000 (01:21 +0000)]
Verifier: Check debug info intrinsic arguments
Verify that debug info intrinsic arguments are valid. (These checks
will not recurse through the full debug info graph, so they don't need
to be cordoned of in `DebugInfoVerifier`.)
With those checks in place, changing the `DbgIntrinsicInst` accessors to
downcast to `MDLocalVariable` and `MDExpression` is natural (added isa
specializations in `Metadata.h` to support this).
Added tests to `test/Verifier` for the new -verify checks, and fixed the
debug info in all the in-tree tests.
If you have out-of-tree testcases that have started to fail to -verify,
hopefully the verify checks are helpful. The most likely problem is
that the expression argument is `!{}` (instead of `!MDExpression()`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232296
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 15 Mar 2015 01:03:19 +0000 (01:03 +0000)]
[opaque pointer type] IRBuilder gep migration progress
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232294
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Sun, 15 Mar 2015 00:52:21 +0000 (00:52 +0000)]
Made CFLAA agree with clang-format. NFC.
So everyone's lives are easier in the future
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232293
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:50:57 +0000 (00:50 +0000)]
Verifier: Remove unnecessary null check
This is already assumed to be non-null above due to a dyn_cast<>. Also
remove extraneous braces around statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232292
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:46:57 +0000 (00:46 +0000)]
Verifier: Make the raw_ostream constructor argument required
This was passed inconsistently; seems clearer to make it required anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232291
91177308-0d34-0410-b5e6-
96231b3b80d8