Commit Graph

115640 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
a04d764104 DebugInfo: Hide isScopeRef() and isTypeRef() behind NDEBUG
The copies of these in `lib/IR/DebugInfo.cpp` are apparently [1] only
used in assertions now, so hide them behind `#ifndef NDEBUG`.

[1]: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/9238

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233661 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 01:47:55 +00:00
Duncan P. N. Exon Smith
12b14d9a76 DebugInfo: Factor out RETURN_FROM_RAW, etc.
Remove the helper macros `RETURN_FROM_RAW()`,
`RETURN_DESCRIPTOR_FROM_RAW()`, and `RETURN_REF_FROM_RAW()`, since they
don't do anything too special anymore.  This loses an `assert(get())`,
but I'm hoping any crashes were shaken out when r232844 landed a few
weeks ago.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233660 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 01:47:37 +00:00
Duncan P. N. Exon Smith
c2baee4da6 Verifier: Check reference flags in debug info
Move over checks of `&` and `&&` flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233658 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 01:28:58 +00:00
Duncan P. N. Exon Smith
c0bf4a0671 Verifier: Move more debug info checks away from Verify()
Most of these checks were already in the `Verifier` so this is more of a
cleanup.  Now almost everything is over there.

Now that require a `name:` for `MDGlobalVariable`, add a check in
`LLParser` for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233657 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 01:28:22 +00:00
Duncan P. N. Exon Smith
0cbd7fc433 DebugInfo: Move debug info flags to the new hierarchy
Move definition of the debug info flags to the new hierarchy, but leave
them duplicated in `DIDescriptor` for now to reduce code churn.  My
current plan is to remove `DIDescriptor` entirely, so the duplication
should go away naturally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 01:19:51 +00:00
Duncan P. N. Exon Smith
2f5cbb5947 Verifier: Move checks over from DIDescriptor::Verify()
Move over some more checks from `DIDescriptor::Verify()`, and change
`LLParser` to require non-null `file:` fields in compile units.

I've ignored the comment in test/Assembler/metadata-null-operands.ll
since I disagree with it.  At the time that test was written (r229960),
the debug info verifier wasn't on by default, so my comment there is in
the context of not expecting the verifier to be useful.  It is now, and
besides that, since r233394 we can check when parsing textual IR whether
an operand is null that shouldn't be.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233654 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 00:47:15 +00:00
Quentin Colombet
9e5f04d219 [AArch64] Fix poor codegen for add immediate.
We used to match the register variant before the immediate when the register
argument could be implicitly zero-extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233653 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 00:31:13 +00:00
Duncan P. N. Exon Smith
16710b289b DebugInfo: Remove LexicalBlockFile scope/context distinction
Two things here:

 1. I read `getScope()` and `getContext()` backwards in r233640.  There
    was no need for `getScopeOfScope()`.  Obviously not enough test
    coverage here (as I said in that commit, I'm going to come back to
    that), but anyway I'm reverting to the behaviour before r233640.
 2. The callers that use `DILexicalBlockFile::getContext()` don't seem
    to care about the difference.  Just have it redirect to `getScope()`
    so I can't get confused again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233650 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 00:10:37 +00:00
Eric Christopher
e2424b02b2 Replace the MCSubtargetInfo parameter with a Triple when creating
an MCInstPrinter. Update all callers and use where we wanted a Triple
previously.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233648 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 00:10:04 +00:00
NAKAMURA Takumi
6dd9e8563b llvm/examples: Suppress building a few JIT examples.
examples/ExceptionDemo/CMakeFiles/ExceptionDemo.dir/ExceptionDemo.cpp.o:(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 00:03:43 +00:00
NAKAMURA Takumi
d5285ead92 llvm/examples: Add RuntimeDyld as libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 00:03:36 +00:00
Duncan P. N. Exon Smith
1aa1d1a46c LexicalScopes: Cleanup remaining uses of DebugLoc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233644 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 23:58:59 +00:00
Duncan P. N. Exon Smith
497110d1b0 DebugLoc: Remove getFromDILexicalBlock()
The only user of `DebugLoc::getFromDILexicalBlock()` was creating a new
`MDLocation` as convenient API for passing an `MDScope`.  Stop doing
that, and remove the API.  If in the future we actually *want* to create
new DebugLocs, calling `MDLexicalBlock::get()` makes more sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233643 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 23:47:26 +00:00
Duncan P. N. Exon Smith
62e3e389b9 LexicalScopes: Use debug info hierarchy pervasively
Pervasively use the types provided by the debug info hierarchy rather
than `MDNode` in `LexicalScopes`.

I noticed (again, I guess, based on comments in the implementation?)
that `DILexicalBlockFile::getScope()` returns something different from
`DILexicalBlockFile::getContext()`.  I created a local helper for
getting the same logic from `MDLexicalBlockFile` called
`getScopeOfScope()`.  I still don't really understand it, but I've added
some FIXMEs and I'll come back to it (I suspect the way we encode these
objects isn't really ideal).

Note that my previous commit r233610 accidentally changed behaviour in
`findLexicalScope()` -- it transitioned from a call to
`DILexicalBlockFile::getScope()` to `MDLexicalBlockFile::getScope()`
(sounds right, doesn't it?) -- so I've fixed that as a drive-by.  No
tests failed with my error, so it looks like we're missing some coverage
here... when I come back to understand the logic, I'll see if I can add
some.

Other than the fix to `findLexicalScope()`, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233640 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 23:21:21 +00:00
David Majnemer
23ff386e07 Silence an unused variable warning.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233639 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 23:14:45 +00:00
Kostya Serebryany
3506457311 Move lib/Fuzzer docs from a README.txt to a proper .rst file.
Summary:
Move lib/Fuzzer docs from a README.txt to a proper .rst file.
This change does not add any content, just formatting.

Test Plan: n/a

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233638 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 23:05:30 +00:00
Kostya Serebryany
e6d25ad0e0 [fuzzer] when a single unit takes over 1 second to run and it is the slowest one so far, print it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233637 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 23:04:35 +00:00
David Majnemer
0a8ff297ad [WinEH] Run cleanup handlers when an exception is thrown
Generate tables in the .xdata section representing what actions to take
when an exception is thrown.  This currently fills in state for
cleanups, catch handlers are still unfinished.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233636 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:58:10 +00:00
Juergen Ributzka
1c8595529b Transfer implicit operands when expanding the RET_ReallyLR pseudo instruction.
When we expand the RET_ReallyLR pseudo instruction we also need to transfer the
implicit operands.

The return register is an implicit operand and without it the liveness
calculation generates an incorrect live-out set for the patchpoint.

This fixes rdar://problem/19068476.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233635 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:45:56 +00:00
Kostya Serebryany
b0b7c53ee4 [fuzzer] print various stats in a unified way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:44:03 +00:00
Alexei Starovoitov
5ca9ec70fd [bpf] add support for bswap instructions
BPF has cpu_to_be and cpu_to_le instructions.
For now assume little endian and generate cpu_to_be for ISD::BSWAP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233620 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:40:40 +00:00
Alexei Starovoitov
adb58c18f5 [bpf] fix build
fix build broken due to r233599.
Would still need to switch to MDLocation long term.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233619 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:40:35 +00:00
Eric Christopher
910e36d7bc Rename const char *Triple argument to TT to avoid shadowing llvm::Triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233615 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:31:14 +00:00
Eric Christopher
8225e356af Remove unused MCSubtargetInfo argument from the X86 MCInstPrinter ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233614 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:16:37 +00:00
Kostya Serebryany
29c6bd6e4f DFSan-based fuzzer (proof of concept).
Summary:
This adds a simple DFSan-based (i.e. taint-guided) fuzzer mutator,
see the comments for details.

Test Plan: a test added

Reviewers: samsonov, pcc

Reviewed By: samsonov, pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233613 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:09:51 +00:00
Eric Christopher
5bd9d1e811 Remove unused MCSubtargetInfo argument from the Sparc MCInstPrinter ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:09:43 +00:00
Eric Christopher
c94e8e8a81 Remove unused MCSubtargetInfo argument from the NVPTX MCInstPrinter ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 22:03:16 +00:00
Duncan P. N. Exon Smith
35ff67e333 LexicalScopes: Use MDLocation directly instead of DebugLoc
There's no benefit to using `DebugLoc` here.  Moreover, this will let a
follow-up commit work with `MDScope` directly instead of `DebugLoc`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233610 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:54:46 +00:00
Eric Christopher
87b7793cdc Remove unused MCSubtargetInfo argument from the ARM MCInstPrinter ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233609 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:52:28 +00:00
Eric Christopher
cdd8ee38ea Remove unused MCSubtargetInfo argument from the AArch64 MCInstPrinter ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233608 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:52:26 +00:00
Eric Christopher
1c60a4e36b Remove unused Target argument from MCInstPrinter ctor functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233607 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:52:21 +00:00
Quentin Colombet
affc406350 [RegisterCoalescer] Fix a potential misuse of direct operand index in the
terminal rule.
Spot by code inspection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233606 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:50:44 +00:00
David Blaikie
25e3d2d6d3 [opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type
This pushes the use of PointerType::getElementType up into several
callers - I'll essentially just have to keep pushing that up the stack
until I can eliminate every call to it...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233604 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:41:43 +00:00
Rafael Espindola
a55ae077e4 Fix PR23045.
Keep a note in the materializer that we are stripping debug info so that
user doing a lazy read of the module don't hit outdated formats.

Thanks to Duncan for suggesting the fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:36:43 +00:00
Duncan P. N. Exon Smith
7f3757eb9b Transforms: Update unit tests to use verifyModule()
Since I'm slowly gutting `DISubprogram` and `DICompileUnit`, update the
`CloneFunc` unit tests to call `verifyModule()` (where the checks are
moving to).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233602 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:35:14 +00:00
Duncan P. N. Exon Smith
494ae8db19 DwarfDebug: Avoid creating new DebugLocs in the backend
Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s,
in the backend.  We just want to grab the subprogram here anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233601 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:32:28 +00:00
Paul Robinson
769b935ebc Explain how to abandon a review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233600 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:27:28 +00:00
Duncan P. N. Exon Smith
6d42c0084e DebugInfo: Remove dead code from old DebugLoc API
Remove old API for `DebugLoc` now that all the callers have been
updated.  If this broke your out-of-tree build, here's a quick map from
the old API to the new one:

    DebugLoc DebugLoc::getFromMDLocation(MDNode *)
      => DebugLoc::DebugLoc(MDLocation *)
      => explicit DebugLoc::DebugLoc(MDNode *) // works with broken code

    MDNode *DebugLoc::getAsMDNode(LLVMContext &)
      => MDLocation *DebugLoc::get()
      => DebugLoc::operator MDLocation *()
      => MDNode *DebugLoc::getAsMDNode() // works with broken code

    bool DebugLoc::isUnknown()
      => DebugLoc::operator MDLocation *()
          i.e.: if (MDLocation *DL = ...)
      => DebugLoc::operator bool() // works with broken code
          i.e.: if (DebugLoc DL = ...)

    void DebugLoc::getScopeAndInlinedAt(MDNode *&, MDNode *&)
      => use: MDNode *DebugLoc::getScope()
         and: MDLocation *DebugLoc::getInlinedAt()

    MDNode *DebugLoc::getScopeNode(LLVMContext &)
      => MDNode *DebugLoc::getInlinedAtScope()

    void DebugLoc::dump(LLVMContext &)
      => void DebugLoc::dump()

    void DebugLoc::getFnDebugLoc(LLVMContext &)
      => void DebugLoc::getFnDebugLoc()

    MDNode *DebugLoc::getScope(LLVMContext &)
      => MDNode *DebugLoc::getScope()

    MDNode *DebugLoc::getInlinedAt(LLVMContext &)
      => MDLocation *DebugLoc::getInlinedAt()

I've noted above the only functions that won't crash on broken code (due
to downcasting to `MDLocation`).  If your code could be dealing with
broken IR (i.e., you haven't run the verifier yet, or you've used a
temporary node that will eventually (but not yet) get RAUW'ed to an
`MDLocation`), you need to restrict yourself to those.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233599 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:19:50 +00:00
Rafael Espindola
37780d81b1 Use range loops and add missing braces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:18:36 +00:00
Duncan P. N. Exon Smith
454c320c6e Transforms: Fix a use of the old DebugLoc in unittests
Missed this one before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233597 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 21:05:29 +00:00
David Blaikie
f9ed6b05a5 [opaque pointer type] More IRBuilder::createGEP (non-inbounds) migrations: CodeGenPrepare and SimplifyLibCalls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233596 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 20:42:56 +00:00
Peter Collingbourne
07ee8d2fc1 MC: For variable symbols, maintain MCSymbol::Section as a cache.
This fixes the visibility of symbols in certain edge cases involving aliases
with multiple levels of indirection.

Fixes PR19582.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233595 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 20:41:21 +00:00
Duncan P. N. Exon Smith
68338f833e llvm-dis: Use the new DebugLoc API, NFC
Update tools/llvm-dis to use the new `DebugLoc` API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233590 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 20:04:06 +00:00
Duncan P. N. Exon Smith
f175439a2b Transforms: Use the new DebugLoc API, NFC
Update lib/Analysis and lib/Transforms to use the new `DebugLoc` API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233587 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 19:49:49 +00:00
Duncan P. N. Exon Smith
39acf8f243 IR: Use the new DebugLoc API, NFC
Update lib/IR and lib/Bitcode to use the new `DebugLoc` API.  Added an
explicit conversion to `bool` (avoiding a conversion to `MDLocation`),
since a couple of these use cases need to handle broken code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233585 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 19:40:05 +00:00
Paul Robinson
103d622517 Verify 'optnone' can run DAG combiner when appropriate.
Adds a test to verify the behavior that r233153 restored: 'optnone'
does not spuriously disable the DAG combiner, and in fact there are
cases where the DAG combiner must run (even at -O0 or 'optnone') in
order for codegen to succeed.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233584 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 19:37:44 +00:00
Justin Holewinski
e6d6461067 [NVPTX] Associate a minimum PTX version for each SM architecture
When a new SM architecture is introduced, it is only supported by the
current PTX version and later.  Make sure we are using at least the
minimum PTX version for the target architecture.

This also removes support for PTX ISA < 3.2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233583 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 19:30:55 +00:00
Duncan P. N. Exon Smith
3637babc4c CodeGen: Use the new DebugLoc API, NFC
Update lib/CodeGen (and lib/Target) to use the new `DebugLoc` API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233582 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 19:14:47 +00:00
Kit Barton
9039fc77c3 [PPC] Modify HTM and crypto intrinsics to inherit from GCCBuiltin
There was a change to the way some of the HTM and crypto builtins are being
handled in Clang. Previously, some of the builtins were dealt with in the
CodeGenFunction::EmitPPCBuiltinExpr method (in order to do range checking on
constant arguments). These check will been moved to Sema
http://reviews.llvm.org/D8672), which means those builtins will not be handled
in the EmitPPCBuiltinExpr method anymore. As a result, the definition of the
intrinsics in IntrinsicsPowerPC.td needs to be modified to inherit from the
GCCBuiltin definition.

http://reviews.llvm.org/D8673


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 18:46:15 +00:00
Duncan P. N. Exon Smith
770661092f DebugInfo: Reflow printDebugLoc() to use early returns, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233580 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 18:45:11 +00:00