1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

75866 Commits

Author SHA1 Message Date
Ramkumar Ramachandra
78c0138d51 [GC] Verify-pass void vararg functions in gc.statepoint
With the appropriate Verifier changes, exactracting the result out of a
statepoint wrapping a vararg function crashes. However, a void vararg
function works fine: commit this first step.

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

llvm-svn: 226599
2015-01-20 19:42:46 +00:00
Adrian Prantl
5def96f7e9 Reapply: Teach SROA how to update debug info for fragmented variables.
This reapplies r225379.

ChangeLog:
- The assertion that this commit previously ran into about the inability
  to handle indirect variables has since been removed and the backend
  can handle this now.
- Testcases were upgrade to the new MDLocation format.
- Instead of keeping a DebugDeclares map, we now use
  llvm::FindAllocaDbgDeclare().

Original commit message follows.

Debug info: Teach SROA how to update debug info for fragmented variables.
This allows us to generate debug info for extremely advanced code such as

 typedef struct { long int a; int b;} S;

 int foo(S s) {
   return s.b;
 }

which at -O1 on x86_64 is codegen'd into

 define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 {
   ret i32 %s.coerce1, !dbg !24
 }

with this patch we emit the following debug info for this

 TAG_formal_parameter [3]
   AT_location( 0x00000000
                0x0000000000000000 - 0x0000000000000006: rdi, piece 0x00000008, rsi, piece 0x00000004
                0x0000000000000006 - 0x0000000000000008: rdi, piece 0x00000008, rax, piece 0x00000004 )
                AT_name( "s" )
                AT_decl_file( "/Volumes/Data/llvm/_build.ninja.release/test.c" )

Thanks to chandlerc, dblaikie, and echristo for their feedback on all
previous iterations of this patch!

llvm-svn: 226598
2015-01-20 19:42:22 +00:00
Tom Stellard
86b334a59c R600/SI: Add subtarget feature to enable VGPR spilling for all shader types
This is disabled by default, but can be enabled with the subtarget
feature: 'vgpr-spilling'

llvm-svn: 226597
2015-01-20 19:33:04 +00:00
Tom Stellard
c7e82f2d5a R600/SI: Fix simple-loop.ll test
llvm-svn: 226596
2015-01-20 19:33:02 +00:00
Jozef Kolek
dc9fe311f2 Reverted revision 226577.
llvm-svn: 226595
2015-01-20 19:29:28 +00:00
Chandler Carruth
6ac2421fa0 [PM] Clean up a bunch of the doxygen / API docs on the InstCombiner pass
prior to refactoring it.

llvm-svn: 226594
2015-01-20 19:27:58 +00:00
Manman Ren
4ae48fda6a [llvm link] Destroy ConstantArrays in LLVMContext if they are not used.
ConstantArrays constructed during linking can cause quadratic memory
explosion. An example is the ConstantArrays constructed when linking in
GlobalVariables with appending linkage.

Releasing all unused constants can cause a 20% LTO compile-time
slowdown for a large application. So this commit releases unused ConstantArrays
only.

rdar://19040716. It reduces memory footprint from 20+G to 6+G.

llvm-svn: 226592
2015-01-20 19:24:59 +00:00
Tom Stellard
36ee1e3d36 R600/SI: Remove stray debugging code from r226586
llvm-svn: 226591
2015-01-20 19:24:31 +00:00
Adrian Prantl
7c72052af0 Add an assertion and prefer a crash over an infinite loop.
llvm-svn: 226588
2015-01-20 18:03:37 +00:00
Tom Stellard
e2491450e5 R600/SI: Use external symbols for scratch buffer
We were passing the scratch buffer address to the shaders via user sgprs,
but now we use external symbols and have the driver patch the shader
using reloc information.

llvm-svn: 226586
2015-01-20 17:49:47 +00:00
Tom Stellard
59a54d03fe R600/SI: Add kill flag when copying scratch offset to a register
This allows us to re-use the same register for the scratch offset
when accessing large private arrays.

llvm-svn: 226585
2015-01-20 17:49:45 +00:00
Tom Stellard
01ff7eb626 R600/SI: Don't store scratch buffer frame index in MUBUF offset field
We don't have a good way of legalizing this if the frame index offset
is more than the 12-bits, which is size of MUBUF's offset field, so
now we store the frame index in the vaddr field.

llvm-svn: 226584
2015-01-20 17:49:43 +00:00
Tom Stellard
4066d32e2e R600/SI: Update SIInstrInfo:verifyInstruction() after r225662
Now that we have our own custom register operand types, we need
to handle them in the verifiier.

llvm-svn: 226583
2015-01-20 17:49:41 +00:00
Aaron Ballman
f3aca764b9 Silencing a -Wunused-variable warning in non-asserts builds; NFC.
llvm-svn: 226581
2015-01-20 17:10:45 +00:00
Jozef Kolek
ca8263125b [mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B
Implement microMIPS 16-bit unconditional branch instruction B.

Implemented 16-bit microMIPS unconditional instruction has real name B16, and
B is an alias which expands to either B16 or BEQ according to the rules:
b 256 --> b16 256 # R_MICROMIPS_PC10_S1
b 12256 --> beq $zero, $zero, 12256 # R_MICROMIPS_PC16_S1
b label --> beq $zero, $zero, label # R_MICROMIPS_PC16_S1

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

llvm-svn: 226577
2015-01-20 16:45:27 +00:00
Kai Nacke
84b6d0bc71 [mips] Add octeon branch instructions bbit0/bbit032/bbit1/bbit132
This commits adds the octeon branch instructions bbit0/bbit032/bbit1/bbit132.
It also includes patterns for instruction selection and test cases.

Reviewed by D. Sanders

llvm-svn: 226573
2015-01-20 16:10:51 +00:00
Evgeniy Stepanov
7e7783512b [msan] Optimize -msan-check-constant-shadow.
The new code does not create new basic blocks in the case when shadow is a
compile-time constant; it generates either an unconditional __msan_warning
call or nothing instead.

llvm-svn: 226569
2015-01-20 15:21:35 +00:00
Mohit K. Bhakkad
9e18575ce8 [MSan][LLVM][MIPS] Shadow and Origin offsets for MIPS
Reviewers: kcc, samsonov, petarj, eugenis

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

llvm-svn: 226565
2015-01-20 13:05:42 +00:00
Craig Topper
4312f7bdd7 [x86] Add some mayLoad/hasSideEffects flags. Remove one that was already covered by a pattern.
llvm-svn: 226562
2015-01-20 12:15:30 +00:00
Chandler Carruth
7cd55815b7 [PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis
pass and a LoopPrinterPass with the expected associated wiring.

I've added a RUN line to the only test case (!!!) we have that actually
prints loops. Everything seems to be working.

This is somewhat exciting as this is the first analysis using another
analysis to go in for the new pass manager. =D I also believe it is the
last analysis necessary for porting instcombine, but of course I may yet
discover more.

llvm-svn: 226560
2015-01-20 10:58:50 +00:00
Daniel Jasper
77c4186290 Factor out a splitSwitchCase() function so that it can be reused.
This is in preparation for a fix to llvm.org/PR22262. One of the ideas
here is to first find a good jump table range first and then split
before and after it. Thereby, we don't need to use the
split-based-on-density heuristic at all, which can make the "binary
tree" deteriorate in various cases.

Also some minor cleanups.

No functional changes.

llvm-svn: 226551
2015-01-20 08:57:44 +00:00
Chandler Carruth
8951826a61 [PM] Move the LoopInfo analysis pointer into the InstCombiner class
along with the other analyses.

The most obvious reason why is because eventually I need to separate out
the pass layer from the rest of the instcombiner. However, it is also
probably a compile time win as every query through the pass manager
layer is pretty slow these days.

llvm-svn: 226550
2015-01-20 08:35:24 +00:00
Karthik Bhat
8fee134b62 Fix Operandreorder logic in SLPVectorizer to generate longer vectorizable chain.
This patch fixes 2 issues in reorderInputsAccordingToOpcode
1) AllSameOpcodeLeft and AllSameOpcodeRight was being calculated incorrectly resulting in code not being vectorized in few cases.
2) Adds logic to reorder operands if we get longer chain of consecutive loads enabling vectorization. Handled the same for cases were we have AltOpcode.
Thanks Michael for inputs and review.
Review: http://reviews.llvm.org/D6677

llvm-svn: 226547
2015-01-20 06:11:00 +00:00
David Majnemer
4556f4a8ee Bitcode: Don't create comdats when autoupgrading macho bitcode
Don't infer COMDAT groups from older bitcode if the target is macho,
it doesn't have COMDATs.

llvm-svn: 226546
2015-01-20 05:58:07 +00:00
Duncan P. N. Exon Smith
4c09531400 Reapply "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
This reverts commit r226542, effectively reapplying r226540.  This time,
initialize `IsEmpty` in the copy and move constructors as well.

llvm-svn: 226545
2015-01-20 05:02:42 +00:00
Duncan P. N. Exon Smith
fb89cdb012 Revert "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
This reverts commit r226540, since I hit an unexpected bot failure [1].
I'll investigate.

[1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20244

llvm-svn: 226542
2015-01-20 03:01:27 +00:00
Duncan P. N. Exon Smith
fbee6e59a5 IR: Move MDNode clone() methods from ValueMapper to MDNode, NFC
Now that the clone methods used by `MapMetadata()` don't do any
remapping (and return a temporary), they make more sense as member
functions on `MDNode` (and subclasses).

llvm-svn: 226541
2015-01-20 02:56:57 +00:00
Duncan P. N. Exon Smith
c8ffb8d88e IR: Simplify DIBuilder's HeaderBuilder API, NFC
Change `HeaderBuilder` API to work well even when it's not starting with
a tag.  There's already one case like this, and the tag is moving
elsewhere as part of PR22235.

llvm-svn: 226540
2015-01-20 02:54:07 +00:00
Duncan P. N. Exon Smith
cafdfa8860 AsmParser: PARSE_MD_FIELD() => ParseMDField(), NFC
Extract most of `PARSE_MD_FIELD()` into a function.

llvm-svn: 226539
2015-01-20 02:42:29 +00:00
Duncan P. N. Exon Smith
e32017adeb AsmParser: Refactor duplicate code, NFC
llvm-svn: 226538
2015-01-20 02:39:21 +00:00
Chandler Carruth
b85f7cdd42 [PM] Replace the Pass argument in MergeBasicBlockIntoOnlyPred with
a DominatorTree argument as that is the analysis that it wants to
update.

This removes the last non-loop utility function in Utils/ which accepts
a raw Pass argument.

llvm-svn: 226537
2015-01-20 01:37:09 +00:00
Duncan P. N. Exon Smith
3d7a58e11e IR: Delete GenericDwarfNode during teardown
Fix a leak in `LLVMContextImpl` teardown that the leak sanitizer tracked
down [1].  I've just switched to automatic dispatch here (since I'll
inevitably forget again with the next class).

[1]: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/811/steps/check-llvm%20asan/logs/stdio

llvm-svn: 226536
2015-01-20 01:18:32 +00:00
Duncan P. N. Exon Smith
2fef9f81c3 Bitcode: Simplify MDNode subclass dispatch, NFC
llvm-svn: 226535
2015-01-20 01:03:09 +00:00
Duncan P. N. Exon Smith
389d29e9f1 Bitcode: WriteMDNode() => WriteMDTuple(), NFC
llvm-svn: 226534
2015-01-20 01:01:53 +00:00
Duncan P. N. Exon Smith
fc8503a473 Bitcode: Add ValueEnumerator::getMetadataOrNullID(), NFC
llvm-svn: 226533
2015-01-20 01:00:23 +00:00
Duncan P. N. Exon Smith
399f517a79 IR: Canonicalize GenericDwarfNode empty headers to null
llvm-svn: 226532
2015-01-20 00:58:46 +00:00
Duncan P. N. Exon Smith
83a0fe645b IR: Detect whether to call recalculateHash() via SFINAE, NFC
Rather than relying on updating switch statements correctly, detect
whether `setHash()` exists in the subclass.  If so, call
`recalculateHash()` and `setHash(0)` appropriately.

llvm-svn: 226531
2015-01-20 00:57:33 +00:00
Duncan P. N. Exon Smith
0973b855f5 IR: Introduce GenericDwarfNode
As part of PR22235, introduce `DwarfNode` and `GenericDwarfNode`.  The
former is a metadata node with a DWARF tag.  The latter matches our
current (generic) schema of a header with string (and stringified
integer) data and an arbitrary number of operands.

This doesn't move it into place yet; that change will require a large
number of testcase updates.

llvm-svn: 226529
2015-01-20 00:01:43 +00:00
Duncan P. N. Exon Smith
c1c7b46705 AsmParser: Abstract more of MDLocation parser, NFC
llvm-svn: 226527
2015-01-19 23:44:41 +00:00
Duncan P. N. Exon Smith
de6755bd0e AsmParser: Split up ParseMDFieldsImpl(), NFC
llvm-svn: 226526
2015-01-19 23:39:32 +00:00
Duncan P. N. Exon Smith
56c8d44827 AsmParser: Fix error location for missing fields
llvm-svn: 226524
2015-01-19 23:32:36 +00:00
Duncan P. N. Exon Smith
f5f6560728 IR: Cleanup MDNode field use, NFC
Swap usage of `SubclassData32` and `MDNodeSubclassData`, and rename
`MDNodeSubclassData` to `NumUnresolved`.  Small drive-by cleanup to
`countUnresolvedOperands()` since otherwise the name clash with local
vars named `NumUnresolved` would be confusing.

llvm-svn: 226523
2015-01-19 23:18:34 +00:00
Duncan P. N. Exon Smith
44bfe4a149 IR: Move replaceWithUniqued(), etc., to source file, NFC
llvm-svn: 226522
2015-01-19 23:17:09 +00:00
Duncan P. N. Exon Smith
91a931c9df IR: Cleanup MDNode::MDNode(), NFC
llvm-svn: 226521
2015-01-19 23:15:21 +00:00
Duncan P. N. Exon Smith
77b413580d IR: Merge UniquableMDNode back into MDNode, NFC
As pointed out in r226501, the distinction between `MDNode` and
`UniquableMDNode` is confusing.  When we need subclasses of `MDNode`
that don't use all its functionality it might make sense to break it
apart again, but until then this makes the code clearer.

llvm-svn: 226520
2015-01-19 23:13:14 +00:00
Duncan P. N. Exon Smith
9c25a26692 IR: Extract MDNodeOpsKey, NFC
Make the MDTuple operand hashing logic reusable.

llvm-svn: 226519
2015-01-19 22:53:18 +00:00
Duncan P. N. Exon Smith
55777b83fd IR: Simplify uniquifyImpl(), NFC
llvm-svn: 226518
2015-01-19 22:52:07 +00:00
Duncan P. N. Exon Smith
a1b2f403fd IR: Simplify erasing from uniquing store, NFC
llvm-svn: 226517
2015-01-19 22:47:08 +00:00
Duncan P. N. Exon Smith
8c03609afe Utils: Simplify MapMetadata(), NFC
Extract out the operand remapping loops, which are now very similar.

llvm-svn: 226515
2015-01-19 22:44:32 +00:00
Duncan P. N. Exon Smith
d56a14d555 Skip upcast, NFC
llvm-svn: 226514
2015-01-19 22:41:14 +00:00