Anders Waldenborg [Tue, 14 Apr 2015 09:18:17 +0000 (09:18 +0000)]
Fix crash in DebugInfoFinder when adding a module with forward declared composite type
The testcase that is included in the patch caused a crash when doing DebugInfoFinder::processModule
on the module due to DCT->getElements() returning nullptr in DebugInfoFinder::processType.
By doing "DCT->getElements()" instead of "DCT->getElements()->operands()" one gets a DIArray
instead of a raw MDTuple. The former has code to handle null as a 0-element array and
therefore avoids the crash.
Differential Revision: http://reviews.llvm.org/D9008
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234875
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Tue, 14 Apr 2015 04:59:22 +0000 (04:59 +0000)]
Simplify n-ary adds by reassociation
Summary:
This transformation reassociates a n-ary add so that the add can partially reuse
existing instructions. For example, this pass can simplify
void foo(int a, int b) {
bar(a + b);
bar((a + 2) + b);
}
to
void foo(int a, int b) {
int t = a + b;
bar(t);
bar(t + 2);
}
saving one add instruction.
Fixes PR22357 (https://llvm.org/bugs/show_bug.cgi?id=22357).
Test Plan: nary-add.ll
Reviewers: broune, dberlin, hfinkel, meheff, sanjoy, atrick
Reviewed By: sanjoy, atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8950
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234855
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:51:36 +0000 (03:51 +0000)]
DebugInfo: Update signature of DICompileUnit::replace*()
Change `DICompileUnit::replaceSubprograms()` and
`DICompileUnit::replaceGlobalVariables()` to match the `MDCompileUnit`
equivalents that they're wrapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234852
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Tue, 14 Apr 2015 03:49:53 +0000 (03:49 +0000)]
LinkAllPasses.h: also link in parts of libLLVMSupport
When a loadable (.so or .dylib) pass is built with assertions enabled and
loaded into the 'opt' tool, we need to ensure that the extra symbols that such
passes depend on are linked into the tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234851
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:40:37 +0000 (03:40 +0000)]
DebugInfo: Gut DISubprogram and DILexicalBlock*
Gut the `DIDescriptor` wrappers around `MDLocalScope` subclasses. Note
that `DILexicalBlock` wraps `MDLexicalBlockBase`, not `MDLexicalBlock`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234850
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 14 Apr 2015 03:20:40 +0000 (03:20 +0000)]
[SCEVExpander] Fix comments for functions. NFC.
Bring function documentation for ScalarEvolutionExpander up to code by
not repeating the function name in the comment documenting
functionality. Reflow the edited comments where needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234847
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 14 Apr 2015 03:20:38 +0000 (03:20 +0000)]
[LoopUnrollRuntime] Avoid high-cost trip count computation.
Summary:
Runtime unrolling of loops needs to emit an expression to compute the
loop's runtime trip-count. Avoid runtime unrolling if this computation
will be expensive.
Depends on D8993.
Reviewers: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8994
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234846
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 14 Apr 2015 03:20:32 +0000 (03:20 +0000)]
[SCEV] Strengthen SCEVExpander::isHighCostExpansion.
Summary:
Teach `isHighCostExpansion` to consider divisions by power-of-two
constants as cheap and add a test case. This change is needed for a new
user of `isHighCostExpansion` that will be added in a subsequent change.
Depends on D8995.
Reviewers: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8993
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234845
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 14 Apr 2015 03:20:28 +0000 (03:20 +0000)]
[SCEV] Refactor out isHighCostExpansion. NFCI.
Summary:
Move isHighCostExpansion from IndVarSimplify to SCEVExpander. This
exposed function will be used in a subsequent change.
Reviewers: bogner, atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8995
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234844
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:01:27 +0000 (03:01 +0000)]
DebugInfo: Gut DINamespace and DITemplate*Parameter
Continue gutting `DIDescriptor` subclasses, turning them into
as-bare-as-possible pointer wrappers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234843
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 02:50:07 +0000 (02:50 +0000)]
DebugInfo: Add MDLexicalBlockBase::getLine(), etc.
Add a few functions from `DILexicalBlock` to `MDLexicalBlockBase`,
leaving `DILexicalBlock` a simple wrapper.
IMO, the new functions (`getLine()` and `getColumn()`) don't really
belong in the base class, but to simplify transitioning old code it
seems like the right incremental step. I've explicitly deleted them in
`MDLexicalBlockFile`, and eventually the callers should be updated to
downcast to `MDLexicalBlock` directly and the forwarding functions
removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234842
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 02:22:36 +0000 (02:22 +0000)]
DebugInfo: Gut DIVariable and DIGlobalVariable
Gut all the non-pointer API from the variable wrappers, except an
implicit conversion from `DIGlobalVariable` to `DIDescriptor`. Note
that if you're updating out-of-tree code, `DIVariable` wraps
`MDLocalVariable` (`MDVariable` is a common base class shared with
`MDGlobalVariable`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234840
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Tue, 14 Apr 2015 02:10:35 +0000 (02:10 +0000)]
[RuntimeDyldELF] Improve GOT support
Summary:
This is the first in a series of patches to eventually add support for TLS relocations to RuntimeDyld. This patch resolves an issue in the current GOT handling, where GOT entries would be reused between object files, which leads to the same situation that necessitates the GOT in the first place, i.e. that the 32-bit offset can not cover all of the address space. Thus this patch makes the GOT object-file-local.
Unfortunately, this still isn't quite enough, because the MemoryManager does not yet guarantee that sections are allocated sufficiently close to each other, even if they belong to the same object file. To address this concern, this patch also adds a small API abstraction on top of the GOT allocation mechanism that will allow (temporarily, until the MemoryManager is improved) using the stub mechanism instead of allocating a different section. The actual switch from separate section to stub mechanism will be part of a follow-on commit, so that it can be easily reverted independently at the appropriate time.
Test Plan: Includes a test case where the GOT of two object files is artificially forced to be apart by several GB.
Reviewers: lhames
Reviewed By: lhames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8813
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234839
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 02:09:32 +0000 (02:09 +0000)]
DebugInfo: Move DIVariable::printExtendedName() to its only caller
Move the local function `printDebugLoc()` along with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234838
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 01:59:58 +0000 (01:59 +0000)]
DebugInfo: Inline DIVariable::isBlockByrefVariable() into its callers
I don't think this API is helping much. Change the callers to call
`MDType::isBlockByrefStruct()` directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234837
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 01:46:44 +0000 (01:46 +0000)]
DebugInfo: Gut DIObjCProperty and DIImportedEntity
Gut a couple more classes in the DIDescriptor hierarchy. Leave behind
an implicit conversion to `DIDescriptor`, the old base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234836
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 01:35:55 +0000 (01:35 +0000)]
DebugInfo: Gut DILocation
This is along the same lines as r234832, but for `DILocation`. Clean
out all accessors from `DILocation`. Any callers should be using
`MDLocation` directly (e.g., via `operator->()`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234835
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 14 Apr 2015 01:12:55 +0000 (01:12 +0000)]
[LoopAccesses] Properly print whether memchecks are needed
Fix oversight in -analyze output. PtrRtCheck contains the pointers that
need to be checked against each other and not whether memchecks are
necessary.
For instance in the testcase PtrRtCheck has four elements but all
no-alias so no checking is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234833
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 01:12:42 +0000 (01:12 +0000)]
DebugInfo: Gut DIExpression
Completely gut `DIExpression`, turning it into a simple wrapper around
`MDExpression *`. There are two bits of magic left:
- It's constructed from `const MDExpression*` but convertible to
`MDExpression*`.
- It's default-constructed to `nullptr`.
Otherwise, it should behave quite like a raw pointer. Once I've done
the same to the rest of the `DIDescriptor` subclasses, I'll come back to
delete them entirely (and update call sites as necessary to deal with
the missing magic).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234832
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 00:57:50 +0000 (00:57 +0000)]
DebugInfo: Move an assertion into MDCompositeTypeBase
In the name of gutting the `DIDescriptor` hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234829
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 14 Apr 2015 00:41:34 +0000 (00:41 +0000)]
[RewriteStatepointsForGC] Delete dead code [NFC]
Before we had real liveness, we needed to track every value that base pointer
insertion code created because these now might be live. We now just rerun
the data flow liveness algorithm (which is actually faster!) and no longer
need the associated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234827
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 00:35:42 +0000 (00:35 +0000)]
DebugInfo: Move DILocation::computeNewDiscriminators()
As documented in PR23200 (and the FIXMEs I've added to the code here),
this logic is fairly broken: it modifies the `LLVMContext` in a way that
affects other modules and cannot be serialized to assembly/bitcode. For
now, move it over to `MDLocation::computeNewDiscriminators()` anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234825
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 00:34:30 +0000 (00:34 +0000)]
AddDiscriminators: Create new MDLocation directly
I don't see a reason to add the `copyWithNewScope()` API over to
`MDLocation` -- it seems to be a holdover from when creating locations
required knowing details of operand layout -- so change
`AddDiscriminators` to call `MDLocation::get()` directly. Should be no
functionality change here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234824
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 14 Apr 2015 00:27:47 +0000 (00:27 +0000)]
[Orc] Revert 234815. Still haven't quite got this test figured out apparently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234822
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 00:05:13 +0000 (00:05 +0000)]
DebugInfo: Move DILocation::getDiscriminator() to MDLocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234819
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 23:55:01 +0000 (23:55 +0000)]
DebugInfo: Remove DIObjCProperty attribute accessors, NFC
There's only one user of the various `DIObjCProperty::is*Property()`
accessors -- `DwarfUnit::constructTypeDIE()` -- and it's just using the
reverse logic to reconstruct the bitfield. Drop this API and simplify
the only caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234818
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 23:36:36 +0000 (23:36 +0000)]
DebugInfo: Move DIDerivedType accessors to MDDerivedType, NFC
Add accessors in `MDDerivedType` to downcast `getExtraData()`, matching
those in `DIDerivedType`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234816
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 13 Apr 2015 23:28:46 +0000 (23:28 +0000)]
[Orc] Make the OrcLazy hello.ll regression test output via stderr.
This keeps the program and JIT output in sync, enabling FileCheck to test the
order of target program and JIT events.
In particular we can now test that main is not compiled until after the global
constructor has run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234815
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 13 Apr 2015 23:25:41 +0000 (23:25 +0000)]
Add new getModRefInfo API to determine whether an Instruction and a call modify the same memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234814
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 13 Apr 2015 23:20:13 +0000 (23:20 +0000)]
Common some code from MemoryDependenceAnalysis that will be used in MemorySSA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234813
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 23:13:18 +0000 (23:13 +0000)]
DebugInfo: Make DIDerivedType accessors more strict
These accessors in `DIDerivedType` should only be called when `DbgNode`
really is a `MDDerivedType`, not just a `MDDerivedTypeBase`. Assume
that it is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234812
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 13 Apr 2015 23:05:45 +0000 (23:05 +0000)]
Make getModRefInfo with a default location not crash.
Add getModRefInfo that works without location.
Add unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234811
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 13 Apr 2015 22:58:39 +0000 (22:58 +0000)]
[Orc] Back out r234805 for hello.ll until I can figure out how to sync up the
output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234810
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Mon, 13 Apr 2015 22:57:21 +0000 (22:57 +0000)]
[CodeGen] Combine concat_vectors of scalars into build_vector.
Combine something like:
(v8i8 concat_vectors (v2i8 bitcast (i16)) x4)
into:
(v8i8 (bitcast (v4i16 BUILD_VECTOR (i16) x4)))
If any of the scalars are floating point, use that throughout.
Differential Revision: http://reviews.llvm.org/D8948
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234809
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 13 Apr 2015 22:36:38 +0000 (22:36 +0000)]
Allow printing functions with an optional annotationwriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234807
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 13 Apr 2015 22:33:05 +0000 (22:33 +0000)]
[Orc] Disambiguate call to make_unique. This should fix the builders broken by
r234805.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234806
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 13 Apr 2015 22:12:54 +0000 (22:12 +0000)]
[Orc] Add an Orc layer for applying arbitrary transforms to IR, use it to add
debugging output to the LLI orc-lazy JIT, and update the orc-lazy "hello.ll"
test to actually test for lazy compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234805
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 21:58:26 +0000 (21:58 +0000)]
DebugInfo: Simplify a few more wrappers
This is almost NFC, but I'm removing some assertions against `nullptr`.
The assertions aren't worth all that much since we'll typically get
segfaults at the same site (and I imagine ASan catches this sort of
thing), and besides: the whole idea is to replace the `DIDescriptor`
hierarchy with raw pointers to the new one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234802
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 13 Apr 2015 21:55:21 +0000 (21:55 +0000)]
Settle on a specific triple for the aarch64 testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234801
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 21:38:48 +0000 (21:38 +0000)]
SelectionDAG: Stop using DIVariable::isInlinedFnArgument()
Instead of calling the somewhat confusingly-named
`DIVariable::isInlinedFnArgument()`, do the check directly here.
There's possibly a small functionality change here: instead of
`dyn_cast<>`'ing `DV->getScope()` to `MDSubprogram`, I'm looking up the
scope chain for the actual subprogram. I suspect that this is a no-op
for function arguments so in practise there isn't a real difference.
I've also added a `FIXME` to check the `inlinedAt:` chain instead, since
I wonder if that would be more reliable than the
`MDSubprogram::describes()` function.
Since this was the only user of `DIVariable::isInlinedFnArgument()`,
delete it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234799
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Mon, 13 Apr 2015 21:29:46 +0000 (21:29 +0000)]
[CMake] Updates to llvm-shlib to support overriding exports list and added an option to export all symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234798
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 13 Apr 2015 20:49:08 +0000 (20:49 +0000)]
Also add mtriple to the aarch64 testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234797
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 20:39:25 +0000 (20:39 +0000)]
DebugInfo: Remove DIGlobalVariable::getGlobal()
`DIGlobalVariable::getGlobal()` isn't really helpful, it just does a
`dyn_cast_or_null<>`. Simplify its only user by doing the cast directly
and delete the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234796
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 13 Apr 2015 20:37:01 +0000 (20:37 +0000)]
Expand ADDO/SUBO on Hexagon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234795
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 13 Apr 2015 20:24:40 +0000 (20:24 +0000)]
Add mtriple to test case to avoid problems with different naming schemes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234793
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 20:13:30 +0000 (20:13 +0000)]
StripSymbols: Use DIGlobalVariable::getConstant() instead of getGlobal()
The only difference between the two is a `dyn_cast<>` to
`GlobalVariable`. If optimizations have left anything behind when a
global gets replaced, then it doesn't seem like the debug info is dead.
I can't seem to find an optimization that would leave behind a
non-`GlobalVariable` without nulling the reference entirely, so I
haven't added a testcase (but I'll be deleting `getGlobal()` in a future
commit).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234792
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 13 Apr 2015 20:03:08 +0000 (20:03 +0000)]
GCC complains thusly: "attributes at the beginning of statement are ignored [-Werror=attributes]". Very well then! NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234788
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 13 Apr 2015 20:00:30 +0000 (20:00 +0000)]
[RwriteStatepointsForGC] Minor indentation and naming [NFC]
Use early-return style that's preferred in LLVM and updating the naming in places I touched with other changes in the last few days. Hopefully, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234785
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 19:44:31 +0000 (19:44 +0000)]
DebugInfo: Remove a few unnecessary wrappers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234783
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 19:41:30 +0000 (19:41 +0000)]
DebugInfo: Assume valid pointer in DISubprogram::replaceFunction()
Other accessors assume this already; not sure how `replaceFunction()`
got left behind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234782
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 13 Apr 2015 19:17:37 +0000 (19:17 +0000)]
Subtraction is not commutative. Fixes PR23212!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234780
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 13 Apr 2015 19:07:47 +0000 (19:07 +0000)]
[RewriteStatepointsForGC] Avoid inserting empty holder
We use dummy calls to adjust the liveness of values over statepoints in the midst of the insertion. If there are no values which need held live, there's no point in actually inserting the holder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234779
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 19:07:27 +0000 (19:07 +0000)]
DebugInfo: Migrate DISubprogram::describes() to new hierarchy, NFC
I don't really like this function at all -- I think it should be as
simple as `return getFunction() == F` -- but for now this seems like the
best we can do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234778
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 13 Apr 2015 18:57:50 +0000 (18:57 +0000)]
Remove this test until I figure out why it fails
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234777
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 18:53:11 +0000 (18:53 +0000)]
Reapply "Verifier: Check for incompatible bit piece expressions"
This reverts commit r234717, reapplying r234698 (in spirit).
As described in r234717, the original `Verifier` check had a
use-after-free. Instead of storing pointers to "interesting" debug info
intrinsics whose bit piece expressions should be verified once we have
typerefs, do a second traversal. I've added a testcase to catch the
`llc` crasher.
Original commit message:
Verifier: Check for incompatible bit piece expressions
Convert an assertion into a `Verifier` check. Bit piece expressions
must fit inside the variable, and mustn't be the entire variable.
Catching this in the verifier will help us find bugs sooner, and makes
`DIVariable::getSizeInBits()` dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234776
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 13 Apr 2015 18:47:19 +0000 (18:47 +0000)]
Use FileCheck for test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234774
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 13 Apr 2015 18:43:38 +0000 (18:43 +0000)]
[inliner] Don't inline a function if it doesn't have exactly the same
target-cpu and target-features attribute strings as the caller.
Differential Revision: http://reviews.llvm.org/D8984
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234773
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 13 Apr 2015 18:39:52 +0000 (18:39 +0000)]
Make the ARM testcase from r234764 also pass on Thumb
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234772
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 13 Apr 2015 18:07:21 +0000 (18:07 +0000)]
[RewriteStatepointsForGC] Fix a latent bug in normalization for invoke statepoint [NFC]
Since we're restructuring the CFG, we also need to make sure to update the analsis passes. While I'm touching the code, I dedicided to restructure it a bit. The code involved here was very confusing. This change moves the normalization to essentially being a pre-pass before the main insertion work and updates a few comments to actually say what is happening and *why*.
The restructuring should be covered by existing tests. I couldn't easily see how to create a test for the invalidation bug. Suggestions welcome.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234769
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Mon, 13 Apr 2015 17:47:15 +0000 (17:47 +0000)]
Revert revisions r234755, r234759, r234760
Revert "Remove default in fully-covered switch (to fix Clang -Werror -Wcovered-switch-default)"
Revert "R600: Add carry and borrow instructions. Use them to implement UADDO/USUBO"
Revert "LegalizeDAG: Try to use Overflow operations when expanding ADD/SUB"
Using overflow operations fails CodeGen/Generic/2011-07-07-ScheduleDAGCrash.ll
on hexagon, nvptx, and r600. Revert while I investigate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234768
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 13 Apr 2015 17:35:55 +0000 (17:35 +0000)]
[RewriteStatepointsForGC] Strengthen assertions around liveness
This is related to the issues addressed in 234651. These assertions check the properties ensured by that change at the place of use. Note that a similiar property is checked in checkBasicSSA, but without the reachability constraint. Technically, the liveness would be correct to include unreachable values, but this would be problematic for actual relocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234766
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 13 Apr 2015 17:16:45 +0000 (17:16 +0000)]
Allow memory intrinsics to be tail calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234764
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 13 Apr 2015 17:16:33 +0000 (17:16 +0000)]
DAGCombiner: Fix crash in select(select) opt.
In case of different types used for the condition of the selects the
select(select) -> select(and) normalisation cannot be performed.
See also: http://reviews.llvm.org/D7622
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234763
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 13 Apr 2015 16:41:32 +0000 (16:41 +0000)]
[RewriteStatepointsForGC] Move an expensive debugging check to XDEBUG
The check in question is attempting to help find cases where we haven't relocated a pointer at a safepoint we should have. It does this by coercing the value to null at any safepoint which doesn't relocate it.
Unfortunately, this turns out to be rather expensive in terms of memory usage and time. The number of stores inserted can grow with O(number of values x number of statepoints). On at least one example I looked at, over half of peak memory usage was coming from this check.
With this change, the check is no longer enabled by default in Asserts builds. It is enabled for expensive asserts builds and has a command line option to enable it in both Asserts and non-Asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234761
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 13 Apr 2015 16:37:50 +0000 (16:37 +0000)]
Remove default in fully-covered switch (to fix Clang -Werror -Wcovered-switch-default)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234760
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Mon, 13 Apr 2015 16:26:00 +0000 (16:26 +0000)]
R600: Add carry and borrow instructions. Use them to implement UADDO/USUBO
v2: tighten the sub64 tests
v3: rename to CARRY/BORROW
v4: fixup test cmdline
add known bits computation
use sign extend instead of sub 0,x
better add test
v5: remove redundant break
move lowering to separate functions
fix comments
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewers: arsenm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234759
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 13 Apr 2015 16:05:49 +0000 (16:05 +0000)]
llvm-readobj: teach it to handle MachO Universal Archive correctly
Patch by Chilledheart (rwindz0@gmail.com).
Reviewed By: rafael
Differential Revision: http://reviews.llvm.org/D8773
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234758
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 13 Apr 2015 16:04:17 +0000 (16:04 +0000)]
[docs] Update outdated ExtendingLLVM.rst
Summary:
The document is still incomplete in some degrees, but updated to reflect the
latest changes. Anyway we can detail it if any one think it is not enough. For
the sake of it, some useful examples are listed below:
Refer to r113618 "Add X86 MMX type to bitcode and Type" for how to add a new
type.
> One notable change from then is only one thing that ``lib/VMCore`` is renamed
to ``lib/IR``.
Refer to r194760 "Add addrspacecast instruction" for how to add a new
instruction.
Patch by Chilledheart (rwindz0@gmail.com).
Reviewed By: echristo
Differential Revision: http://reviews.llvm.org/D8897
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234757
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Mon, 13 Apr 2015 15:32:01 +0000 (15:32 +0000)]
LegalizeDAG: Try to use Overflow operations when expanding ADD/SUB
v2: consider BooleanContents when processing overflow
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewers: resistor, jholewinsky (nvidia parts)
Differential Revision: http://reviews.llvm.org/D6340
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234755
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 13 Apr 2015 11:09:48 +0000 (11:09 +0000)]
Fix SupportsSeeking detection on windows.
Will be tested by existing tests once used (soon).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234737
91177308-0d34-0410-b5e6-
96231b3b80d8
John Brawn [Mon, 13 Apr 2015 10:47:39 +0000 (10:47 +0000)]
[ARM] Align global variables passed to memory intrinsics
Fill in the TODO in CodeGenPrepare::OptimizeCallInst so that global
variables that are passed to memory intrinsics are aligned in the same
way that allocas are.
Differential Revision: http://reviews.llvm.org/D8421
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234735
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 13 Apr 2015 10:28:56 +0000 (10:28 +0000)]
Add r234615 back, but make sure outs() is binary.
Original message.
Have one raw_fd_ostream constructor forward to the other.
This fixes some odd behaviour differences between the two. In particular,
the version that takes a FD no longer unconditionally sets stdout to binary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234734
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 13 Apr 2015 04:54:19 +0000 (04:54 +0000)]
Revert r234615, "Have one raw_fd_ostream constructor forward to the other."
It broke MSVCRT hosts:
LLVM :: Object/check_binary_output.ll
LLVM :: Object/extract.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234721
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 13 Apr 2015 04:54:12 +0000 (04:54 +0000)]
[CMake] Uniquify LLVM_ABI_BREAKING_CHECKS. It reverts r233784, "[CMake] Cache in LLVMConfig.cmake."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234720
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 13 Apr 2015 04:54:06 +0000 (04:54 +0000)]
llvm/test/CodeGen/R600/fminnum.ll: Relax an expression for NaN on MSVCRT like r204118.
<stdin>:202:2: note: possible intended match here
2143289344(1.#QNAN0e+00), 2(2.
802597e-45)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234719
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 13 Apr 2015 00:06:28 +0000 (00:06 +0000)]
Revert "Verifier: Check for incompatible bit piece expressions"
This reverts commit r234698.
This caused a use-after-free: `QueuedBitPieceExpressions` holds onto
references to `DbgInfoIntrinsic`s and references them past where they're
deleted (this is because the verifier is run as a function pass, and
then `verifyTypeRefs()` is called during `doFinalization()`).
I'll include a reduced crasher for `llc` when I recommit the check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234717
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Sun, 12 Apr 2015 23:45:05 +0000 (23:45 +0000)]
R600: Make FMIN/MAXNUM legal on all asics
v2: Add tests
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
reviewer: arsenm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234716
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Sun, 12 Apr 2015 23:45:01 +0000 (23:45 +0000)]
R600: remove manual BFE optimization
Fixed since r233079
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
reviewer: arsenm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234715
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Sun, 12 Apr 2015 23:42:25 +0000 (23:42 +0000)]
[MC] Write padding into fragments when -mc-relax-all flag is used
Summary:
When instruction bundling is enabled and the -mc-relax-all flag is
set, we can write bundle padding directly into fragments and avoid
creating large number of fragments significantly reducing LLVM MC
memory usage.
Test Plan: Regression test attached
Reviewers: eliben
Subscribers: jfb, mseaborn
Differential Revision: http://reviews.llvm.org/D8072
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234714
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sun, 12 Apr 2015 22:23:57 +0000 (22:23 +0000)]
[Orc] Remove duplicate "then" in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234710
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sun, 12 Apr 2015 22:21:48 +0000 (22:21 +0000)]
[Orc] Fix out-of-date comment for the IRCompileLayer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234709
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sun, 12 Apr 2015 20:05:51 +0000 (20:05 +0000)]
[Orc] During module partitioning, rename anonymous and asm-private globals.
If they're not (re)named, these globals will fail to resolve when the
partitioned modules are linked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234707
91177308-0d34-0410-b5e6-
96231b3b80d8
Mark Lacey [Sun, 12 Apr 2015 18:18:51 +0000 (18:18 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234706
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 12 Apr 2015 17:18:56 +0000 (17:18 +0000)]
[PowerPC] Really iterate over all loops in PPCLoopDataPrefetch/PPCLoopPreIncPrep
When I fixed these a couple of days ago to iterate over all loops, not just
depth == 1 loops, I inadvertently made it such that we'd only look at the first
top-level loop. Make sure that we really look at all of them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234705
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 12 Apr 2015 01:24:01 +0000 (01:24 +0000)]
[LoopUnrollRuntime] Clean up a predicate.
Clean up a predicate I added in r229731, fix the relevant comment and
add a test case. The earlier version is confusing to read and was also
buggy (probably not a coincidence) till Alexey fixed it in r233881.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234701
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 20:27:40 +0000 (20:27 +0000)]
DebugInfo: Make MDSubprogram::getFunction() return Constant
Change `MDSubprogram::getFunction()` and
`MDGlobalVariable::getConstant()` to return a `Constant`. Previously,
both returned `ConstantAsMetadata`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234699
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 19:58:35 +0000 (19:58 +0000)]
Verifier: Check for incompatible bit piece expressions
Convert an assertion into a `Verifier` check. Bit piece expressions
must fit inside the variable, and mustn't be the entire variable.
Catching this in the verifier will help us find bugs sooner, and makes
`DIVariable::getSizeInBits()` dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234698
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 19:29:09 +0000 (19:29 +0000)]
DebugInfo: Remove dead DIDescriptor::replaceAllUsesWith()
r234696 replaced the only use of `DIDescriptor::replaceAllUsesWith()`
with `DIBuilder::replaceTemporary()` (added in r234695). Delete the
dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234697
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 19:04:09 +0000 (19:04 +0000)]
DebugInfo: Introduce DIBuilder::replaceTemporary()
Add `DIBuilder::replaceTemporary()` as a replacement for
`DIDescriptor::replaceAllUsesWith()`. I'll update clang to use the new
method, and then come back to delete the original.
This method dispatches to `replaceAllUsesWith()` or
`replaceWithUniqued()`, depending on whether the replacement is actually
a different node from the original.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234695
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 11 Apr 2015 18:57:14 +0000 (18:57 +0000)]
Mark empty default constructors as =default if it makes the type POD
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234694
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 18:15:48 +0000 (18:15 +0000)]
DebugInfo: Assume a valid pointer for DISubprogram::getFunction()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234693
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 11 Apr 2015 18:00:28 +0000 (18:00 +0000)]
Make OnDiskChainedHashTableGenerator's Bucket type a POD type and reorder fields to optimize padding
For the common case of offset_type=unsigned this brings Bucket from 24 to 16
bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234692
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 17:37:23 +0000 (17:37 +0000)]
DebugInfo: Move DIScope::getName() and getContext() to MDScope
Continue gutting the `DIDescriptor` hierarchy. In this case, move the
guts of `DIScope::getName()` and `DIScope::getContext()` to
`MDScope::getName()` and `MDScope::getScope()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234691
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 11 Apr 2015 15:32:26 +0000 (15:32 +0000)]
Remove empty non-virtual destructors or mark them =default when non-public
These add no value but can make a class non-trivially copyable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234688
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 11 Apr 2015 13:40:36 +0000 (13:40 +0000)]
[PowerPC] Disable part-word atomics on the P7
As it turns out, even though these are part of ISA 2.06, the P7 does not
support them (or, at least, not any P7s we're tested so far).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234686
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Sat, 11 Apr 2015 10:40:42 +0000 (10:40 +0000)]
Add direct moves to/from VSR and exploit them for FP/INT conversions
This patch corresponds to review:
http://reviews.llvm.org/D8928
It adds direct move instructions to/from VSX registers to GPR's. These are
exploited for FP <-> INT conversions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234682
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Sat, 11 Apr 2015 02:11:45 +0000 (02:11 +0000)]
Use 'override/final' instead of 'virtual' for overridden methods
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-checks='-*,misc-use-override' -header-filter='llvm|clang' \
-j=32 -fix -format
http://reviews.llvm.org/D8925
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 01:00:47 +0000 (01:00 +0000)]
DebugInfo: Rewrite atSameLineAs() as MDLocation::canDiscriminate()
Rewrite `DILocation::atSameLineAs()` as `MDLocation::canDiscriminate()`
with a doxygen comment explaining its purpose. I've added a few FIXMEs
where I think this check is too weak; fixing that is tracked by PR23199.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234674
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sat, 11 Apr 2015 00:56:21 +0000 (00:56 +0000)]
[Orc] Update kaleidoscope tutorial for API change in r234669.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234673
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 00:45:24 +0000 (00:45 +0000)]
DebugInfo: Remove dead DIRef friends
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234672
91177308-0d34-0410-b5e6-
96231b3b80d8