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

47808 Commits

Author SHA1 Message Date
Evan Cheng
dc39e02b91 Reorg. No functionality change.
llvm-svn: 133533
2011-06-21 19:00:54 +00:00
Bob Wilson
5b04895bb8 Revert r133452: "Emit movq for 64-bit register to XMM register moves..."
This is breaking compiler-rt and llvm-gcc builds on MacOSX when not using
the integrated assembler.

llvm-svn: 133524
2011-06-21 17:35:13 +00:00
Anna Zaks
488fc45c84 Add support for sadd.with.overflow and uadd.with.overflow intrinsics to the CBackend by emitting definitions for each intrinsic that occurs in the module.
llvm-svn: 133522
2011-06-21 17:18:15 +00:00
Andrew Trick
04c3bb47ce IVUsers no longer needs to record the phis.
llvm-svn: 133518
2011-06-21 15:43:52 +00:00
Benjamin Kramer
02bc17d36d Remove unused variables.
llvm-svn: 133514
2011-06-21 14:58:30 +00:00
Jay Foad
2691fd9891 Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512).

llvm-svn: 133513
2011-06-21 10:33:19 +00:00
Jay Foad
d7276856c6 Don't use PN->replaceUsesOfWith() to change a PHINode's incoming blocks,
because it won't work after my phi operand changes, because the incoming
blocks will no longer be Uses.

llvm-svn: 133512
2011-06-21 10:02:43 +00:00
Evan Cheng
40adfc21f6 Teach dag combine to match halfword byteswap patterns.
1. (((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8)
   => (bswap x) >> 16
2. ((x&0xff)<<8)|((x&0xff00)>>8)|((x&0xff000000)>>8)|((x&0x00ff0000)<<8))
   => (rotl (bswap x) 16)

This allows us to eliminate most of the def : Pat patterns for ARM rev16
revsh instructions. It catches many more cases for ARM and x86.

rdar://9609108

llvm-svn: 133503
2011-06-21 06:01:08 +00:00
Andrew Trick
0f76c6afe8 indvars -disable-iv-rewrite: Adds support for eliminating identity
ops.

This is a rewrite of the IV simplification algorithm used by
-disable-iv-rewrite. To avoid perturbing the default mode, I
temporarily split the driver and created SimplifyIVUsersNoRewrite. The
idea is to avoid doing opcode/pattern matching inside
IndVarSimplify. SCEV already does it. We want to optimize with the
full generality of SCEV, but optimize def-use chains top down on-demand rather
than rewriting the entire expression bottom-up. This was easy to do
for operations that SCEV can prove are identity function. So we're now
eliminating bitmasks and zero extends this way.

A result of this rewrite is that indvars -disable-iv-rewrite no longer
requires IVUsers.

llvm-svn: 133502
2011-06-21 03:22:38 +00:00
Chad Rosier
16a86e04cf Revert r133435 and r133449 to appease buildbots.
llvm-svn: 133499
2011-06-21 02:09:03 +00:00
Akira Hatanaka
288c049012 Add A0 and A1 to the list of registers used for returning a value in order to
handle functions with return type Complex long long.

llvm-svn: 133497
2011-06-21 01:28:11 +00:00
Akira Hatanaka
1197db1f9b Coding style fixes.
llvm-svn: 133496
2011-06-21 01:02:03 +00:00
Akira Hatanaka
1e08980a21 Re-apply 132758 and 132768 which were speculatively reverted in 132777.
llvm-svn: 133494
2011-06-21 00:40:49 +00:00
Dan Gohman
d8baa3f8ce Completely short-circuit out ARC optimization if the ARC runtime
functions do not appear in the module.

llvm-svn: 133478
2011-06-20 23:20:43 +00:00
Bill Wendling
c04086de5c Remove the subclassing. This will be moved to the ASM printer.
llvm-svn: 133473
2011-06-20 22:12:24 +00:00
Justin Holewinski
e62da847fa PTX: Fix conversion between predicates and value types
llvm-svn: 133454
2011-06-20 18:42:48 +00:00
Nick Lewycky
831fb8200d Emit movq for 64-bit register to XMM register moves, but continue to accept
movd when assembling.

llvm-svn: 133452
2011-06-20 18:33:26 +00:00
Jay Foad
e834069c4d Fix a check for PHINodes with two incoming values.
llvm-svn: 133449
2011-06-20 17:46:19 +00:00
Justin Holewinski
c4253975bd PTX: Fix if-then-else formatting and add missing asserts
llvm-svn: 133447
2011-06-20 17:08:56 +00:00
Rafael Espindola
1c53a39ff9 Disable again.
llvm-svn: 133446
2011-06-20 17:04:08 +00:00
Justin Holewinski
a5d3db3bd2 PTX: Add basic register spilling code
The current implementation generates stack loads/stores, which are
really just mov instructions from/to "special" registers.  This may
not be the most efficient implementation, compared to an approach where
the stack registers are directly folded into instructions, but this is
easier to implement and I have yet to see a case where ptxas is unable
to see through this kind of register usage and know what is really
going on.

llvm-svn: 133443
2011-06-20 15:56:20 +00:00
Roman Divacky
79578394f5 Don't apply on PPC64 the 32bit ADDIC optimizations as there's no overflow
with 32bit values.

llvm-svn: 133439
2011-06-20 15:28:39 +00:00
Jay Foad
c465a95fb4 Change how PHINodes store their operands.
Change PHINodes to store simple pointers to their incoming basic blocks,
instead of full-blown Uses.

Note that this loses an optimization in SplitCriticalEdge(), because we
can no longer walk the use list of a BasicBlock to find phi nodes. See
the comment I removed starting "However, the foreach loop is slow for
blocks with lots of predecessors".

Extend replaceAllUsesWith() on a BasicBlock to also update any phi
nodes in the block's successors. This mimics what would have happened
when PHINodes were proper Users of their incoming blocks. (Note that
this only works if OldBB->replaceAllUsesWith(NewBB) is called when
OldBB still has a terminator instruction, so it still has some
successors.)

llvm-svn: 133435
2011-06-20 14:38:01 +00:00
Jay Foad
85fe93df5e Make better use of the PHINode API.
Change various bits of code to make better use of the existing PHINode
API, to insulate them from forthcoming changes in how PHINodes store
their operands.

llvm-svn: 133434
2011-06-20 14:18:48 +00:00
Jay Foad
2d8b44f777 Remove the AugmentedUse struct.
I don't think the AugmentedUse struct buys us much, either in
correctness or in ease of use. Ditch it, and simplify Use::getUser() and
User::allocHungoffUses().

llvm-svn: 133433
2011-06-20 14:12:33 +00:00
Rafael Espindola
a4e0983e26 Re enable 133415 with two fixes
* Don't introduce a duplicated bb in the CFG
* When making a branch unconditional, clear the PredCond array so that it
  is really unconditional.

llvm-svn: 133432
2011-06-20 14:11:42 +00:00
Duncan Sands
02396a97be Disable the logic added by rafael in commit 133415 to see if it brings the
dragonegg buildbots back to life.  Original commit message:
Teach early dup how to duplicate basic blocks with one successor and only phi instructions
into more complex blocks.

llvm-svn: 133430
2011-06-20 09:26:23 +00:00
Nadav Rotem
ea7e393b4e Fix PromoteIntRes_TRUNCATE: Add support for cases where the
source vector type is to be split while the target vector is to be promoted.
(eg: <4 x i64> -> <4 x i8> )

llvm-svn: 133424
2011-06-20 07:15:58 +00:00
Francois Pichet
fb2d44e57b Fix MSVC build. next() function already exists in the MSVC headers. This create a overload conflict. Make sure we pick up the llvm one.
llvm-svn: 133416
2011-06-20 05:19:37 +00:00
Rafael Espindola
ff05956b0b Teach early dup how to duplicate basic blocks with one successor and only phi instructions
into more complex blocks.

llvm-svn: 133415
2011-06-20 04:16:35 +00:00
Chris Lattner
d456ff35d1 Revamp the "ConstantStruct::get" methods. Previously, these were scattered
all over the place in different styles and variants.  Standardize on two
preferred entrypoints: one that takes a StructType and ArrayRef, and one that
takes StructType and varargs.

In cases where there isn't a struct type convenient, we now add a
ConstantStruct::getAnon method (whose name will make more sense after a few
more patches land).  

It would be "really really nice" if the ConstantStruct::get and 
ConstantVector::get methods didn't make temporary std::vectors.

llvm-svn: 133412
2011-06-20 04:01:31 +00:00
Jay Foad
9dc6571cbc Fix a FIXME by making GlobalVariable::getInitializer() return a
const Constant *.

llvm-svn: 133400
2011-06-19 18:37:11 +00:00
Nadav Rotem
57c4257192 Code cleanups: Remove duplicated logic in PromotInteRes_BITCAST, reserve vector space, reuse types.
llvm-svn: 133389
2011-06-19 10:49:57 +00:00
Nadav Rotem
92b0a68e9b Calls to AssertZext and getZeroExtendInReg must be made using scalar types.
llvm-svn: 133388
2011-06-19 10:22:39 +00:00
Nadav Rotem
0f11d5d161 When promoting the vector elements in CopyToParts, use vector trunc
instead of scalarizing, and doing an element-by-element truncat.

llvm-svn: 133382
2011-06-19 08:49:38 +00:00
Chris Lattner
6aa403748e Remove support for parsing the "type i32" syntax for defining a numbered
top level type without a specified number.  This syntax isn't documented
and blocks forward progress.

llvm-svn: 133371
2011-06-19 00:03:46 +00:00
Chris Lattner
22af594f89 revert r133368, apparently I missed the tests to be updated.
llvm-svn: 133369
2011-06-18 23:51:31 +00:00
Chris Lattner
6ff60dbed1 Remove support for parsing the "type i32" syntax for defining a numbered
top level type without a specified number.  This asmprinter has never
generated this, as you can tell by no tests being updated.  It also isn't
documented.

llvm-svn: 133368
2011-06-18 23:38:57 +00:00
Chris Lattner
c247005424 fix the varargs version of StructType::get to not require an LLVMContext, making usage
much cleaner.

llvm-svn: 133364
2011-06-18 22:48:56 +00:00
Chris Lattner
b93873f487 eliminate some pointless virtual methods.
llvm-svn: 133363
2011-06-18 22:15:47 +00:00
Chris Lattner
d8515bc2d6 simplify some code.
llvm-svn: 133362
2011-06-18 21:46:23 +00:00
Chris Lattner
6632283a47 now that Type::getDescription() is dead, the TypePrinting class can move from Assembly/Writer.h to being
a private class in AsmWriter.cpp.

llvm-svn: 133361
2011-06-18 21:23:04 +00:00
Chris Lattner
50b274b1cb eliminate the Type::getDescription() method, using "<<" instead. This
removes some gunk from LLVMContext.

llvm-svn: 133360
2011-06-18 21:18:23 +00:00
Chris Lattner
0fe414c07e rework the remaining autoupgrade logic to use a StringRef instead of creating a
temporary std::string for every function being checked.

llvm-svn: 133355
2011-06-18 18:56:39 +00:00
Benjamin Kramer
1525b80eef Directly print to a raw_ostream instead of printing to a buffer first.
llvm-svn: 133352
2011-06-18 14:42:47 +00:00
Benjamin Kramer
a16cba3e83 Simplify code. No functionality change.
llvm-svn: 133351
2011-06-18 14:42:42 +00:00
Benjamin Kramer
0475214748 Simplify code. No change in functionality.
llvm-svn: 133350
2011-06-18 13:53:47 +00:00
Hans Wennborg
6229bbd9c0 MC: Allow .common as alias for .comm assembler directive. PR10116.
llvm-svn: 133349
2011-06-18 13:51:54 +00:00
Benjamin Kramer
0b4d4ce7c1 Don't allocate empty read-only SmallVectors during SelectionDAG deallocation.
llvm-svn: 133348
2011-06-18 13:13:44 +00:00
Benjamin Kramer
8fa1866146 Remove unused but set variables.
llvm-svn: 133347
2011-06-18 11:09:41 +00:00
Hans Wennborg
e1d53b6e2b Fix PR10103: Less code for enum type translation.
In cases such as the attached test, where the case value for a switch
destination is used in a phi node that follows the destination, it
might be better to replace that value with the condition value of the
switch, so that more blocks can be folded away with
TryToSimplifyUncondBranchFromEmptyBlock because there are less
conflicts in the phi node.

llvm-svn: 133344
2011-06-18 10:28:47 +00:00
Cameron Zwarich
09c312acad When scalar replacement returns a vector type, only accept it if the vector
type's bitwidth matches the (allocated) size of the alloca. This severely
pessimizes vector scalar replacement when the only vector type being used is
something like <3 x float> on x86 or ARM whose allocated size matches a
<4 x float>.

I hope to fix some of the flawed assumptions about allocated size throughout
scalar replacement and reenable this in most cases.

llvm-svn: 133338
2011-06-18 06:17:51 +00:00
Chris Lattner
ad5400fa72 rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which is
for pre-2.9 bitcode files.  We keep x86 unaligned loads, movnt, crc32, and the
target indep prefetch change.

As usual, updating the testsuite is a PITA.

llvm-svn: 133337
2011-06-18 06:05:24 +00:00
Cameron Zwarich
00255ad84e Fix an invalid bitcast crash that occurs when doing a partial memset of a vector
alloca. Fixes part of <rdar://problem/9580800>.

llvm-svn: 133336
2011-06-18 05:47:49 +00:00
Cameron Zwarich
d6e767ca48 Remove a pointless assignment. Nothing checks the value of VectorTy anymore now
unless ScalarKind is Vector.

llvm-svn: 133335
2011-06-18 05:47:45 +00:00
Jakob Stoklund Olesen
481c6beee6 Delete unneeded allocation order override.
llvm-svn: 133331
2011-06-18 02:30:02 +00:00
Jakob Stoklund Olesen
6346426b8c Switch ARM to using AltOrders instead of MethodBodies.
This slightly changes the GPR allocation order on Darwin where R9 is not
a callee-saved register:

Before: %R0 %R1 %R2 %R3 %R12 %R9 %LR %R4 %R5 %R6 %R8 %R10 %R11
After:  %R0 %R1 %R2 %R3 %R9 %R12 %LR %R4 %R5 %R6 %R8 %R10 %R11
llvm-svn: 133326
2011-06-18 01:14:46 +00:00
Jakob Stoklund Olesen
434b0e8aef Switch x86 to using AltOrders instead of MethodBodies.
llvm-svn: 133325
2011-06-18 01:14:43 +00:00
Jakob Stoklund Olesen
5502137e83 Reserve D16-D13 on subtargets that don't support them.
llvm-svn: 133321
2011-06-18 00:53:27 +00:00
Bill Wendling
265a3f9032 * Override the "EmitBytes" function, since it can sneak values in that way.
* Make this used only if CFI is used.

llvm-svn: 133319
2011-06-18 00:19:35 +00:00
Eric Christopher
169d53e1e0 Fix UMULO support for 2x register width to allow the full
range without a libcall to a new mulo<mode> libcall
that we'd have to create.

Finishes the rest of rdar://9090077 and rdar://9210061

llvm-svn: 133318
2011-06-18 00:09:57 +00:00
Bill Wendling
83d5b74f00 Remove false assertion.
llvm-svn: 133314
2011-06-17 23:42:01 +00:00
Jakob Stoklund Olesen
8c156f19ec Only call TRI::getRawAllocationOrder to resolve a target-dependent hint.
llvm-svn: 133313
2011-06-17 23:26:52 +00:00
Jakob Stoklund Olesen
fb9f0e74cf Zap the last reference to allocation_order_begin().
llvm-svn: 133310
2011-06-17 23:17:13 +00:00
Jakob Stoklund Olesen
e01d928b0f SI, DI, BP, and SP don't have 8-bit sub-registers in x86 mode.
llvm-svn: 133308
2011-06-17 23:15:00 +00:00
Eric Christopher
04c9154cba Fix comment.
llvm-svn: 133307
2011-06-17 22:35:59 +00:00
Matt Beaumont-Gay
d43d674bfb Fix -Asserts build
llvm-svn: 133305
2011-06-17 22:21:12 +00:00
Chad Rosier
0dc865af56 Revert r133285. Causing odd failures on Dragonegg.
llvm-svn: 133301
2011-06-17 22:08:25 +00:00
Bill Wendling
918a35a41b Disable for another investigation.
llvm-svn: 133299
2011-06-17 21:44:15 +00:00
Devang Patel
65e272ee15 Set debug loc for new preheader's terminator.
llvm-svn: 133298
2011-06-17 21:36:44 +00:00
Bill Wendling
be4fd10d84 Support only DwarfCFI or SjLj exception handling in LSDA decoder.
llvm-svn: 133297
2011-06-17 21:31:43 +00:00
Bill Wendling
530eece33e SjLj exception handling LSDA decoding support wasn't represented correctly. Use
the correct values, etc. In particular, the exception handling type is SjLj, not
ARM.

llvm-svn: 133296
2011-06-17 21:29:06 +00:00
Bill Wendling
a31de72e6a Disable to investigate ARM failure.
llvm-svn: 133293
2011-06-17 21:09:50 +00:00
Bill Wendling
1d4e48661b Use the verbose asm flag instead of a new flag for decoding the LSDA.
llvm-svn: 133292
2011-06-17 20:55:01 +00:00
Evan Cheng
df9192b200 Add an alternative rev16 pattern. We should figure out a better way to handle these complex rev patterns. rdar://9609108
llvm-svn: 133289
2011-06-17 20:47:21 +00:00
Eric Christopher
25aa04466a Lower multiply with overflow checking to __mulo<mode>
calls if we haven't been able to lower them any
other way.

Fixes rdar://9090077 and rdar://9210061

llvm-svn: 133288
2011-06-17 20:41:29 +00:00
Bill Wendling
88bb5d74ab Add an option that allows one to "decode" the LSDA.
The LSDA is a bit difficult for the non-initiated to read. Even with comments,
it's not always clear what's going on. This wraps the ASM streamer in a class
that retains the LSDA and then emits a human-readable description of what's
going on in it.

So instead of having to make sense of:

Lexception1:
        .byte   255
        .byte   155
        .byte   168
        .space  1
        .byte   3
        .byte   26
Lset0 = Ltmp7-Leh_func_begin1
      .long     Lset0
Lset1 = Ltmp812-Ltmp7
      .long     Lset1
Lset2 = Ltmp913-Leh_func_begin1
      .long     Lset2
      .byte     3
Lset3 = Ltmp812-Leh_func_begin1
      .long     Lset3
Lset4 = Leh_func_end1-Ltmp812
      .long     Lset4
      .long     0
      .byte     0
      .byte     1
      .byte     0
      .byte     2
      .byte     125
      .long     __ZTIi@GOTPCREL+4
      .long     __ZTIPKc@GOTPCREL+4

you can read this instead:

## Exception Handling Table: Lexception1
##  @LPStart Encoding: omit
##    @TType Encoding: indirect pcrel sdata4
##        @TType Base: 40 bytes
## @CallSite Encoding: udata4
## @Action Table Size: 26 bytes

## Action 1:
##   A throw between Ltmp7 and Ltmp812 jumps to Ltmp913 on an exception.
##     For type(s):  __ZTIi@GOTPCREL+4 __ZTIPKc@GOTPCREL+4
## Action 2:
##   A throw between Ltmp812 and Leh_func_end1 does not have a landing pad.

llvm-svn: 133286
2011-06-17 20:35:21 +00:00
Stuart Hastings
03f59f5916 Relocate NUW test to cover all binary ops in a dynamic alloca expr.
Followup to 132926.  rdar://problem/9265821

llvm-svn: 133285
2011-06-17 20:21:52 +00:00
Chris Lattner
dd6d168c92 Drop the "2" suffix on some enums.
llvm-svn: 133274
2011-06-17 18:17:37 +00:00
Chris Lattner
04d8431b16 remove support for a bunch of obsolete instruction encodings
and other backward compatibility hacks.

llvm-svn: 133273
2011-06-17 18:09:11 +00:00
Benjamin Kramer
28b93c078a Remove a useless copy of MCELFStreamer. Patch by Logan Chien!
llvm-svn: 133272
2011-06-17 18:05:30 +00:00
Jakub Staszak
70a2c4bf32 getSuccWeight returns now default 0 if Weights vector is empty.
llvm-svn: 133271
2011-06-17 18:00:21 +00:00
Chris Lattner
ef05689a18 missed a file.
llvm-svn: 133270
2011-06-17 17:56:00 +00:00
Chris Lattner
d59a556c3a Remove some "2" suffixes from the metadata enums now that "1" is gone.
llvm-svn: 133269
2011-06-17 17:50:30 +00:00
Chris Lattner
c7bf0d0128 remove bitcode reader support for LLVM 2.7 metadata encoding.
llvm-svn: 133268
2011-06-17 17:48:53 +00:00
Chris Lattner
989da517f1 remove another old and dead hunk of code.
llvm-svn: 133267
2011-06-17 17:40:18 +00:00
Chris Lattner
2e2fad280a Stop accepting and ignoring attributes in function types. Attributes are applied
to functions and call/invokes, not to types.

llvm-svn: 133266
2011-06-17 17:37:13 +00:00
Jakub Staszak
87288736d2 Allow empty Weights vector.
llvm-svn: 133265
2011-06-17 17:30:10 +00:00
Roman Divacky
6778c94b24 Fix a few places where 32bit instructions/registerset were used on PPC64.
llvm-svn: 133260
2011-06-17 15:21:10 +00:00
Rafael Espindola
f9ff169e9c Two fixes relating to debug value:
* We should change the generated code because of a debug use.
* Avoid creating debug uses of undef, as they become a kill.
Test to follow.

llvm-svn: 133255
2011-06-17 13:59:43 +00:00
Jay Foad
b337da0cff Fix typo in comment.
llvm-svn: 133254
2011-06-17 13:36:06 +00:00
Justin Holewinski
c515f1b903 PTX: Adjust rounding modes
* rounding modes for fp add, mul, sub now use .rn
* float -> int rounding correctly uses .rzi not .rni
* 32bit fdiv for sm13 uses div.rn (instead of div.approx)
* 32bit fdiv for sm10 now uses div (instead of div.approx)

Approx is not IEEE 754 compatible (and should be optionally set by a flag to the backend instead). The .rn rounding modifier is the PTX default anyway, but it's better to be explicit.

All these modifiers should be available by using __fmul_rz functions for example, but support will need to be added for this in the backend.

Patch by Dan Bailey

llvm-svn: 133253
2011-06-17 12:12:42 +00:00
Nick Lewycky
9bfe06b4d6 When promoting an alloca to registers discard any lifetime intrinsics.
llvm-svn: 133251
2011-06-17 10:09:00 +00:00
Lang Hames
20552cda1a Add a hook for PBQP clients to run a custom pre-alloc pass to run prior to PBQP allocation. Patch by Arnaud Allard de Grandmaison.
llvm-svn: 133249
2011-06-17 07:09:01 +00:00
Chris Lattner
0899957b99 make the asmparser reject function and type redefinitions. 'Merging' hasn't been
needed since llvm-gcc 3.4 days.

llvm-svn: 133248
2011-06-17 07:06:44 +00:00
Chris Lattner
385977c252 remove asmparser support for the old getresult instruction, which has been subsumed by extractvalue.
llvm-svn: 133247
2011-06-17 06:57:15 +00:00
Chris Lattner
9e7c036d09 remove parser support for the obsolete "multiple return values" syntax, which
was replaced with return of a "first class aggregate".

llvm-svn: 133245
2011-06-17 06:49:41 +00:00
Chris Lattner
17983fc4ba stop accepting begin/end around function bodies in the .ll parser, this isn't pascal anymore.
llvm-svn: 133244
2011-06-17 06:42:57 +00:00
Chris Lattner
4eb6f76fa6 Remove support for using "foo" as symbols instead of %"foo". This is ancient
syntax and has been long obsolete.  As usual, updating the tests is the nasty
part of this.

llvm-svn: 133242
2011-06-17 06:36:20 +00:00
Rafael Espindola
7adb7e304b Enable early duplication of small blocks. There are still improvements to
be made, but this is already a win.

llvm-svn: 133240
2011-06-17 05:54:50 +00:00