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

43231 Commits

Author SHA1 Message Date
Duncan Sands
617030ad18 Teach InstructionSimplify about phi nodes. I chose to have it simply
offload the work to hasConstantValue rather than do something more
complicated (such handling mutually recursive phis) because (1) it is
not clear it is worth it; and (2) if it is worth it, maybe such logic
would be better placed in hasConstantValue.  Adjust some GVN tests
which are now cleaned up much further (eg: all phi nodes are removed).

llvm-svn: 119043
2010-11-14 13:30:18 +00:00
Duncan Sands
9a914e2b5e Boost the power of phi node constant folding slightly: if all
operands are the phi node itself or undef, then return undef.
This logic already existed at a higher level so in practice it
shouldn't make the slightest difference.  Note that this code
could be replaced by a call to PN->hasConstantValue().  However
since we bail out the moment we see a non-constant operand, it
is more efficient to have a specialized version of that logic.

llvm-svn: 119041
2010-11-14 12:53:18 +00:00
Duncan Sands
ab39985d42 Strip trailing whitespace.
llvm-svn: 119038
2010-11-14 11:23:23 +00:00
Owen Anderson
ad4f83df6a Second attempt at providing correct encodings for Thumb2 binary operators.
llvm-svn: 119029
2010-11-14 05:37:38 +00:00
Rafael Espindola
444d9c0b02 Handle a peculiar comdat case: Creating a section with an undefined
signature symbol causes a local symbol to be created unless there is
some other use of the symbol.

llvm-svn: 119026
2010-11-14 04:17:37 +00:00
Rafael Espindola
55e673b1c2 Simplify getSymbolIndexInSymbolTable by setting the actual index of
the symbols.

llvm-svn: 119022
2010-11-14 03:12:24 +00:00
Rafael Espindola
1b4c835948 Fix warning.
llvm-svn: 119021
2010-11-14 01:34:31 +00:00
Peter Collingbourne
4ec6b2dbe7 Recognise 32-bit ror-based bswap implementation used by uclibc
llvm-svn: 119007
2010-11-13 19:54:30 +00:00
Peter Collingbourne
6c3094234e Support ; as asm separator
llvm-svn: 119006
2010-11-13 19:54:23 +00:00
Duncan Sands
88fc6cd7fe Generalize the reassociation transform in SimplifyCommutative (now renamed to
SimplifyAssociativeOrCommutative) "(A op C1) op C2" -> "A op (C1 op C2)",
which previously was only done if C1 and C2 were constants, to occur whenever
"C1 op C2" simplifies (a la InstructionSimplify).  Since the simplifying operand
combination can no longer be assumed to be the right-hand terms, consider all of
the possible permutations.  When compiling "gcc as one big file", transform 2
(i.e. using right-hand operands) fires about 4000 times but it has to be said
that most of the time the simplifying operands are both constants.  Transforms
3, 4 and 5 each fired once.  Transform 6, which is an existing transform that
I didn't change, never fired.  With this change, the testcase is now optimized
perfectly with one run of instcombine (previously it required instcombine +
reassociate + instcombine, and it may just have been luck that this worked).

llvm-svn: 119002
2010-11-13 15:10:37 +00:00
Duncan Sands
6ff5e53731 Fix typo pointed out by Trevor Harmon.
llvm-svn: 119001
2010-11-13 12:16:27 +00:00
Bill Wendling
49dd03e223 Comment out the defms until they're activated.
llvm-svn: 119000
2010-11-13 11:20:05 +00:00
Bill Wendling
fadcb3cded Add uses of the *_ldst_multi multiclasses. These aren't used yet.
llvm-svn: 118999
2010-11-13 10:57:02 +00:00
Bill Wendling
184bc1368d Convert the modes to lower case.
llvm-svn: 118998
2010-11-13 10:43:34 +00:00
Bill Wendling
0a55425158 Minor cleanups:
- Get the opcode once.
- Add a ParserMatchClass to reglist.

llvm-svn: 118997
2010-11-13 10:40:19 +00:00
Bill Wendling
aa9ca6fcca Add *_ldst_mult multiclasses to the ARM back-end. These will be used in the
future to separate out the ia, ib, da, db variants of the load/store multiple
instructions.

llvm-svn: 118995
2010-11-13 09:09:38 +00:00
Daniel Dunbar
2ba9f79194 MC: Simplify Mach-O and ELF object writer implementations.
- What was I thinking?????

llvm-svn: 118992
2010-11-13 07:33:40 +00:00
Wesley Peck
4a2644f203 Fixed error and re-enabled MBlaze MC disassembler tests.
llvm-svn: 118987
2010-11-13 05:48:21 +00:00
Evan Cheng
239d9b439d Conditional moves are slightly more expensive than moves.
llvm-svn: 118985
2010-11-13 05:14:20 +00:00
Rafael Espindola
d2ff64abae Fix warning and add support for printing gnu_unique_object.
llvm-svn: 118981
2010-11-13 04:55:06 +00:00
Rafael Espindola
9cd0fd30e0 Parse and record the gnu_unique_object type.
llvm-svn: 118980
2010-11-13 04:51:02 +00:00
Rafael Espindola
00c5605efc Parse and remember discriminators in .loc line. I try to output them with
another patch.
This lets us parse a bit more of the gcc 4.5 output.

llvm-svn: 118975
2010-11-13 03:18:27 +00:00
Daniel Dunbar
fef193dc12 JIT: More nitty style tweakage, aka territory marking.
llvm-svn: 118973
2010-11-13 02:48:57 +00:00
Daniel Dunbar
1f695efa5e report_fatal_error: Simplify a possible ambiguity.
llvm-svn: 118972
2010-11-13 02:48:51 +00:00
Wesley Peck
c534d55751 1. Adding test cases for MBlaze MC disassembler.
2. Fixing several errors in disassembler uncovered by test cases.
3. Fixing invalid encoding of PCMPEQ and PCMPNE uncovered by test cases.

llvm-svn: 118969
2010-11-13 02:37:59 +00:00
Evan Cheng
a7d3c3d387 Add conditional move of large immediate.
llvm-svn: 118968
2010-11-13 02:25:14 +00:00
Jim Grosbach
cab8b12f7a Swap multiclass operand order for consistency with other patterns.
llvm-svn: 118965
2010-11-13 01:28:30 +00:00
Jim Grosbach
c8b3147ca5 Continue ARM indexed load refactoring. Multiclass for LDR{B} pre/post indexed
instructions.

llvm-svn: 118963
2010-11-13 01:07:20 +00:00
Rafael Espindola
e296fd654b Fix the encoding of negative line deltas.
llvm-svn: 118962
2010-11-13 01:06:27 +00:00
Daniel Dunbar
a34e9e580c Fix some more 80-col violas.
llvm-svn: 118959
2010-11-13 00:55:45 +00:00
Daniel Dunbar
2b1fd6592e Fix 80-col violation / non-sensicalness.
llvm-svn: 118958
2010-11-13 00:55:42 +00:00
Jim Grosbach
03eb1993ea More ARM load/store indexed refactoring. Also fix an incorrect IndexMode
flag for the LDRT/STRT family instructions as a side effect.

llvm-svn: 118955
2010-11-13 00:35:48 +00:00
Dan Gohman
a4aa69cf2a Revert r118917, which is implicated in the llvm-gcc-i386-linux-selfhost failure.
llvm-svn: 118954
2010-11-13 00:31:40 +00:00
Evan Cheng
a08372d4b4 Fix an obvious typo which inverted an immediate.
llvm-svn: 118951
2010-11-13 00:27:47 +00:00
Wesley Peck
28f124b047 1. Adding missing immediate mode asm parser test cases.
2. Fixing improper immediate mode reverse subtract.

llvm-svn: 118948
2010-11-13 00:03:46 +00:00
Eric Christopher
f6c7694c29 Temporarily revert this.
llvm-svn: 118946
2010-11-12 23:50:48 +00:00
Evan Cheng
1f5296d832 For pre-v6t2 targets, only select MOVi32imm if the immediate can be handled with movi + orr.
llvm-svn: 118945
2010-11-12 23:46:13 +00:00
Wesley Peck
f11db049fe Fixing improperly encoded reverse subtract instructions in MBlaze backend.
llvm-svn: 118943
2010-11-12 23:41:10 +00:00
Owen Anderson
053d9fb9b5 Revert r118939 while I work out why it broke some buildbots.
llvm-svn: 118942
2010-11-12 23:36:03 +00:00
Wesley Peck
be71f5db40 1. Finishing MBlaze MC asm parser test cases
2. Parsing .word directive in MBlaze asm parser
3. Fixing hack where memory instructions reversed order of last two parameters
4. Fixing many improperly encoded instructions
5. Support parsing special instructions (MFS,MTS,etc.)
6. Removing unused functions from inst printer

llvm-svn: 118941
2010-11-12 23:30:17 +00:00
Devang Patel
3dd764feda Remove DW_AT_start_scope support. It is incomplete and superseeded by location entries support.
llvm-svn: 118940
2010-11-12 23:20:42 +00:00
Owen Anderson
f8192cf0cc Attemt to provide correct encodings for Thumb2 binary operators.
llvm-svn: 118939
2010-11-12 23:18:11 +00:00
Evan Cheng
f3c75f91e9 Eliminate ARM::MOVi2pieces. Just use MOVi32imm and expand it to either movi+orr or movw+movt depending on the subtarget.
llvm-svn: 118938
2010-11-12 23:03:38 +00:00
Eric Christopher
b8ee838424 Make this happen for ARM like x86. Don't entirely bail out when
an address is in a different block, get it into a register and go
from there.

llvm-svn: 118936
2010-11-12 22:52:32 +00:00
Evan Cheng
19f018a1be Add conditional mvn instructions.
llvm-svn: 118935
2010-11-12 22:42:47 +00:00
Jim Grosbach
e0ba69b81d Zap a copy/paste-o bit of dead code.
llvm-svn: 118926
2010-11-12 21:29:10 +00:00
Jim Grosbach
eaaf8294a5 Refactor to parameterize some ARM load/store encoding patterns. Preparatory
to splitting the load/store pre/post indexed instructions into [r, r] and
[r, imm] forms.

llvm-svn: 118925
2010-11-12 21:28:15 +00:00
Owen Anderson
f1ffc8fdc9 First stab at providing correct Thumb2 encodings, start with adc.
llvm-svn: 118924
2010-11-12 21:12:40 +00:00
Duncan Sands
29593ddf27 Have GVN simplify instructions as it goes. For example, consider
"%z = %x and %y".  If GVN can prove that %y equals %x, then it turns
this into "%z = %x and %x".  With the new code, %z will be replaced
with %x everywhere (and then deleted).  Previously %z would be value
numbered too, which is a waste of time.  Also, while a clever value
numbering algorithm would give %z the same value number as %x, our
current one doesn't do so (at least I don't think it does).  The new
logic has an essentially equivalent effect to what you would get if
%z was given the same value number as %x, i.e. it should make value
numbering smarter.  While there, get hold of target data once at the
start rather than a gazillion times all over the place.

llvm-svn: 118923
2010-11-12 21:10:24 +00:00
Evan Cheng
b565d1acf9 Add some missing isel predicates on def : pat patterns to avoid generating VFP vmla / vmls (they cause stalls). Disabling them in isel is properly not a right solution, I'll look into a proper solution next.
llvm-svn: 118922
2010-11-12 20:32:20 +00:00
Jim Grosbach
160cc37f73 Kill more unused stuff.
llvm-svn: 118921
2010-11-12 19:27:45 +00:00
Benjamin Kramer
b4c0c4211e MCELF: Copy the symbol name only if we're going to modify it.
llvm-svn: 118920
2010-11-12 19:26:04 +00:00
Jim Grosbach
8bb507dd6b Remove unused class.
llvm-svn: 118919
2010-11-12 19:24:53 +00:00
Dan Gohman
8b86287a06 When the definition of an address value is in a different block
from the user of the address, fall back to just using the
address in a register instead of bailing out of fast-isel
altogether.

llvm-svn: 118917
2010-11-12 19:14:00 +00:00
Chris Lattner
2a70c4e38a accept lret as an alias for lretl, fixing the reopened part of PR8592
llvm-svn: 118916
2010-11-12 18:54:56 +00:00
Rafael Espindola
77cad43f26 Remove what looks like dead code in the production of debug lines.
We only produce debug line information if we have seen a line directive, so
this code is dead. Also, if we want to be bug by bug compatible with
gas and sometimes produce "empty" .debug_line sections, this will
match the content produced by gas.

llvm-svn: 118914
2010-11-12 18:41:26 +00:00
Andrew Trick
68d533cca4 typo (4th checkin for one fix)
llvm-svn: 118913
2010-11-12 18:36:03 +00:00
Jim Grosbach
f9d1b45754 Fill in the default predication bits for ARM unconditional branch.
llvm-svn: 118907
2010-11-12 18:13:26 +00:00
Jim Grosbach
cbab1ea04e Encoding for ARM LDRSB instructions.
llvm-svn: 118905
2010-11-12 17:52:59 +00:00
Andrew Trick
d0c919dcad Fixes PR8287: SD scheduling time. The fix is a failsafe that prevents
catastrophic compilation time in the event of unreasonable LLVM
IR. Code quality is a separate issue--someone upstream needs to do a
better job of reducing to llvm.memcpy. If the situation can be reproduced with
any supported frontend, then it will be a separate bug.

llvm-svn: 118904
2010-11-12 17:50:46 +00:00
Chris Lattner
612039e538 implement PR8592: empirically "lretq" is a "lret" with a rex.w prefix.
llvm-svn: 118903
2010-11-12 17:41:20 +00:00
Chris Lattner
bcdb696f6c tidy up.
llvm-svn: 118896
2010-11-12 17:24:29 +00:00
Rafael Espindola
dc54b2b285 gnu as support both % and @ before types, do the same.
llvm-svn: 118893
2010-11-12 15:47:08 +00:00
Dan Gohman
ec55b3ac75 Re-disable TBAA for now; it broke MultiSource/Applications/JM/lencod,
at least.

llvm-svn: 118890
2010-11-12 11:21:08 +00:00
Kalle Raiskila
f89d0d0389 Fix memory access lowering on SPU, adding
support for the case where alignment<value size.

These cases were silently miscompiled before this patch.
Now they are overly verbose -especially storing is- and
any front-end should still avoid misaligned memory 
accesses as much as possible. The bit juggling algorithm
added here probably has some room for improvement still.

llvm-svn: 118889
2010-11-12 10:14:03 +00:00
Eric Christopher
1ca7518097 Fix up a few more spots of addrmode2 (or not) changes that were
missed. Update some comments accordingly.

Fixes rdar://8652289

llvm-svn: 118888
2010-11-12 09:48:30 +00:00
Dan Gohman
f867bfd906 Enable TBAA.
llvm-svn: 118884
2010-11-12 06:20:01 +00:00
Lang Hames
b10e4b99e3 Fix some style issues in PBQP. Patch by David Blaikie.
llvm-svn: 118883
2010-11-12 05:47:21 +00:00
Dan Gohman
bc5a716f10 Enhance DSE to handle the case where a free call makes more than
one store dead. This is especially noticeable in
SingleSource/Benchmarks/Shootout/objinst.

llvm-svn: 118875
2010-11-12 02:19:17 +00:00
Dale Johannesen
659061fcd3 Remove possibly useful info from comment, per Chris.
llvm-svn: 118865
2010-11-12 00:43:18 +00:00
Bruno Cardoso Lopes
37f2439cbd Enable mips32 mul instruction. Patch by Akira Hatanaka <ahatanaka@mips.com>
llvm-svn: 118864
2010-11-12 00:38:32 +00:00
Jim Grosbach
f00a6faa17 Start of support for binary emit of 16-it Thumb instructions.
llvm-svn: 118859
2010-11-11 23:41:09 +00:00
Owen Anderson
85cf1b8ff5 Fill out support for Thumb2 encodings of NEON instructions.
llvm-svn: 118854
2010-11-11 23:12:55 +00:00
Wesley Peck
7974f4c201 The BRK instruction in the MicroBlaze is a branch-and-link.
llvm-svn: 118848
2010-11-11 22:21:08 +00:00
Nick Lewycky
1acee08e53 Doxygenify
llvm-svn: 118846
2010-11-11 21:51:44 +00:00
Dan Gohman
f3bf6591e0 Add helper functions for computing the Location of load, store,
and vaarg instructions.

llvm-svn: 118845
2010-11-11 21:50:19 +00:00
Wesley Peck
0e937ae80d Fix tblgen instruction errors exposed by MC asm parser tests
Fix minimum 16-bit signed value error exposed by MC asm parser tests
Add initial MC asm parser tests for the MBlaze backend

llvm-svn: 118844
2010-11-11 21:40:53 +00:00
Owen Anderson
0913dac245 Add correct Thumb2 encodings for NEON vst[1,2,3,4] and vld[1,2,3,4].
llvm-svn: 118843
2010-11-11 21:36:43 +00:00
Dan Gohman
97ce60bfa4 Don't forget the TBAA info, if available.
llvm-svn: 118842
2010-11-11 21:27:26 +00:00
Dan Gohman
b20b7d2ec2 Factor out Instruction::isSafeToSpeculativelyExecute's code for
testing for dereferenceable pointers into a helper function,
isDereferenceablePointer.  Teach it how to reason about GEPs
with simple non-zero indices.

Also eliminate ArgumentPromtion's IsAlwaysValidPointer,
which didn't check for weak externals or out of range gep
indices.

llvm-svn: 118840
2010-11-11 21:23:25 +00:00
Eric Christopher
474a93ff76 Revert the accidental commit I made reverting the previous commit.
llvm-svn: 118835
2010-11-11 20:50:14 +00:00
Jim Grosbach
b48a272807 Trailing whitespace.
llvm-svn: 118831
2010-11-11 20:16:23 +00:00
Jim Grosbach
cc8e5dc0c6 ARM fixup encoding for direct call instructions (BL).
llvm-svn: 118829
2010-11-11 20:05:40 +00:00
Eric Christopher
e7f27cf66a Revert this temporarily.
llvm-svn: 118827
2010-11-11 19:47:02 +00:00
Eric Christopher
beb7a50acb Change the prologue and epilogue to use push/pop for the low ARM registers.
llvm-svn: 118823
2010-11-11 19:26:03 +00:00
Dan Gohman
b68f197748 Avoid calling alias on non-pointer values.
llvm-svn: 118822
2010-11-11 19:23:51 +00:00
Owen Anderson
f43f09f6f6 Add support for Thumb2 encodings of NEON data processing instructions, using the new PostEncoderMethod infrastructure.
More tests to come.

llvm-svn: 118819
2010-11-11 19:07:48 +00:00
Rafael Espindola
1725702868 Mark labels declared in tls sections as STT_TLS. This matches the behavior of
gas.

llvm-svn: 118818
2010-11-11 19:04:55 +00:00
Wesley Peck
9ad36509f8 Fixed some bugs in MBlaze asm parser that were introduced when removing OwningPtrs from the code.
llvm-svn: 118807
2010-11-11 18:41:33 +00:00
Chris Lattner
b3eff154cd add a note
llvm-svn: 118806
2010-11-11 18:23:57 +00:00
Rafael Espindola
8555d32c9e Initial comdat implementation.
llvm-svn: 118805
2010-11-11 18:13:52 +00:00
Dan Gohman
7c6a63aea3 TBAA-enable ArgumentPromotion.
llvm-svn: 118804
2010-11-11 18:09:32 +00:00
Dan Gohman
d88f1d63ac Add a FIXME comment.
llvm-svn: 118803
2010-11-11 18:08:43 +00:00
Jim Grosbach
abf0e10ea0 Encoding of destination fixup for ARM branch and conditional branch
instructions.

llvm-svn: 118801
2010-11-11 18:04:49 +00:00
Andrew Trick
5e77065d78 Check TRI->getReservedRegs because other allocators do it. Even though
it makes no sense for allocation_order iterators to visit reserved regs.
The inline spiller depends on AliasAnalysis.
Manage the Query state to avoid uninitialized or stale results.

llvm-svn: 118800
2010-11-11 17:46:29 +00:00
Rafael Espindola
f7b3bb84e8 Make AliasedSymbol able to handle MCTargetExpr. They can get here if
a weakref is used with a VariantKind.

llvm-svn: 118798
2010-11-11 17:24:43 +00:00
Chris Lattner
3514fa6b11 add pr#
llvm-svn: 118797
2010-11-11 17:17:56 +00:00
Jim Grosbach
cfc32e3b5a Encoding for ARM LDRSH_POST.
llvm-svn: 118794
2010-11-11 16:55:29 +00:00
Rafael Espindola
f1ee36c3a3 Fix the symbol index of weak references. Also make RecordRelocation a bit
easier to read by having const references to the symbol, aliased symbol and
renamed symbol.

llvm-svn: 118793
2010-11-11 16:48:11 +00:00
Dan Gohman
9f805118c3 Include ImmutablePass passes in -debug-pass=Arguments.
llvm-svn: 118790
2010-11-11 16:32:17 +00:00
Dan Gohman
8e986f9c2f Remove the memmove->memcpy optimization from CodeGen. MemCpyOpt does this.
llvm-svn: 118789
2010-11-11 16:24:49 +00:00
Dan Gohman
01ed16d764 Make Sink tbaa-aware.
llvm-svn: 118788
2010-11-11 16:21:47 +00:00
Dan Gohman
4a432aa7bc It's safe to sink some instructions which are not safe to speculatively
execute. Make Sink's predicate more precise.

llvm-svn: 118787
2010-11-11 16:20:28 +00:00
Rafael Espindola
5766346831 Remove some explicit arguments to getELFSection. This is
a leftover from the removal of isExplicit.

llvm-svn: 118774
2010-11-11 03:40:25 +00:00
Jim Grosbach
8cb10f8def Encoding for ARM LDRSH and LDRSH_PRE. Cannonicalize operand names.
llvm-svn: 118767
2010-11-11 01:55:59 +00:00
Jim Grosbach
b86e183a33 Fix encoding of Ra register for ARM smla* instructions.
llvm-svn: 118761
2010-11-11 01:27:41 +00:00
Jim Grosbach
3b13f9013c ARM STRH encoding information.
llvm-svn: 118757
2010-11-11 01:09:40 +00:00
Jakob Stoklund Olesen
e7e1f14d50 Delete SplittingSpiller. It was not being used by anyone, and it is being
superceded by SplitKit.

llvm-svn: 118754
2010-11-11 00:52:44 +00:00
Dan Gohman
50936c7c4b It's not necessary to clear out the Size and TBAATag at each of
these points.

llvm-svn: 118752
2010-11-11 00:42:22 +00:00
Dan Gohman
b476dc0f55 Set NonLocalDepInfo's Size field to UnknownSize when invalidating
it, so that it doesn't appear to be a known size.

llvm-svn: 118748
2010-11-11 00:20:27 +00:00
Jakob Stoklund Olesen
313b78d28e Insert two blank SlotIndexes between basic blocks instead of just one.
This is the first small step towards using closed intervals for liveness instead
of the half-open intervals we're using now.

We want to be able to distinguish between a SlotIndex that represents a variable
being live-out of a basic block, and an index representing a variable live-in to
its successor.

That requires two separate indexes between blocks. One for live-outs and one for
live-ins.

With this change, getMBBEndIdx(MBB).getPrevSlot() becomes stable so it stays
greater than any instructions inserted at the end of MBB.

llvm-svn: 118747
2010-11-11 00:19:20 +00:00
Jakob Stoklund Olesen
2f72fda7ef No need to add liveness that's already there.
llvm-svn: 118742
2010-11-10 23:56:00 +00:00
Jakob Stoklund Olesen
6a63cbe06d Hook up AliasAnalysis in InlineSpiller. This is used for rematerializing
constant loads.

llvm-svn: 118741
2010-11-10 23:55:56 +00:00
Jim Grosbach
2c1d6373ab Move LDM predicate operand encoding into base clase. Add STM missing STM
encoding bits.

llvm-svn: 118738
2010-11-10 23:44:32 +00:00
Jim Grosbach
ad037e5ded ARM LDM encoding for the mode (ia, ib, da, db) operand.
llvm-svn: 118736
2010-11-10 23:38:36 +00:00
Rafael Espindola
6ee5a9491d Factor some code into WriteSection.
llvm-svn: 118733
2010-11-10 23:36:59 +00:00
Jim Grosbach
ef95eee920 Fix ARM encoding of non-return LDM instructions.
llvm-svn: 118732
2010-11-10 23:18:49 +00:00
Jim Grosbach
d832c84199 Fix ARM encoding of LDM+Return instruction.
llvm-svn: 118730
2010-11-10 23:12:48 +00:00
Dan Gohman
8895f1c5d5 When clearing a non-local pointer dependency cache entry, clear
the reverse map too. This fixes seflhost build errors.

llvm-svn: 118729
2010-11-10 22:35:02 +00:00
Rafael Espindola
281431a034 Update the section index map after we add the medatada sections.
llvm-svn: 118728
2010-11-10 22:34:07 +00:00
Devang Patel
5520a6fc97 Take care of special characters while creating named MDNode name to hold function specific local variable's info.
This fixes radar 8653152. I am checking in testcase as a separate check-in.

llvm-svn: 118726
2010-11-10 22:19:21 +00:00
Rafael Espindola
576f8dd869 Use SectionIndexMap in WriteSymbolTable to make it a little less brittle.
llvm-svn: 118725
2010-11-10 22:16:43 +00:00
Dan Gohman
543edf7e84 Factor out the code for computing an AliasAnalysis::Location
for a given instruction into a helper function.

llvm-svn: 118723
2010-11-10 21:51:35 +00:00
Rafael Espindola
d3696f41c7 Factor some code into ComputeIndexMap.
llvm-svn: 118722
2010-11-10 21:51:05 +00:00
Dan Gohman
aef3e95364 Fully invalidate cached results when a prior query's size or
type is insufficient for, or incompatible with, the current query.

llvm-svn: 118721
2010-11-10 21:45:11 +00:00
Nate Begeman
c4fabeabb9 Fix an issue where we tried to turn a v2f32 build_vector into a v4i32 build vector with 2 elts
llvm-svn: 118720
2010-11-10 21:35:41 +00:00
Duncan Sands
815e967d98 Reduce the maximum recursion depth, 5 seems pointlessly too much.
Probably it should just be 1, but compromise with 3.

llvm-svn: 118718
2010-11-10 20:53:24 +00:00
Dan Gohman
2b4e8302a6 Enhance GVN to do more precise alias queries for non-local memory
references. For example, this allows gvn to eliminate the load in
this example:

  void foo(int n, int* p, int *q) {
    p[0] = 0;
    p[1] = 1;
    if (n) {
      *q = p[0];
    }
  }

llvm-svn: 118714
2010-11-10 20:37:15 +00:00
Rafael Espindola
859cfe5bbd Change the String<size> methods to take a fragment instead of a buffer.
llvm-svn: 118709
2010-11-10 20:02:59 +00:00
Jakob Stoklund Olesen
00c4d94862 Basic rematerialization during splitting.
Whenever splitting wants to insert a copy, it checks if the value can be
rematerialized cheaply instead.

Missing features:
- Delete instructions when all uses have been rematerialized.
- Truncate live ranges to the remaining uses after rematerialization.

llvm-svn: 118702
2010-11-10 19:31:50 +00:00
Andrew Trick
9d60f59b55 RABasic is nearly functionally complete. There are a few remaining
benchmarks hitting an assertion.
Adds LiveIntervalUnion::collectInterferingVRegs.
Fixes "late spilling" by checking for any unspillable live vregs among
all physReg aliases.

llvm-svn: 118701
2010-11-10 19:18:47 +00:00
Rafael Espindola
d05bf9ffe0 Use MCSectionELF in places we know we have an ELF section.
llvm-svn: 118699
2010-11-10 19:05:07 +00:00
Dan Gohman
efbd98c352 Use getValueOperand() and getPointerOperand() on load and store
instructions instead of hard-coding operand numbers.

llvm-svn: 118698
2010-11-10 19:03:33 +00:00
Duncan Sands
8531f14f5b Teach InstructionSimplify how to look through PHI nodes. Since PHI
nodes can be used in loops, this could result in infinite looping
if there is no recursion limit, so add such a limit.  It is also
used for the SelectInst case because in theory there could be an
infinite loop there too if the basic block is unreachable.

llvm-svn: 118694
2010-11-10 18:23:01 +00:00
Dan Gohman
65a3841f03 Add a doesAccessArgPointees helper function, and update code to use
it, and to be consistent.

llvm-svn: 118692
2010-11-10 18:17:28 +00:00
Jim Grosbach
c5001c0f1d Simplify and clean up MC symbol lookup for ARM constant pool values. This fixes
double quoting of ObjC symbol names in constant pool entries.

rdar://8652107

llvm-svn: 118688
2010-11-10 17:59:10 +00:00
Dan Gohman
9ae50022a1 Factor out the code for testing whether a function accesses
arbitrary memory into a helper function, and adjust some comments.

llvm-svn: 118687
2010-11-10 17:34:04 +00:00
Michael J. Spencer
db71d89716 Fix Whitespace.
llvm-svn: 118683
2010-11-10 15:06:00 +00:00
Michael J. Spencer
c3e664a431 System/Win32/Path: Implement isSymLink.
llvm-svn: 118681
2010-11-10 15:05:39 +00:00
Duncan Sands
1ecf1f999e Simplify binary operations where one operand is a select instruction.
The simplifications performed here never create new instructions, they
only return existing instructions (or a constant), and so are always a
win.  In theory they should transform (for example)
  %z = and i32 %x, %y
  %s = select i1 %cond, i32 %y, i32 %z
  %r = and i32 %x, %s
into
  %r = and i32 %x, y
but in practice they get into a fight with instcombine, and lose.
Unfortunately instcombine does a poor job in this case.  Nonetheless
I'm committing this transform to make it easier to discuss what to
do to make peace with instcombine.

llvm-svn: 118679
2010-11-10 13:00:08 +00:00
NAKAMURA Takumi
84f55bb902 Win32/Process.inc: [PR8527] Process::FileDescriptorIsDisplayed(fd) should not check by FILE_TYPE_CHAR. It must be better to check it with Console API.
The special file "NUL" is FILE_TYPE_CHAR with GetFileType(h). It was treated as display device and discarding output to NUL had failed. (eg. opt -o nul)

llvm-svn: 118678
2010-11-10 08:37:47 +00:00
Jim Grosbach
4e3653e4e1 Update ARMConstantPoolValue to not use a modifier string. Use an explicit
VariantKind marker to indicate the additional information necessary. Update
MC to handle the new Kinds. rdar://8647623

llvm-svn: 118671
2010-11-10 03:26:07 +00:00
Bruno Cardoso Lopes
2266e58196 Add clo instruction. Patch by Akira Hatanaka (ahatanaka@mips.com) with some minor tweaks
llvm-svn: 118667
2010-11-10 02:13:22 +00:00
Dale Johannesen
24a82bdec2 When checking that the necessary bits are zero in
order to reduce ((x<<30)>>24) to x<<6, check the
correct bits.  PR 8547.

llvm-svn: 118665
2010-11-10 01:30:56 +00:00
Bill Wendling
87c781b411 Emit a '!' if this is a "writeback" register or memory address.
llvm-svn: 118662
2010-11-10 01:07:54 +00:00
Jakob Stoklund Olesen
e259b04730 Simplify the LiveRangeEdit::canRematerializeAt() interface a bit.
llvm-svn: 118661
2010-11-10 01:05:12 +00:00
Dan Gohman
1571dfc883 Make ModRefBehavior a lattice. Use this to clean up AliasAnalysis
chaining and simplify FunctionAttrs' GetModRefBehavior logic.

llvm-svn: 118660
2010-11-10 01:02:18 +00:00
Matt Beaumont-Gay
993d07638e Rename a parameter to avoid confusion with a local variable
llvm-svn: 118656
2010-11-10 00:08:58 +00:00
Bill Wendling
0c082b811f Emit the warning about the register list not being in ascending order only once.
llvm-svn: 118653
2010-11-09 23:45:59 +00:00
Rafael Espindola
3c0f11a265 Fixed version of 118639 with an extra assert to catch similar problems
earlier. Implicit bool -> int conversions are evil!

llvm-svn: 118651
2010-11-09 23:42:07 +00:00