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

32846 Commits

Author SHA1 Message Date
Bob Wilson
7623a1ce5c Refactor code for selecting NEON load lane intrinsics.
llvm-svn: 84109
2009-10-14 16:19:03 +00:00
Duncan Sands
4fcf6123dd I don't see any point in having both eh.selector.i32 and eh.selector.i64,
so get rid of eh.selector.i64 and rename eh.selector.i32 to eh.selector.
Likewise for eh.typeid.for.  This aligns us with gcc, which always uses a
32 bit value for the selector on all platforms.  My understanding is that
the register allocator used to assert if the selector intrinsic size didn't
match the pointer size, and this was the reason for introducing the two
variants.  However my testing shows that this is no longer the case (I
fixed some bugs in selector lowering yesterday, and some more today in the
fastisel path; these might have caused the original problems).

llvm-svn: 84106
2009-10-14 16:11:37 +00:00
Chris Lattner
a1f5264dd2 make instcombine's instruction sinking more aggressive in the
presence of PHI nodes.

llvm-svn: 84103
2009-10-14 15:21:58 +00:00
Evan Cheng
37a7a18748 Clear VisitedPHIs after use.
llvm-svn: 84080
2009-10-14 06:46:26 +00:00
Evan Cheng
907fd9c3fb Another BasicAA fix. If a value does not alias a GEP's base pointer, then it
cannot alias the GEP. GEP pointer alias rule states this clearly:
A pointer value formed from a getelementptr instruction is associated with the
addresses associated with the first operand of the getelementptr.

llvm-svn: 84079
2009-10-14 06:41:49 +00:00
Evan Cheng
c1056d9269 More code clean up based on patch feedback.
llvm-svn: 84074
2009-10-14 05:22:03 +00:00
Evan Cheng
efc0f806a4 Change VisitedPHIs into an instance variable that's freed by each alias() call.
llvm-svn: 84072
2009-10-14 05:05:02 +00:00
Dan Gohman
76221cc874 Make isSafeToClobberEFLAGS more aggressive. Teach it to scan backwards
(for uses marked kill and defs marked dead) a few instructions in
addition to forwards. Also, increase the maximum number of instructions
to scan, as it appears to help in a fair number of cases.

llvm-svn: 84061
2009-10-14 00:08:59 +00:00
Dan Gohman
49946908b4 This remat entry is basically done. There are hooks to allow targets
to remat non-load instructions as loads, and the remat code now uses
the UnmodeledSideEffects flags, MachineMemOperands, and similar things
to decide which instructions are valid for rematerialization.

llvm-svn: 84060
2009-10-14 00:02:01 +00:00
Dan Gohman
d845fbc307 Add a few README.txt items.
llvm-svn: 84059
2009-10-13 23:58:05 +00:00
Kevin Enderby
8d8e57983a Correct comment about ARM immediates using '#' not '$' and TODO for modifiers.
llvm-svn: 84055
2009-10-13 23:33:38 +00:00
Devang Patel
72f708ec2f s/DebugLoc.CompileUnit/DebugLoc.Scope/g
s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g

llvm-svn: 84054
2009-10-13 23:28:53 +00:00
Devang Patel
81485d992b Check void type before using RAUWd.
llvm-svn: 84049
2009-10-13 22:56:32 +00:00
Bob Wilson
a98883deaa More Neon clean-up: avoid the need for custom-lowering vld/st-lane intrinsics
by creating TargetConstants during instruction selection instead of during
legalization.

llvm-svn: 84042
2009-10-13 22:29:24 +00:00
Kevin Enderby
959ec973ad More bits of the ARM target assembler for llvm-mc to parse immediates.
Also fixed a couple of coding style things that crept in.  And added more
to the temporary hacked up ARMAsmParser::MatchInstruction() method for testing.

llvm-svn: 84040
2009-10-13 22:19:02 +00:00
Evan Cheng
3130aba687 Teach basic AA about PHI nodes. If all operands of a phi NoAlias another value than it's safe to declare the PHI NoAlias the value. Ditto for MustAlias.
llvm-svn: 84038
2009-10-13 22:02:20 +00:00
Bob Wilson
88df19e49a NEON VLD/VST are now fully implemented. For operations that expand to
multiple instructions, the expansion is done during selection so there is
no need to do anything special during legalization.

llvm-svn: 84036
2009-10-13 21:55:24 +00:00
Devang Patel
20d88f9e16 Do not check use_empty() before replaceAllUsesWith(). This gives ValueHandles a chance to get properly updated.
llvm-svn: 84033
2009-10-13 21:41:20 +00:00
Jeffrey Yasskin
8a0bdbb7f3 Keep track of stubs that are created. This fixes PR5162 and probably PR4822 and
4406. Patch by Nick Lewycky!

llvm-svn: 84032
2009-10-13 21:32:57 +00:00
Duncan Sands
d4a35e9f36 Introduce new convenience methods for sign extending or
truncating an SDValue (depending on whether the target
type is bigger or smaller than the value's type); or zero
extending or truncating it.  Use it in a few places (this
seems to be a popular operation, but I only modified cases
of it in SelectionDAGBuild).  In particular, the eh_selector
lowering was doing this wrong due to a repeated rather than
inverted test, fixed with this change.

llvm-svn: 84027
2009-10-13 21:04:12 +00:00
Bob Wilson
d66a3fd73b Revise ARM inline assembly memory operands to require the memory address to
be in a register.  The previous use of ARM address mode 2 was completely
arbitrary and inappropriate for Thumb.  Radar 7137468.

llvm-svn: 84022
2009-10-13 20:50:28 +00:00
Dale Johannesen
7db511a23e Add an "msasm" flag to inline asm as suggested in PR 5125.
A little ugliness is accepted to keep the binary file format
compatible.  No functional change yet.

llvm-svn: 84020
2009-10-13 20:46:56 +00:00
Sandeep Patel
af459ed32d Fix method name in comment, per Bob Wilson.
llvm-svn: 84017
2009-10-13 20:25:58 +00:00
Dan Gohman
c5a7668904 Use the new CodeMetrics class to compute code size instead of
manually counting instructions.

llvm-svn: 84016
2009-10-13 20:12:23 +00:00
Dan Gohman
c1e210fa10 Compute a full cost value even when a setjmp call is found.
llvm-svn: 84015
2009-10-13 20:10:10 +00:00
Dan Gohman
665e336185 Split code not specific to Function inlining out into a separate class,
named CodeMetrics. Move it to be a non-nested class. Rename RegionInfo
back to FunctionInfo.

llvm-svn: 84013
2009-10-13 19:58:07 +00:00
David Goodwin
d23db026b6 Add debugging output.
llvm-svn: 84011
2009-10-13 19:16:03 +00:00
Sandeep Patel
1584038783 Add ARMv6T2 SBFX/UBFX instructions. Approved by Anton Korobeynikov.
llvm-svn: 84009
2009-10-13 18:59:48 +00:00
Ted Kremenek
1f746d5df3 Update CMake file (lexically order files).
llvm-svn: 84008
2009-10-13 18:57:27 +00:00
Devang Patel
8f81b906ab Do not write empty METADATA_ATTACHMENT record.
llvm-svn: 84006
2009-10-13 18:51:28 +00:00
Devang Patel
934fb4274a Remove unnecessary assert.
llvm-svn: 84004
2009-10-13 18:51:03 +00:00
Benjamin Kramer
679377c816 Update the other CMake file.
llvm-svn: 84003
2009-10-13 18:50:54 +00:00
Devang Patel
e911e90808 Parse GEP with attached custom metadata. This happens during libprofile_rt.bca build.
llvm-svn: 84002
2009-10-13 18:49:55 +00:00
Ted Kremenek
dd5d38175d Update CMake file.
llvm-svn: 84001
2009-10-13 18:48:07 +00:00
Evan Cheng
84c5224fa2 Refactor some code. No functionality changes.
llvm-svn: 84000
2009-10-13 18:42:04 +00:00
Dan Gohman
81218aa90e Commit the removal of this file, which is now moved to lib/Analysis.
llvm-svn: 83999
2009-10-13 18:37:20 +00:00
Dan Gohman
18cdd7ef1b Move the InlineCost code from Transforms/Utils to Analysis.
llvm-svn: 83998
2009-10-13 18:30:07 +00:00
Dan Gohman
f277c57aad Start refactoring the inline cost estimation code so that it can be used
for purposes other than inlining.

llvm-svn: 83997
2009-10-13 18:24:11 +00:00
Chris Lattner
26c670aa44 change simplifycfg to not duplicate 'unwind' instructions. Hopefully
this will increase the likelihood of common code getting sunk towards
the unwind.

llvm-svn: 83996
2009-10-13 18:13:05 +00:00
Dan Gohman
d01c6196f4 Make LoopUnswitch's cost estimation count Instructions, rather than
BasicBlocks, so that it doesn't blindly procede in the presence of
large individual BasicBlocks. This addresses a class of code-size
expansion problems.

llvm-svn: 83992
2009-10-13 17:50:43 +00:00
Jeffrey Yasskin
3eacbf419d Make the ExecutionEngine automatically remove global mappings on when their
GlobalValue is destroyed.  Function destruction still leaks machine code and
can crash on leaked stubs, but this is some progress.

llvm-svn: 83987
2009-10-13 17:42:08 +00:00
Devang Patel
ee9d2f0cc0 "there is not any instruction with attached debug info in this module" does not mean "there is no debug info in this module". :)
llvm-svn: 83984
2009-10-13 17:35:35 +00:00
Bob Wilson
747a6c0795 Add some ARM instruction encoding bits.
Patch by Johnny Chen.

llvm-svn: 83983
2009-10-13 17:35:30 +00:00
Bob Wilson
60d40281d3 Fix regression introduced by r83894.
llvm-svn: 83982
2009-10-13 17:29:13 +00:00
Devang Patel
729589a539 Copy metadata when value is RAUW'd. It is debatable whether this is the right approach for custom metadata data in general. However, right now the only custom data user, "dbg", expects this behavior while FE is constructing llvm IR with debug info.
llvm-svn: 83977
2009-10-13 17:00:54 +00:00
Bob Wilson
53fb652143 Fix a tab. Thanks to Johnny Chen for pointing it out.
llvm-svn: 83973
2009-10-13 15:27:23 +00:00
Nick Lewycky
ee0c1726d8 Force memory use markers to have a ConstantInt for the size argument.
llvm-svn: 83960
2009-10-13 07:57:33 +00:00
Nick Lewycky
72f185f281 Teach BasicAA a little something about the atomic intrinsics: they can only
modify through the pointer they're given.

llvm-svn: 83959
2009-10-13 07:48:38 +00:00
Daniel Dunbar
592c5055dd Fix a -Asserts warning.
llvm-svn: 83950
2009-10-13 06:47:08 +00:00
Victor Hernandez
21280bc3af Memory dependence analysis was incorrectly stopping to scan for stores to a pointer at bitcast uses of a malloc call.
It should continue scanning until the malloc call, and this patch fixes that.

llvm-svn: 83931
2009-10-13 01:42:53 +00:00
Devang Patel
aeac1241b8 Find enclosing subprogram info.
llvm-svn: 83922
2009-10-12 23:11:24 +00:00
Devang Patel
8abee488dc Set default location for a function if it is not set.
llvm-svn: 83921
2009-10-12 23:10:55 +00:00
Kevin Enderby
c4125fbeb8 Fix two warnings about unused variables that are only used in assert() calls.
llvm-svn: 83917
2009-10-12 22:51:49 +00:00
Bob Wilson
3259a4106f Delete a comment that makes no sense to me. The statement that moving a CPE
before its reference is only supported on ARM has not been true for a while.
In fact, until recently, that was only supported for Thumb.  Besides that,
CPEs are always a multiple of 4 bytes in size, so inserting a CPE should have
no effect on Thumb alignment.

llvm-svn: 83916
2009-10-12 22:49:05 +00:00
Kevin Enderby
29f78ac638 Fix a problem in the code where ARMAsmParser::ParseShift() second argument
should have been a pointer to a reference.

llvm-svn: 83915
2009-10-12 22:39:54 +00:00
Evan Cheng
3a513d33ed Make licm debug message readable.
llvm-svn: 83908
2009-10-12 22:25:23 +00:00
Bob Wilson
59435f24b1 Change CreateNewWater method to return NewMBB by reference.
llvm-svn: 83905
2009-10-12 21:39:43 +00:00
Bob Wilson
47c68e5cdf Last week, ARMConstantIslandPass was failing to converge for the
MultiSource/Benchmarks/MiBench/automotive-susan test.  The failure has
since been masked by an unrelated change (just randomly), so I don't have
a testcase for this now.  Radar 7291928.

The situation where this happened is that a constant pool entry (CPE) was
placed at a lower address than the load that referenced it.  There were in
fact 2 CPEs placed at adjacent addresses and referenced by 2 loads that were
close together in the code.  The distance from the loads to the CPEs was
right at the limit of what they could handle, so that only one of the CPEs
could be placed within range.  On every iteration, the first CPE was found
to be out of range, causing a new CPE to be inserted.  The second CPE had
been in range but the newly inserted entry pushed it too far away.  Thus the
second CPE was also replaced by a new entry, which in turn pushed the first
CPE out of range.  Etc.

Judging from some comments in the code, the initial implementation of this
pass did not support CPEs placed _before_ their references.  In the case
where the CPE is placed at a higher address, the key to making the algorithm
terminate is that new CPEs are only inserted at the end of a group of adjacent
CPEs.  This is implemented by removing a basic block from the "WaterList"
once it has been used, and then adding the newly inserted CPE block to the
list so that the next insertion will come after it.  This avoids the ping-pong
effect where CPEs are repeatedly moved to the beginning of a group of
adjacent CPEs.  This does not work when going backwards, however, because the
entries at the end of an adjacent group of CPEs are closer than the CPEs
earlier in the group.

To make this pass terminate, we need to maintain a property that changes can
only happen in some sort of monotonic fashion.  The fix used here is to require
that the CPE for a particular constant pool load can only move to lower
addresses.  This is a very simple change to the code and should not cause
any significant degradation in the results.

llvm-svn: 83902
2009-10-12 21:23:15 +00:00
Bob Wilson
de5c640673 Another minor clean-up.
llvm-svn: 83897
2009-10-12 20:45:53 +00:00
Bob Wilson
4c946b403f Remove redundant parameter.
llvm-svn: 83894
2009-10-12 20:37:23 +00:00
Bob Wilson
64169bce3d Use early exit to reduce indentation.
llvm-svn: 83874
2009-10-12 19:04:03 +00:00
Bob Wilson
13ae442741 Change to return a value by reference.
llvm-svn: 83873
2009-10-12 19:01:12 +00:00
Bob Wilson
2079cf41c5 Add a typedef for an iterator.
llvm-svn: 83872
2009-10-12 18:52:13 +00:00
Dale Johannesen
38c9b68ccf Revert the kludge in 76703. I got a clean
bootstrap of FSF-style PPC, so there is some
reason to believe the original bug (which was
never analyzed) has been fixed, probably by
82266.

llvm-svn: 83871
2009-10-12 18:49:00 +00:00
Dale Johannesen
c78690fcaa Fix warning.
llvm-svn: 83870
2009-10-12 18:45:32 +00:00
Jeffrey Yasskin
7d85d5a366 Fix http://llvm.org/PR5160, to let CallbackVHs modify other ValueHandles on the
same Value without breaking things.

llvm-svn: 83861
2009-10-12 17:43:32 +00:00
Dan Gohman
4c9118f50e Remove a redundant member variable.
llvm-svn: 83857
2009-10-12 16:44:10 +00:00
Dan Gohman
b5a0207b98 Don't forget to mark RAX as live-out of the function when arranging for
it to hold the address of an sret return value, for x86-64 ABI purposes.

Also, fix the test that was originally intended to test this to actually
test it, using FileCheck.

llvm-svn: 83853
2009-10-12 16:36:12 +00:00
Nate Begeman
d27f450262 More heuristics for Combiner-AA. Still catches all important cases, but
compile time penalty on gnugo, the worst case in MultiSource, is down to
about 2.5% from 30%

llvm-svn: 83824
2009-10-12 05:53:58 +00:00
Edward O'Callaghan
00f4a355eb Haiku porting patches, Credit to Paul Davey.
llvm-svn: 83823
2009-10-12 04:57:20 +00:00
Chris Lattner
667c067ee0 Fix PR5087, patch by Jakub Staszak!
llvm-svn: 83822
2009-10-12 04:22:44 +00:00
Chris Lattner
b2e0e6c46b add some more hooks to the C bindings, patch by Kenneth Uildriks!
llvm-svn: 83821
2009-10-12 04:01:02 +00:00
Chris Lattner
ff0d7e8c93 populate instcombine's initial worklist more carefully, causing
it to visit instructions from the start of the function to the
end of the function in the first path.  This greatly speeds up
some pathological cases (e.g. PR5150).

Try #3, this time with some unneeded debug info stuff removed
which was causing dead pointers to be added to the worklist.

llvm-svn: 83818
2009-10-12 03:58:40 +00:00
Chris Lattner
bc69f8b5bb revert r83814 for now, it is making the llvm-gcc bootstrap unhappy.
llvm-svn: 83817
2009-10-11 23:56:08 +00:00
Chris Lattner
1a6fbd067a populate instcombine's initial worklist more carefully, causing
it to visit instructions from the start of the function to the
end of the function in the first path.  This greatly speeds up
some pathological cases (e.g. PR5150). 

llvm-svn: 83814
2009-10-11 23:17:43 +00:00
Anton Korobeynikov
deadc3ed2d Add missed mem-mem move patterns
llvm-svn: 83812
2009-10-11 23:03:53 +00:00
Anton Korobeynikov
986885b62e Add MSP430 mem-mem insts support. Patch by Brian Lucas with some my refinements
llvm-svn: 83811
2009-10-11 23:03:28 +00:00
Chris Lattner
85457e7c14 remove some harmful code that would turn an insertelement on an undef
into a shuffle even if it was used by another insertelement.  If the
visitation order of instcombine was wrong, this would turn a chain of
insertelements into a chain of shufflevectors, which was quite painful.

Since CollectShuffleElements handles these cases, the code can just
be nuked.

llvm-svn: 83810
2009-10-11 23:02:46 +00:00
Chris Lattner
b033a0ac47 teach instcombine to simplify xor's harder, catching the
new testcase.

llvm-svn: 83799
2009-10-11 22:22:13 +00:00
Chris Lattner
d2dc77f8c0 cleanups
llvm-svn: 83797
2009-10-11 22:00:32 +00:00
Chris Lattner
6cf4024732 cleanup, no functionality change.
llvm-svn: 83795
2009-10-11 21:36:10 +00:00
Chris Lattner
100f3ac565 generalize a transformation even more: we don't care whether the
input the the mul is a zext from bool, just that it is all zeros
other than the low bit.  This fixes some phase ordering issues
that would cause us to miss some xforms in mul.ll when the worklist
is visited differently.

llvm-svn: 83794
2009-10-11 21:29:45 +00:00
Chris Lattner
40d1618562 simplify a transformation by making it more general.
llvm-svn: 83792
2009-10-11 21:22:21 +00:00
Chris Lattner
0ad392bbe7 temporarily revert previous patch
llvm-svn: 83791
2009-10-11 21:05:34 +00:00
Chris Lattner
aafa929524 populate instcombine's initial worklist more carefully, causing
it to visit instructions from the start of the function to the
end of the function in the first path.  This greatly speeds up
some pathological cases (e.g. PR5150). 

llvm-svn: 83790
2009-10-11 21:04:37 +00:00
Torok Edwin
8525f5df9a Remove CleanupDbgInfo, instcombine does this and its not worth duplicating it
here.

llvm-svn: 83789
2009-10-11 19:58:35 +00:00
Torok Edwin
ed37f33b81 LICM shouldn't sink/delete debug information. Fix this and add a testcase.
For now the metadata of sinked/hoisted instructions is still wrong, but that'll
be fixed when instructions will have debug metadata directly attached.

llvm-svn: 83786
2009-10-11 19:15:54 +00:00
Anton Korobeynikov
329def1675 Implement 'm' memory operand properly
llvm-svn: 83785
2009-10-11 19:14:21 +00:00
Anton Korobeynikov
4465f90db6 Implement proper asmprinting for the globals. This eliminates bogus "call" modifier and also adds support for offsets wrt globals.
llvm-svn: 83784
2009-10-11 19:14:02 +00:00
Anton Korobeynikov
1ca8655151 Implement asm printing for inline asm memory operands
llvm-svn: 83783
2009-10-11 19:13:34 +00:00
Chris Lattner
8ae883b5f0 when folding duplicate conditions, delete the
now-probably-dead instruction tree feeding it.

llvm-svn: 83778
2009-10-11 18:39:58 +00:00
Chris Lattner
601cc4c588 implement rdar://7293527, a trivial instcombine that llvm-gcc
gets but clang doesn't, because it is implemented in GCC's
fold routine.

llvm-svn: 83761
2009-10-11 07:53:15 +00:00
Chris Lattner
1832a32b78 implement a transformation in jump threading that is currently
done by condprop, but do it in a much more general form.  The
basic idea is that we can do a limited form of tail duplication
in the case when we have a branch on a phi.  Moving the branch
up in to the predecessor block makes instruction selection
much easier and encourages chained jump threadings.

llvm-svn: 83759
2009-10-11 07:24:57 +00:00
Chris Lattner
562cc63c29 restructure some code, no functionality change.
llvm-svn: 83756
2009-10-11 04:40:21 +00:00
Chris Lattner
b4e9fb6967 factor some code better and move a function, no functionality change.
llvm-svn: 83755
2009-10-11 04:33:43 +00:00
Chris Lattner
525c0272aa make jump threading on a phi with undef inputs happen.
llvm-svn: 83754
2009-10-11 04:18:15 +00:00
Chris Lattner
8b521613d3 rewrite LCSSA to use SSAUpdate, to only return true if it modifies
the IR, and to implement the FIXME'd optimization.

llvm-svn: 83748
2009-10-11 02:53:37 +00:00
Chris Lattner
1b8c1d1d29 clean up and simplify some code. Don't use setvector when things will be
inserted only once, just use vector.  Don't compute ExitBlocks unless we
need it, change std::sort to array_pod_sort.

llvm-svn: 83747
2009-10-11 01:07:15 +00:00
Chris Lattner
37ff3c0ed1 switch GVN to use SSAUpdater. Besides removing a lot of complexity
from GVN, this also speeds it up, inserts fewer PHI nodes (see the
testcase) and allows it to remove more loads (due to fewer PHI nodes
standing in the way).

llvm-svn: 83746
2009-10-10 23:50:30 +00:00
Chris Lattner
0aa320ae4d add a simple helper method.
llvm-svn: 83745
2009-10-10 23:41:48 +00:00