OSDN Git Service
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:46:46 +0000 (21:46 +0000)]
Reapply "DebugInfo: Loosen DILexicalBlock constructor"
This reverts commit r234225, reapplying r234222 in spirit.
This time, just include what the commit message actually describes:
loosen the `DILexicalBlock` constructor to require a
`MDLexicalBlockBase`, since that's what `DILexicalBlock` is wrapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234241
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:30:23 +0000 (21:30 +0000)]
Revert "DebugInfo: Loosen DILexicalBlock constructor"
This reverts commit r234222, while I look into bot failures [1]. I'll
recommit soon.
[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/7117/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234225
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 6 Apr 2015 21:27:31 +0000 (21:27 +0000)]
ArgPromo: Bail out earlier for varargs functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234224
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:16:11 +0000 (21:16 +0000)]
DebugInfo: Loosen DILexicalBlock constructor
This class wraps `MDLexicalBlockBase`, so allow construction from it!
Currently doesn't cause any problems because of the explicit `MNode*`
constructor, but I'll be removing that soon enough.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234222
91177308-0d34-0410-b5e6-
96231b3b80d8
Ismail Pazarbasi [Mon, 6 Apr 2015 21:09:08 +0000 (21:09 +0000)]
Move `checkInterfaceFunction` to ModuleUtils
Summary:
Instead of making a local copy of `checkInterfaceFunction` for each
sanitizer, move the function in a common place.
Reviewers: kcc, samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8775
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234220
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 6 Apr 2015 20:59:48 +0000 (20:59 +0000)]
[opaque pointer type] Avoid using PointerType::getElementType when parsing IR
A few calls are left in for error checking - but I'm commenting those
out & trying to build some IR tests (aiming for Argument Promotion to
start with). When I get any of these tests passing I may add flag to
disable the checking so I can add tests that pass with the assertion in
place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234206
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:49:39 +0000 (19:49 +0000)]
DebugInfo: Remove DIDescriptor::Verify()
Remove `DIDescriptor::Verify()` and the `Verify()`s from subclasses.
They had already been gutted, and just did an `isa<>` check.
In a couple of cases I've temporarily dropped the check entirely, but
subsequent commits are going to disallow conversions to the
`DIDescriptor`s directly from `MDNode`, so the checks will come back in
another form soon enough.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234201
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:48:50 +0000 (19:48 +0000)]
DebugInfo: Add MDTypeRefArray, to replace DITypeArray
This array-like wrapper adapts `MDTuple` to have elements of `MDTypeRef`
(whereas `MDTypeArray` has elements of `MDType`). This is necessary to
migrate code using `DITypeArray`. The only use of this is
`MDSubroutineType`'s `getTypeArray()` accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234200
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:23:22 +0000 (19:23 +0000)]
DebugInfo: Remove dead DIType::operator DITypeRef(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234198
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:03:45 +0000 (19:03 +0000)]
DebugInfo: Use MDTypeRef throughout the hierarchy
Use `MDTypeRef` (etc.) in the new debug info hierarchy rather than raw
`Metadata *` pointers.
I rolled in a change to `DIBuilder` that looks unrelated: take `DIType`
instead of `DITypeRef` as type arguments when creating variables.
However, this was the simplest way to use `MDTypeRef` within the
functions, and didn't require any cleanups from callers in clang (since
they were all passing in `DIType`s anyway, relying on their implicit
conversions to `DITypeRef`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234197
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 6 Apr 2015 18:50:38 +0000 (18:50 +0000)]
[WinEH] Don't sink allocas into child handlers
The uselist isn't enough to infer anything about the lifetime of such
allocas. If we want to re-add this optimization, we will need to
leverage lifetime markers to do it.
Fixes PR23122.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234196
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 6 Apr 2015 18:44:42 +0000 (18:44 +0000)]
ARM: do not relax Thumb1 -> Thumb2 if only Thumb1 is available.
After recognising that a certain narrow instruction might need a relocation to
be represented, we used to unconditionally relax it to a Thumb2 instruction to
permit this. Unfortunately, some CPUs (e.g. v6m) don't even have most Thumb2
instructions, so we end up emitting a completely invalid instruction.
Theoretically, ELF does have relocations for these situations; but they are
fairly unusable with such short ranges and the ABI document even says they're
documented "for completeness". So an error is probably better there too.
rdar://
20391953
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234195
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 6 Apr 2015 18:39:00 +0000 (18:39 +0000)]
[X86][SSE] Use (V)PINSRB for direct byte insertion in 16i8 buildvector on SSE4.1 targets
This patch allows SSE4.1 targets to use (V)PINSRB to create 16i8 vectors by inserting i8 scalars directly into a XMM register instead of merging pairs of i8 scalars into a i16 and using the SSE2 PINSRW instruction.
This allows folding of byte loads and reduces scalar register usage as well.
Differential Revision: http://reviews.llvm.org/D8839
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234193
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Mon, 6 Apr 2015 18:18:23 +0000 (18:18 +0000)]
Fix failure on builder llvm-clang-lld-x86_64-debian-fast as the
test macho-objc-meta-data.test had a line it shouldn't have had.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234190
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 6 Apr 2015 18:06:06 +0000 (18:06 +0000)]
Add some type safety to GlobalObject/GlobalValue - they're always PointerTypes so let's type them that way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234189
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 18:02:43 +0000 (18:02 +0000)]
DebugInfo: Create MDTypeRef, etc., to replace DITypeRef
Create a string-based wrapper in the debug info hierarchy for type
references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234188
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:52:46 +0000 (17:52 +0000)]
DebugInfo: Remove dead DIRef::getName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234186
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Mon, 6 Apr 2015 17:47:03 +0000 (17:47 +0000)]
For llvm-objdump added support for printing Objc2 32-bit runtime meta data
with the existing -objc-meta-data and -macho options for Mach-O files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234185
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:45:07 +0000 (17:45 +0000)]
Metadata: Add typed array-like wrapper for MDTuple
Add `MDTupleTypedArrayWrapper`, a wrapper around `MDTuple` that adapts
it to look like an array and cast its operands to the given type. This
is designed to be a replacement for `DITypedArray<>`, which is in the
`DIDescriptor` hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234183
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:21:05 +0000 (17:21 +0000)]
DebugInfo: Remove dead code for accessing fields
Most fields are now accessed via the new debug info hierarchy. I'll
make the rest of this code dead soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234182
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:17:47 +0000 (17:17 +0000)]
AutoUpgrade: Remove obsolete dbg.declare/value upgrade
This upgrade of `@llvm.dbg.declare` and `@llvm.dbg.value` isn't useful,
since it's for an old debug info version. The calls will get stripped
anyway by `UpgradeDebugInfo()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234181
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Mon, 6 Apr 2015 17:15:48 +0000 (17:15 +0000)]
[SLSR] consider &B[S << i] as &B[(1 << i) * S]
Summary: This reduces handling &B[(1 << i) * s] to handling &B[i * S].
Test Plan: slsr-gep.ll
Reviewers: meheff
Subscribers: sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D8837
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234180
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 6 Apr 2015 17:15:41 +0000 (17:15 +0000)]
[DAGCombiner] Add support for FCEIL, FFLOOR and FTRUNC vector constant folding
Differential Revision: http://reviews.llvm.org/D8715
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234179
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:04:58 +0000 (17:04 +0000)]
Verifier: Check composite type template params
Add missing checks for `templateParams:` in `MDCompositeType`. Pull the
current check for `MDSubprogram` to reduce duplicated code and fix it up
to print a good message when the immediate operand isn't an `MDTuple`
(as a drive-by, make the same fix to `variables:` in `MDSubprogram`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234177
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 16:43:40 +0000 (16:43 +0000)]
DebugInfo: Use MDFile instead of accessing operands directly, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234175
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 16:34:41 +0000 (16:34 +0000)]
Use a comma after the unique keyword.
H.J. Lu noted that all .section options are separated by a comma.
This patch changes the syntax of unique to require one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234174
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 6 Apr 2015 16:21:12 +0000 (16:21 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234171
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 16:10:05 +0000 (16:10 +0000)]
Remove unnecessary uses of AliasedSymbol.
As pr19627 points out, every use of AliasedSymbol is likely a bug.
The main use was to avoid the oddity of a variable showing up as undefined. That
was fixed in r233995, which made these calls nops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234169
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Mon, 6 Apr 2015 16:09:13 +0000 (16:09 +0000)]
Removing a spurious space; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234168
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 15:27:57 +0000 (15:27 +0000)]
Be consistent when deciding if a relocation is needed.
Before when deciding if we needed a relocation in A-B, we wore only checking
if A was weak.
This fixes the asymmetry.
The "InSet" argument should probably be renamed to "ForValue", since InSet is
very MachO specific, but doing so in this patch would make it hard to read.
This fixes PR22815.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234165
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 15:04:31 +0000 (15:04 +0000)]
Disable all link optimizations in a debug build.
This taking linking clang on my machine with gold from 16.
980257914 to
15.
933037649 seconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234161
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 14:51:01 +0000 (14:51 +0000)]
Don't pass -O3 to the linker in debug builds.
This takes linking clang in a debug build with gold form 19.
518925697 to
16.
406388685 seconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234160
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 14:34:43 +0000 (14:34 +0000)]
Don't use -ffunction-sections -fdata-sections on debug builds.
Unfortunately, on ELF there is not used attribute on the .o files,
so there is no easy way to keep the dump function alive.
If we are not gcing, we may as well produce non gcable files and
avoid the cost.
Linking a debug clang now takes 18.
856225992 seconds, before it
took 21.
206897447.
I will try avoiding --gc-sections -O3 on a followup patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234159
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Mon, 6 Apr 2015 13:31:39 +0000 (13:31 +0000)]
Test commit. Improve comments in APInt. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234158
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 04:25:18 +0000 (04:25 +0000)]
Store the sh_link of ARM_EXIDX directly in MCSectionELF.
This avoids some pretty horrible and broken name based section handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234142
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 03:16:51 +0000 (03:16 +0000)]
Simplify this function a bit. NFC.
The case values are not a tidy enum we can fully cover. They even ovelap
over the various extension.
Just use a default:
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234140
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 03:09:30 +0000 (03:09 +0000)]
Simplify mapping from relocation sections to relocated sections.
Just store the section in MCSectionELF. This avoids multiple hash lookups.
This will also be used by ARM_EXIDX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234139
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 6 Apr 2015 03:01:29 +0000 (03:01 +0000)]
[Orc] Tidy up the assembly for the x86-64 resolver block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234138
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 5 Apr 2015 22:53:21 +0000 (22:53 +0000)]
[opaque pointer type] Remove some backwards compatible GEP APIs
Just doing the two-step so I don't get so much build-bot spam... (add
new API, migrate callers, remove old API)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234132
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 5 Apr 2015 22:44:57 +0000 (22:44 +0000)]
clang-format my last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234127
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 5 Apr 2015 22:41:44 +0000 (22:41 +0000)]
[opaque pointer type] The last of the GEP IRBuilder API migrations
There's still lots of callers passing nullptr, of course - some because
they'll never be migrated (InstCombines for bitcasts - well they don't
make any sense when the pointer type is opaque anyway, for example) and
others that will need more engineering to pass Types around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234126
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 5 Apr 2015 17:02:25 +0000 (17:02 +0000)]
Mark BumpPtrAllocator::Allocate as returning a noalias pointer.
The GCC attribute is curiously named 'malloc', but I think it's better
to use LLVM terminology for the wrapper macro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234121
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 5 Apr 2015 14:30:37 +0000 (14:30 +0000)]
[DAGCombiner] Merge FMUL Scalar and Vector constant canonicalization to RHS. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234118
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 4 Apr 2015 21:07:10 +0000 (21:07 +0000)]
[opaque pointer type] More GEP API migrations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234108
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 4 Apr 2015 21:06:39 +0000 (21:06 +0000)]
remove function/variable names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234107
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 4 Apr 2015 21:05:52 +0000 (21:05 +0000)]
less space; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234106
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 4 Apr 2015 18:16:01 +0000 (18:16 +0000)]
Don't mix overload and default values.
It makes it hard to see which one is being called.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234100
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 4 Apr 2015 18:02:01 +0000 (18:02 +0000)]
Implement unique sections with an unique ID.
This allows the compiler/assembly programmer to switch back to a
section. This in turn fixes the bootstrap failure on powerpc (tested
on gcc110) without changing the ppc codegen at all.
I will try to cleanup the various getELFSection overloads in a followup patch.
Just using a default argument now would lead to ambiguities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234099
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 4 Apr 2015 15:12:13 +0000 (15:12 +0000)]
[opaque pointer type] More (constant, in this instance) GEP API migrations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234096
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 4 Apr 2015 10:20:31 +0000 (10:20 +0000)]
[DAGCombiner] Canonicalize vector constants for ADD/MUL/AND/OR/XOR re-association
Scalar integers are commuted to move constants to the RHS for re-association - this ensures vectors do the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234092
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 4 Apr 2015 04:22:12 +0000 (04:22 +0000)]
[X86] Apply AddedComplexity consistently for similar patterns. This keeps them together in the DAGISel tables and reduces table size slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234086
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 4 Apr 2015 03:53:25 +0000 (03:53 +0000)]
Fix formatting and coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234084
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 4 Apr 2015 02:31:43 +0000 (02:31 +0000)]
[X86] Add a comment about the change in r234075.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234079
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 4 Apr 2015 02:26:47 +0000 (02:26 +0000)]
Strip trailing whitespace and reword explanatory comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234078
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 4 Apr 2015 02:08:20 +0000 (02:08 +0000)]
[X86] Don't use GR64 register 'and with immediate' instructions if the immediate is zero in the upper 33-bits or upper 57-bits. Use GR32 instructions instead.
Previously the patterns didn't have high enough priority and we would only use the GR32 form if the only the upper 32 or 56 bits were zero.
Fixes PR23100.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234075
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 23:37:34 +0000 (23:37 +0000)]
[WinEH] Fill out CatchHigh in the TryBlockMap
Now all fields in the WinEH xdata have been filled out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234067
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 23:03:54 +0000 (23:03 +0000)]
[opaque pointer type] More GEP IRBuilder API migrations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234064
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 22:49:05 +0000 (22:49 +0000)]
[WinEH] Fill out .xdata for catch objects
This add support for catching an exception such that an exception object
available to the catch handler will be initialized by the runtime.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234062
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 22:32:26 +0000 (22:32 +0000)]
[WinEH] Sink UnwindHelp completely out of IR
We don't need to represent UnwindHelp in IR. Instead, we can use the
knowledge that we are emitting the parent function to decide if we
should create the UnwindHelp stack object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234061
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 3 Apr 2015 21:44:17 +0000 (21:44 +0000)]
Fixing a memory leak in WinEHPrepare
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234059
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 21:33:42 +0000 (21:33 +0000)]
[opaque pointer type] More GEP IRBuilder API migrations...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234058
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 21:32:06 +0000 (21:32 +0000)]
Use early returns to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234057
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 20:56:24 +0000 (20:56 +0000)]
Fix a typo
CHECK-LABEL had the wrong function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234051
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 20:18:40 +0000 (20:18 +0000)]
[InstCombine] Use DataLayout to determine vector element width
InstCombine didn't realize that it needs to use DataLayout to determine
how wide pointers are. This lead to assertion failures.
This fixes PR23113.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234046
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 3 Apr 2015 19:55:30 +0000 (19:55 +0000)]
Fixing a build error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234045
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 3 Apr 2015 19:45:32 +0000 (19:45 +0000)]
Fixing build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234043
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 19:41:44 +0000 (19:41 +0000)]
[opaque pointer type] More GEP API migrations in IRBuilder uses
The plan here is to push the API changes out from the common components
(like Constant::getGetElementPtr and IRBuilder::CreateGEP related
functions) and just update callers to either pass the type if it's
obvious, or pass null.
Do this with LoadInst as well and anything else that comes up, then to
start porting specific uses to not pass null anymore - this may require
some refactoring in each case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234042
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 3 Apr 2015 19:37:50 +0000 (19:37 +0000)]
[WinEH] Handle nested landing pads in outlined catch handlers
Differential Revision: http://reviews.llvm.org/D8596
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234041
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 19:20:26 +0000 (19:20 +0000)]
CodeGen: Assert that inlined-at locations agree
As a follow-up to r234021, assert that a debug info intrinsic variable's
`MDLocalVariable::getInlinedAt()` always matches the
`MDLocation::getInlinedAt()` of its `!dbg` attachment.
The goal here is to get rid of `MDLocalVariable::getInlinedAt()`
entirely (PR22778), but I'll let these assertions bake for a while
first.
If you have an out-of-tree backend that just broke, you're probably
attaching the wrong `DebugLoc` to a `DBG_VALUE` instruction. The one
you want is the location that was attached to the corresponding
`@llvm.dbg.declare` or `@llvm.dbg.value` call that you started with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234038
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 3 Apr 2015 18:18:06 +0000 (18:18 +0000)]
[WinEH] Fold cast into assertion based on review feedback
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234034
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 3 Apr 2015 17:22:36 +0000 (17:22 +0000)]
[GraphWriter] Attempt to open .dot files with xdg-open/open first
Most desktop environments let the users specify his preferred application per
file type. On mac/linux we can use open/xdg-open for that and should try this
first before starting a heuristic search for various programs.
Differential Revision: http://reviews.llvm.org/D6534
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234031
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 3 Apr 2015 17:17:50 +0000 (17:17 +0000)]
use update_llc_test_checks.py to tighten checking; remove unnecessary testing params
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234029
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 3 Apr 2015 17:13:31 +0000 (17:13 +0000)]
use update_llc_test_checks.py to tighten checking; remove unnecessary testing params
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234027
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 17:11:42 +0000 (17:11 +0000)]
SelectionDAG: Use specialized metadata nodes in EmitFuncArgumentDbgValue(), NFC
Use `MDLocalVariable` and `MDExpression` directly for the arguments of
`EmitFuncArgumentDbgValue()` to simplify a follow-up patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234026
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 3 Apr 2015 17:09:37 +0000 (17:09 +0000)]
use update_llc_test_checks.py to tighten checking; remove unnecessary testing params
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234024
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 3 Apr 2015 17:02:48 +0000 (17:02 +0000)]
use update_llc_test_checks.py to tighten checking
remove redundant and unnecessary test parameters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234022
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 16:54:30 +0000 (16:54 +0000)]
Verifier: Check that inlined-at locations agree
Check that the `MDLocalVariable::getInlinedAt()` in a debug info
intrinsic's variable always matches the `MDLocation::getInlinedAt()` of
its `!dbg` attachment.
The goal here is to get rid of `MDLocalVariable::getInlinedAt()`
entirely (PR22778), since it's expensive and unnecessary, but I'll let
this verifier check bake for a while (a week maybe?) first. I've
updated the testcases that had the wrong value for `inlinedAt:`.
This checks that things are sane in the IR, but currently things go out
of whack in a few places in the backend. I'll follow shortly with
assertions in the backend (with code fixes).
If you have out-of-tree testcases that just started failing, here's how
I updated these ones:
1. The verifier check gives you the basic block, function, instruction,
and relevant metadata arguments (metadata numbering doesn't
necessarily match the source file, unfortunately).
2. Look at the `@llvm.dbg.*()` instruction, and compare the
`inlinedAt:` fields of the variable argument (second `metadata`
argument) and the `!dbg` attachment.
3. Figure out based on the variable `scope:` chain and the functions in
the file whether the variable has been inlined (and into what), so
you can determine which `inlinedAt:` is actually correct. In all of
the in-tree testcases, the `!MDLocation()` was correct and the
`!MDLocalVariable()` was wrong, but YMMV.
4. Duplicate the metadata that you're going to change, and add/drop the
`inlinedAt:` field from one of them. Be careful that the other
references to the same metadata node point at the correct one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234021
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 3 Apr 2015 16:44:42 +0000 (16:44 +0000)]
add checks; remove redundant testing parameters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234020
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 16:23:04 +0000 (16:23 +0000)]
CodeGen: Fix MachineInstr::print() for DBG_VALUE
Grab the `MDLocalVariable` from the second-to-last argument; the last
argument is an `MDExpression`, and mixing them up will crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234019
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Fri, 3 Apr 2015 16:19:48 +0000 (16:19 +0000)]
[MachineLICM] Small cleanup: Constify and rangeify.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234018
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 3 Apr 2015 16:06:58 +0000 (16:06 +0000)]
use update_llc_test_checks.py to tighten checking; remove darwin and sandybridge overspecification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234017
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 3 Apr 2015 15:04:46 +0000 (15:04 +0000)]
Added vector tests for DAGCombiner::ReassociateOps
Missing vector tests for rL233482
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234015
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 3 Apr 2015 14:24:40 +0000 (14:24 +0000)]
[X86] Added SSE4.2 CRC32 memory folding patterns + tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234013
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 3 Apr 2015 13:48:24 +0000 (13:48 +0000)]
[PowerPC] Enable splat generation for BUILD_VECTOR with little endian
When enabling PPC64LE, I disabled some optimizations of BUILD_VECTOR
nodes for little endian because wrong results were produced. I've
subsequently investigated and found this is due to a call to
BuildVectorSDNode::isConstantSplat that was always specifying
big-endian. With this changed to correctly identify the target
endianness, the optimizations work as expected.
I found another case of a call to the same method with big-endian
hardcoded, in PPC::isAllNegativeZeroVector(). I discovered this was
an orphaned method with no callers, so I've just removed it.
The existing test/CodeGen/PowerPC/vec_constants.ll checks these
optimizations, so for testing I've just added a variant for little
endian.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234011
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 3 Apr 2015 11:50:30 +0000 (11:50 +0000)]
[X86][3DNow] Added 3DNow! memory folding patterns + tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234008
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 3 Apr 2015 11:01:15 +0000 (11:01 +0000)]
[X86][MMX] Added MMX stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234006
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 3 Apr 2015 10:02:21 +0000 (10:02 +0000)]
[DAGCombiner] Combine shuffles of BUILD_VECTOR and SCALAR_TO_VECTOR
This patch attempts to fold the shuffling of 'scalar source' inputs - BUILD_VECTOR and SCALAR_TO_VECTOR nodes - if the shuffle node is the only user. This folds away a lot of unnecessary shuffle nodes, and allows quite a bit of constant folding that was being missed.
Differential Revision: http://reviews.llvm.org/D8516
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234004
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 3 Apr 2015 01:46:11 +0000 (01:46 +0000)]
MC: For variable symbols, maintain MCSymbol::Section as a cache.
Fixes PR19582.
Previously, when an asm assignment (.set or =) was created, we would look up
the section immediately in MCSymbol::setVariableValue. This caused symbols
to receive the wrong section if the RHS of the assignment had not been seen
yet. This had a knock-on effect in the object file emitters, causing them
to emit extra symbols, or to give symbols the wrong visibility or the wrong
section. For example, in the following asm:
.data
.Llocal:
.text
leaq .Llocal1(%rip), %rdi
.Llocal1 = .Llocal2
.Llocal2 = .Llocal
the first assignment would give .Llocal1 a null section, which would never get
fixed up by the second assignment. This would cause the ELF object file emitter
to consider .Llocal1 to be an undefined symbol and give it external linkage,
even though .Llocal1 should not have been emitted at all in the object file.
Or in the following asm:
alias_to_local = Ltmp0
Ltmp0:
the Mach-O object file emitter would give the alias_to_local symbol a n_type
of N_SECT and a n_sect of 0. This is invalid under the Mach-O specification,
which requires N_SECT symbols to receive a non-zero section number if the
symbol is defined in a section in the object file.
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/MachORuntime/#//apple_ref/c/tag/nlist
After this change we do not look up the section when the assignment is created,
but instead look it up on demand and store it in Section, which is treated
as a cache if the symbol is a variable symbol.
This change also fixes a bug in MCExpr::FindAssociatedSection. Previously,
if we saw a subtraction, we would return the first referenced section, even in
cases where we should have been returning the absolute pseudo-section. Now we
always return the absolute pseudo-section for expressions that subtract two
section-derived expressions. This isn't always correct (e.g. if one of the
sections ends up being laid out at an absolute address), but it's probably
the best we can do without more context.
This allows us to remove code in two places where we appear to have been
working around this bug, in MachObjectWriter::markAbsoluteVariableSymbols
and in X86AsmPrinter::EmitStartOfAsmFile.
Re-applies r233595 (aka D8586), which was reverted in r233898.
Differential Revision: http://reviews.llvm.org/D8798
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233995
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 3 Apr 2015 01:20:33 +0000 (01:20 +0000)]
Return iterator from BasicBlock::eraseFromParent
Summary:
Same as the last patch, but for BasicBlock
(Requires same code movement)
Reviewers: chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8801
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233992
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 01:15:16 +0000 (01:15 +0000)]
[opaque pointer types] Push explicit type parameter for geps through the constant folders
Next: more IRBuilder changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233991
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 3 Apr 2015 00:18:38 +0000 (00:18 +0000)]
ARM: Handle physreg targets in RegPair hints gracefully
Register coalescing can change the target of a RegPair hint to a
physreg, we should not crash on this. This also slightly improved the
way ARMBaseRegisterInfo::updateRegAllocHint() works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233987
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 3 Apr 2015 00:18:33 +0000 (00:18 +0000)]
MachineRegisterInfo: Make it clear that hints are for vregs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233986
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 2 Apr 2015 22:44:00 +0000 (22:44 +0000)]
llvm/examples/BrainF: Give an explicit pointee type to ConstantExpr::getGetElementPtr(ty...), according to r233938.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233983
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 2 Apr 2015 21:44:55 +0000 (21:44 +0000)]
[ASan] Don't use stack malloc for 32-bit functions using inline asm
This prevents us from running out of registers in the backend.
Introducing stack malloc calls prevents the backend from recognizing the
inline asm operands as stack objects. When the backend recognizes a
stack object, it doesn't need to materialize the address of the memory
in a physical register. Instead it generates a simple SP-based memory
operand. Introducing a stack malloc forces the backend to find a free
register for every memory operand. 32-bit x86 simply doesn't have enough
registers for this to succeed in most cases.
Reviewers: kcc, samsonov
Differential Revision: http://reviews.llvm.org/D8790
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233979
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 2 Apr 2015 21:43:22 +0000 (21:43 +0000)]
Fix unused variable in NDEBUG builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233978
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Thu, 2 Apr 2015 21:18:32 +0000 (21:18 +0000)]
[SLSR] handles off bounds GEPs
Summary:
The old requirement on GEP candidates being in bounds is unnecessary.
For off-bound GEPs, we still have
&B[i * S] = B + (i * S) * e = B + (i * e) * S
Test Plan: slsr_offbound_gep in slsr-gep.ll
Reviewers: meheff
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8809
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233949
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 2 Apr 2015 21:13:31 +0000 (21:13 +0000)]
[WinEH] Make llvm.eh.actions use frameescape indices for catch params
This makes it possible to use the same representation of llvm.eh.actions
in outlined handlers as we use in the parent function because i32's are
just constants that can be copied freely between functions.
I had to add a sentinel alloca to the list of child allocas so that we
don't try to sink the catch object into the handler. Normally, one would
use nullptr for this kind of thing, but TinyPtrVector doesn't support
null elements. More than that, it's elements have to have a suitable
alignment. Therefore, I settled on this for my sentinel:
AllocaInst *getCatchObjectSentinel() {
return static_cast<AllocaInst *>(nullptr) + 1;
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233947
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 2 Apr 2015 20:21:52 +0000 (20:21 +0000)]
[AVX] Improve insertion of i8 or i16 into low element of 256-bit zero vector
Without this patch, we split the 256-bit vector into halves and produced something like:
movzwl (%rdi), %eax
vmovd %eax, %xmm0
vxorps %xmm1, %xmm1, %xmm1
vblendps $15, %ymm0, %ymm1, %ymm0 ## ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
Now, we eliminate the xor and blend because those zeros are free with the vmovd:
movzwl (%rdi), %eax
vmovd %eax, %xmm0
This should be the final fix needed to resolve PR22685:
https://llvm.org/bugs/show_bug.cgi?id=22685
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233941
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 2 Apr 2015 18:55:32 +0000 (18:55 +0000)]
[opaque pointer type] API migration for GEP constant factories
Require the pointee type to be passed explicitly and assert that it is
correct. For now it's possible to pass nullptr here (and I've done so in
a few places in this patch) but eventually that will be disallowed once
all clients have been updated or removed. It'll be a long road to get
all the way there... but if you have the cahnce to update your callers
to pass the type explicitly without depending on a pointer's element
type, that would be a good thing to do soon and a necessary thing to do
eventually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233938
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 2 Apr 2015 18:54:23 +0000 (18:54 +0000)]
[AArch64] Add a comment to make it explicit why we increased the complexity.
Follow-up of r233653.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233936
91177308-0d34-0410-b5e6-
96231b3b80d8