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

13450 Commits

Author SHA1 Message Date
Rafael Espindola
9f526bcf4d First step in fixing PR8927:
Add a unnamed_addr bit to global variables and functions. This will be used
to indicate that the address is not significant and therefore the constant
or function can be merged with others.

If an optimization pass can show that an address is not used, it can set this.

Examples of things that can have this set by the FE are globals created to
hold string literals and C++ constructors.

Adding unnamed_addr to a non-const global should have no effect unless
an optimization can transform that global into a constant.

Aliases are not allowed to have unnamed_addr since I couldn't figure
out any use for it.

llvm-svn: 123063
2011-01-08 16:42:36 +00:00
Chris Lattner
50aaa34f29 make this file properly self contained.
llvm-svn: 123059
2011-01-08 08:19:49 +00:00
Chris Lattner
397937fa0d Revamp the ValueMapper interfaces in a couple ways:
1. Take a flags argument instead of a bool.  This makes
   it more clear to the reader what it is used for.
2. Add a flag that says that "remapping a value not in the
   map is ok".
3. Reimplement MapValue to share a bunch of code and be a lot
   more efficient.  For lookup failures, don't drop null values
   into the map.
4. Using the new flag a bunch of code can vaporize in LinkModules
   and LoopUnswitch, kill it.

No functionality change.

llvm-svn: 123058
2011-01-08 08:15:20 +00:00
Evan Cheng
1afd04fc59 Recognize inline asm 'rev /bin/bash, ' as a bswap intrinsic call.
llvm-svn: 123048
2011-01-08 01:24:27 +00:00
Evan Cheng
aa16fd02ad Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared
with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check
the operand when the instruction is an INLINEASM.

This allows memory instructions to be moved around INLINEASM instructions.

llvm-svn: 123044
2011-01-07 23:50:32 +00:00
Devang Patel
1c9a5199b5 Do not include DataTypes.h in llvm-c/lto.h.
This means avoid using uint32_t. This patch reverts r112200 and fixes original  problem by fixing argument type in lto.cpp.

llvm-svn: 123038
2011-01-07 22:26:25 +00:00
Evan Cheng
b960c4c2ae Fix comment. INLINEASM node operand #3 is IsAlignStack bit.
llvm-svn: 123036
2011-01-07 21:38:59 +00:00
Evan Cheng
8b58b77d06 DBG_VALUE does not have any side effects; it also makes no sense to mark it cheap as a copy.
llvm-svn: 123031
2011-01-07 21:08:26 +00:00
Jay Foad
a87f52d780 Simplify the allocation and freeing of Users' operand lists, now that
every BranchInst has a fixed number of operands.

llvm-svn: 123027
2011-01-07 20:29:02 +00:00
Jay Foad
225d525e88 Remove the "ugly" method BranchInst::setUnconditionalDest().
llvm-svn: 123026
2011-01-07 20:26:51 +00:00
Bob Wilson
22f18a7e94 Add ARM patterns to match EXTRACT_SUBVECTOR nodes.
Also fix an off-by-one in SelectionDAGBuilder that was preventing shuffle
vectors from being translated to EXTRACT_SUBVECTOR.
Patch by Tim Northover.

The test changes are needed to keep those spill-q tests from testing aligned
spills and restores.  If the only aligned stack objects are spill slots, we
no longer realign the stack frame.  Prior to this patch, an EXTRACT_SUBVECTOR
was legalized by loading from the stack, which created an aligned frame index.
Now, however, there is nothing except the spill slot in the stack frame, so
I added an aligned alloca.

llvm-svn: 122995
2011-01-07 04:59:04 +00:00
Bob Wilson
bcbb3375dd Change EXTRACT_SUBVECTOR to require a constant index.
We were never generating any of these nodes with variable indices, and there
was one legalizer function asserting on a non-constant index.  If we ever have
a need to support variable indices, we can add this back again.

llvm-svn: 122993
2011-01-07 04:58:56 +00:00
Evan Cheng
cb39cc2164 Re-implement r122936 with proper target hooks. Now getMaxStoresPerMemcpy
etc. takes an option OptSize. If OptSize is true, it would return
the inline limit for functions with attribute OptSize.

llvm-svn: 122952
2011-01-06 06:52:41 +00:00
Jakob Stoklund Olesen
7b1480ff12 Add the SpillPlacement analysis pass.
This pass precomputes CFG block frequency information that can be used by the
register allocator to find optimal spill code placement.

Given an interference pattern, placeSpills() will compute which basic blocks
should have the current variable enter or exit in a register, and which blocks
prefer the stack.

The algorithm is ready to consume block frequencies from profiling data, but for
now it gets by with the static estimates used for spill weights.

This is a work in progress and still not hooked up to RegAllocGreedy.

llvm-svn: 122938
2011-01-06 01:21:53 +00:00
Bob Wilson
70abb04bf5 Revert svn 122743, removing the instcombine pass that was replaced by earlycse.
My i386 llvm-gcc nightly tester found a regression for
SingleSource/Benchmarks/McGill/chomp that a bisect blamed on 122743.
That seems strange but apparently the combination of earlycse and instcombine
did something bad.  Chris says he intended to remove the instcombine pass, so
let's go ahead and try that.  We'll see if there are any performance losses.

llvm-svn: 122907
2011-01-05 21:16:50 +00:00
Wesley Peck
832c9e07a1 Fix small bug in setDebugInfoAvailability.
llvm-svn: 122886
2011-01-05 17:01:57 +00:00
Chris Lattner
de8f64f331 Fix PR8906: -fno-builtin should disable loop-idiom recognition.
It forms memset and memcpy's, and will someday form popcount and
other stuff.  All of this is bad when compiling the implementation
of memset, memcpy, popcount, etc.

llvm-svn: 122854
2011-01-05 01:03:32 +00:00
Jakob Stoklund Olesen
76e782c385 Use the EdgeBundles analysis in X86FloatingPoint instead of recomputing CFG
bundles in the pass.

llvm-svn: 122833
2011-01-04 21:10:11 +00:00
Jakob Stoklund Olesen
abf8941a60 Turn the EdgeBundles class into a stand-alone machine CFG analysis pass.
The analysis will be needed by both the greedy register allocator and the
X86FloatingPoint pass. It only needs to be computed once when the CFG doesn't
change.

This pass is very fast, usually showing up as 0.0% wall time.

llvm-svn: 122832
2011-01-04 21:10:05 +00:00
Owen Anderson
8bc93c6fdf Give MachineFunctionAnalysis a getPassName() implementation to make timing reports prettier.
llvm-svn: 122816
2011-01-04 18:21:18 +00:00
Duncan Sands
d252c6dae7 These methods should be "const"; make them so.
llvm-svn: 122809
2011-01-04 12:52:29 +00:00
Owen Anderson
a52e5dbdfa Stub out a new updating interface to AliasAnalysis, allowing stateful analyses to be informed when
a pointer value has potentially become escaping.  Implementations can choose to either fall back to
conservative responses for that value, or may recompute their analysis to accomodate the change.

llvm-svn: 122777
2011-01-03 21:38:41 +00:00
Evan Cheng
7465840a55 Undo what looks like accidental removal of an instcombine pass in r122740.
llvm-svn: 122743
2011-01-03 07:53:18 +00:00
Chris Lattner
ac005f0653 Turn on earlycse by default. This seems to be a small performance
improvement in the generated code, and speeds up 'opt -std-compile-opts'
compile time on 176.gcc from 24.84s to 23.2s (about 7%).

This also resolves a specific code quality issue in rdar://7352081 which
was generating poor code for:

int t(int a, int b) {
  if (a & b & 1)
    return a & b;
  return 3;
}

llvm-svn: 122740
2011-01-03 06:19:09 +00:00
Nick Lewycky
4840065424 Add spliceFunction to the CallGraph interface. This allows users to efficiently
update a callGraph when performing the common operation of splicing the body to
a new function and updating all callers (such as via RAUW).

No users yet, though this is intended for DeadArgumentElimination as part of
PR8887.

llvm-svn: 122728
2011-01-03 03:19:35 +00:00
Chris Lattner
c6ccec7faf add a handy typedef.
llvm-svn: 122726
2011-01-03 03:16:20 +00:00
Chris Lattner
c375dcd5f5 really get this working with a custom allocator.
llvm-svn: 122722
2011-01-03 01:38:29 +00:00
Chris Lattner
85f8315219 Enhance ScopedHashTable to allow it to take an allocator argument.
llvm-svn: 122721
2011-01-03 01:29:37 +00:00
Cameron Zwarich
a4f2efdd41 Add a new loop-instsimplify pass, with the intention of replacing the instance
of instcombine that is currently in the middle of the loop pass pipeline. This
commit only checks in the pass; it will hopefully be enabled by default later.

llvm-svn: 122719
2011-01-03 00:25:16 +00:00
Chris Lattner
e396e846b4 split dom frontier handling stuff out to its own DominanceFrontier header,
so that Dominators.h is *just* domtree.  Also prune #includes a bit.

llvm-svn: 122714
2011-01-02 22:09:33 +00:00
Chris Lattner
688675a0be sketch out a new early cse pass. No functionality yet.
llvm-svn: 122713
2011-01-02 21:47:05 +00:00
Cameron Zwarich
482eeb4c8e Remove an unused member function.
llvm-svn: 122693
2011-01-02 12:37:22 +00:00
Cameron Zwarich
8444a578bb Fix a typo in a variable name.
llvm-svn: 122691
2011-01-02 12:17:10 +00:00
Cameron Zwarich
72a49f9271 Move a load into the only branch where it is used and eliminate a temporary.
llvm-svn: 122690
2011-01-02 10:50:14 +00:00
Cameron Zwarich
0a0e69ca0d Add the explanatory comment from r122680's commit message to the code itself.
llvm-svn: 122689
2011-01-02 10:40:14 +00:00
Cameron Zwarich
e522fd8efe Tidy up indentation.
llvm-svn: 122688
2011-01-02 10:10:02 +00:00
Cameron Zwarich
7becf43554 Fix a typo, which should also fix the failure on llvm-x86_64-linux-checks.
llvm-svn: 122687
2011-01-02 10:06:44 +00:00
Cameron Zwarich
25272921bb Remove the #ifdef'd code for balancing the eval-link data structure. It doesn't
compile, and everyone's tests have shown it to be slower in practice, even for
quite large graphs.

I also hope to do an optimization that is only correct with the simpler data
structure, which would break this even further.

llvm-svn: 122684
2011-01-02 07:53:49 +00:00
Cameron Zwarich
c8a0461c46 Speed up dominator computation some more by optimizing bucket processing. When
naively implemented, the Lengauer-Tarjan algorithm requires a separate bucket
for each vertex. However, this is unnecessary, because each vertex is only
placed into a single bucket (that of its semidominator), and each vertex's
bucket is processed before it is added to any bucket itself.

Instead of using a bucket per vertex, we use a single array Buckets that has two
purposes. Before the vertex V with DFS number i is processed, Buckets[i] stores
the index of the first element in V's bucket. After V's bucket is processed,
Buckets[i] stores the index of the next element in the bucket to which V now
belongs, if any.

Reading from the buckets can also be optimized. Instead of processing the bucket
of V's parent at the end of processing V, we process the bucket of V itself at
the beginning of processing V. This means that the case of the root vertex can
be simplified somewhat. It also means that we don't need to look up the DFS
number of the semidominator of every node in the bucket we are processing,
since we know it is the current index being processed.

This is a 6.5% speedup running -domtree on test-suite + SPEC2000/2006, with
larger speedups of around 12% on the larger benchmarks like GCC.

llvm-svn: 122680
2011-01-02 07:03:00 +00:00
Chris Lattner
e2ca13d366 turn on memset idiom recognition by default. Though there are still lots of
limitations, this kicks in dozens of times in the 4 specfp2000 benchmarks, 
and hundreds of times in the int part.  It also kicks in hundreds of times 
in multisource.

This kicks in right before loop deletion, which has the pleasant effect of
deleting loops that *just* do a memset.

llvm-svn: 122664
2011-01-01 20:39:18 +00:00
Daniel Dunbar
9ee74282a6 MC/Mach-O/Thumb: Set the thumb bit in the symbol table.
llvm-svn: 122630
2010-12-29 14:14:06 +00:00
Rafael Espindola
d51ed1fc6a Implement cfi_def_cfa. Also don't convert to dwarf reg numbers twice. Looks
like 6 is a fixed point of that and so the previous tests were OK :-)

llvm-svn: 122614
2010-12-29 01:42:56 +00:00
Rafael Espindola
3fdd045643 Implement .cfi_remember_state and .cfi_restore_state.
llvm-svn: 122602
2010-12-28 18:36:23 +00:00
Duncan Sands
87515f1e57 Clarify that InstructionSimplify only returns values that dominate the
original instruction.

llvm-svn: 122601
2010-12-28 18:01:19 +00:00
Duncan Sands
707bdbd129 Small optimization to speed up replacementPreservesLCSSAForm.
llvm-svn: 122600
2010-12-28 18:00:24 +00:00
Rafael Espindola
c97d642bf7 Relax address updates in the eh_frame section.
llvm-svn: 122591
2010-12-28 05:39:27 +00:00
Rafael Espindola
0552cb0638 Start adding basic support for emitting the call frame instructions.
llvm-svn: 122590
2010-12-28 04:15:37 +00:00
Michael J. Spencer
b604751adb Support/Path: Deprecate Path::hasMagicNumber and replace all uses with fs::has_magic.
llvm-svn: 122589
2010-12-28 01:49:21 +00:00
Michael J. Spencer
6d174b7e25 Fix typo.
llvm-svn: 122588
2010-12-28 01:49:10 +00:00
Michael J. Spencer
018595cf3a Support/PathV2: Implement has_magic.
llvm-svn: 122587
2010-12-28 01:49:01 +00:00