Commit Graph

115159 Commits

Author SHA1 Message Date
Rafael Espindola
e9141ce303 Convert the easy cases of GetTempSymbol to createTempSymbol.
In these cases no code was depending on GetTempSymbol finding an existing
symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232478 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 14:22:31 +00:00
Rafael Espindola
e503379196 Don't duplicate comment from the .h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232476 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 14:06:24 +00:00
Rafael Espindola
a480f88b3c Move the EH symbol to the asm printer and use it for the SJLJ case too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232475 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 13:57:48 +00:00
Toma Tabacu
f28b151b52 [mips] [IAS] Add support for the XOR $reg,imm pseudo-instruction.
Summary:
This adds a MipsInstAlias which expands to XORi $reg,$reg,imm. For example, "xor $6, 0x3A" should be expanded to "xori $6, $6, 58".
This should work for all MIPS ISAs.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8284

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 13:17:44 +00:00
Rafael Espindola
03b47b8e5b Remove dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232472 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 13:09:01 +00:00
Rafael Espindola
4d3df54336 Replace a use of GetTempSymbol with createTempSymbol.
This is cleaner and avoids a crash in a corner case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232471 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 12:54:04 +00:00
Daniel Sanders
06c5d245a2 Fix r232466 by adding 'i' to the mappings for inline assembly memory constraints.
It's not completely clear why 'i' has historically been treated as a memory
constraint. According to the documentation, it represents a constant immediate.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232470 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 12:00:04 +00:00
Renato Golin
ce1f16421f [ARM] Add support for ARMV6K subtarget (LLVM)
ARMv6K is another layer between ARMV6 and ARMV6T2. This is the LLVM
side of the changes.

ARMV6 family LLVM implementation.

+-------------------------------------+
| ARMV6                               |
+----------------+--------------------+
| ARMV6M (thumb) | ARMV6K (arm,thumb) | <- From ARMV6K and ARMV6M processors
+----------------+--------------------+    have support for hint instructions
| ARMV6T2 (arm,thumb,thumb2)          |    (SEV/WFE/WFI/NOP/YIELD). They can
+-------------------------------------+    be either real or default to NOP.
| ARMV7 (arm,thumb,thumb2)            |    The two processors also use
+-------------------------------------+    different encoding for them.

Patch by Vinicius Tinti.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 11:55:28 +00:00
Daniel Sanders
a0a7510711 [ppc] Distinguish the 'es', 'o', 'm', 'Q', 'Z', and 'Zy' inline assembly memory constraints.
Summary:
But still handle them the same way since I don't know how they differ on
this target.

Of these, 'es', and 'Q' do not have backend tests but are accepted by
clang.

No functional change intended. Depends on D8173.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8213

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232466 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 11:09:13 +00:00
Yaron Keren
0401f798d1 Teach Twine to support SmallString.
Enable removing .str() member calls for these frequent cases. 

 http://reviews.llvm.org/D6372



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 09:51:17 +00:00
David Blaikie
c57441f716 Recommit simplification first attempted in r232309 (fixed a bit in r232312, with fixes in r232314)
Messed it up because I didn't realize there were two different iterators
here (& clearly didn't build any of this... ) - still seems easier to
just use the injected class name than introduce a self typedef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 05:49:45 +00:00
Ahmed Bougacha
df08543f48 [AArch64] Use intermediate step for concat_vectors of illegal truncs.
Optimize concat_vectors of truncated vectors, where the intermediate
type is illegal, to avoid said illegality,  e.g.,
  (v4i16 (concat_vectors (v2i16 (truncate (v2i64))),
                         (v2i16 (truncate (v2i64)))))
->
  (v4i16 (truncate (v4i32 (concat_vectors (v2i32 (truncate (v2i64))),
                                          (v2i32 (truncate (v2i64)))))))

This isn't really target-specific, and, as such, would best go in the
DAGCombiner.  However, ISD::TRUNCATE legality isn't keyed on both input
and result type, so we might generate worse code when we don't know
better.  On AArch64 we know it's fine for v2i64->v4i16 and v4i32->v8i8.
rdar://20022387


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232459 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 03:23:09 +00:00
Ahmed Bougacha
1c48733f54 [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
2015-03-17 03:19:18 +00:00
Richard Smith
3d8b0caf98 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
2015-03-17 02:36:51 +00:00
Shankar Easwaran
64a7eb58cd [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
2015-03-17 02:12:35 +00:00
Sanjoy Das
505179177b [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
2015-03-17 01:40:24 +00:00
Sanjoy Das
71bd86378b [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
2015-03-17 01:40:22 +00:00
Duncan P. N. Exon Smith
ed1d6bdfbd 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
2015-03-17 01:14:40 +00:00
Sanjoy Das
58d2381868 [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
2015-03-17 00:54:50 +00:00
Sanjoy Das
51c83cddb6 [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
2015-03-17 00:42:16 +00:00
Sanjoy Das
eaf8532f7a [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
2015-03-17 00:42:13 +00:00
Justin Bogner
bdd2212363 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
2015-03-17 00:18:51 +00:00
Duncan P. N. Exon Smith
b47d918825 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
2015-03-17 00:16:35 +00:00
Justin Bogner
6837ab53fb 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
2015-03-16 23:52:03 +00:00
Peter Collingbourne
4556b1fe22 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
2015-03-16 23:36:24 +00:00
Rafael Espindola
7b8bb89ecd 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
2015-03-16 22:29:29 +00:00
Rafael Espindola
63641de2e6 Remove unused argument. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232428 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 22:06:15 +00:00
David Blaikie
712d00bc64 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
2015-03-16 22:03:50 +00:00
David Blaikie
2a83bf6228 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
2015-03-16 21:48:46 +00:00
Rafael Espindola
9130d115d6 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
2015-03-16 21:43:42 +00:00
Justin Bogner
4fefd5cdf4 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
2015-03-16 21:40:18 +00:00
David Majnemer
759acf348d 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
2015-03-16 21:36:38 +00:00
David Blaikie
f1d4614418 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
2015-03-16 21:35:48 +00:00
Duncan P. N. Exon Smith
9b4250d309 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
2015-03-16 21:23:56 +00:00
Duncan P. N. Exon Smith
bee74a3ad4 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
2015-03-16 21:21:10 +00:00
Duncan P. N. Exon Smith
763e18696f 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
2015-03-16 21:10:12 +00:00
Duncan P. N. Exon Smith
30d7c8989b 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
2015-03-16 21:05:33 +00:00
Duncan P. N. Exon Smith
3d5527fb43 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
2015-03-16 21:03:55 +00:00
Duncan P. N. Exon Smith
83c42e65fb 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
2015-03-16 20:46:27 +00:00
Duncan P. N. Exon Smith
c77560e219 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
2015-03-16 20:24:02 +00:00
Kevin Enderby
6250724c87 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
2015-03-16 20:08:09 +00:00
Rafael Espindola
f4b6b048ad 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
2015-03-16 20:02:28 +00:00
Duncan P. N. Exon Smith
3c0d9fa2d4 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
2015-03-16 19:01:54 +00:00
Sanjay Patel
8233e8c233 fixed to test feature, not CPU
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232398 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 18:24:28 +00:00
David Blaikie
bf71e29ec5 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
2015-03-16 18:18:32 +00:00
Joerg Sonnenberger
44f89d36e3 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
2015-03-16 18:15:27 +00:00
David Blaikie
7610ba7d24 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
2015-03-16 18:06:57 +00:00
Akira Hatanaka
ed7120e7fd [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
2015-03-16 18:02:16 +00:00
Sanjay Patel
89095a7882 add CHECK-LABELs for more reliable testing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232391 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 17:59:07 +00:00
Duncan P. N. Exon Smith
a718967977 Fix doxygen comments from r232268
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232388 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 17:49:03 +00:00