Commit Graph

60369 Commits

Author SHA1 Message Date
Dan Gohman
fff6c5332f Add an initial description of a new concept: trap values, and change
the definition of the nsw and nuw flags to make use of it.

nsw was introduced to help optimizers answer yes to the following:

  // Can we change i from i32 to i64 to eliminate the cast inside the loop?
  for (int i = 0; i < n; ++i) A[i] *= 0.1;

  // Can we assume that this loop will eventually terminate?
  for (int i = 0; i <= n; ++i) A[i] *= 0.1;

In its current form, it isn't truly sufficient for either.

In the first case, if the increment overflows, it'll still have some
valid i32 value; sign-extending it will produce a value which is 33
homogeneous sign bits trailed by 31 independent undef bits. If i is
promoted to i64, it won't have those same values when it reaches that
point. (The compiler could recover here by reasoning about how i is
used by the load, but that's a lot more complicated and isn't always
possible.)

In the second case, there is no value for i which will be greater than
n, so having the increment return undef on overflow doesn't help.

Trap values are a formalization of some existing concepts that we have
about LLVM IR, and give the optimizers a better basis for answering yes
to both questions above.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 23:14:21 +00:00
Chris Lattner
60915146f4 refactor the interface to InlineFunction so that most of the in/out
arguments are handled with a new InlineFunctionInfo class.  This 
makes it easier to extend InlineFunction to return more info in the
future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 23:07:58 +00:00
Devang Patel
9517144f53 Remove the test for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 22:06:28 +00:00
Chris Lattner
3a1d4cfc38 add macruby back
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 21:34:16 +00:00
Chris Lattner
b957a5e41e when inlining something like this:
define void @f3(void (i8*)* %__f) ssp {
entry:
  call void %__f(i8* undef)
  unreachable
}

define void @f4(i8* %this) ssp align 2 {
entry:
  call void @f3(void (i8*)* @f2) ssp
  ret void
}

The inliner is turning the indirect call to %__f into a direct
call to F2.  Make the call graph more precise when this happens.

The inliner doesn't revisit call sites introduced by inlining,
so there isn't an easy way to test for this, but a more precise
callgraph is a good thing.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 21:31:00 +00:00
Devang Patel
c04d54527e Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:56:35 +00:00
Dan Gohman
c105a2b5b7 Sink SelectionDAGBuilder's HandlePHINodesInSuccessorBlocks down
into SelectionDAGBuilder itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:55:53 +00:00
Devang Patel
18ee3bb0b7 Adjust debug range offsets for isWeakForLinker() functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:52:00 +00:00
Dan Gohman
9c675f14c1 Add a blurb about the new LSR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102126 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:50:43 +00:00
Nick Lewycky
009364ebcf The -condprop pass has been deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:48:34 +00:00
Dan Gohman
d64d12dfcb The post-RA scheduler is currently off by default on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:47:28 +00:00
Dan Gohman
f81eca0ab9 Move HandlePHINodesInSuccessorBlocks functions out of SelectionDAGISel
and into SelectionDAGBuilder and FastISel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102123 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:46:50 +00:00
Douglas Gregor
f720a4edb0 Add some verbiage about Clang to the 2.7 release notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:42:40 +00:00
Chris Lattner
b61789d4dd add a DEBUG call so that -debug lists when CGSCCPM iterates.
Fix RefreshCallGraph to use CGN->replaceCallEdge instead of hand
rolling its own loop.  replaceCallEdge properly maintains the
reference counts of the nodes, fixing a crash exposed by the
iterative callgraph stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:42:33 +00:00
Chris Lattner
f8b99cb03b eliminate dead #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:41:10 +00:00
Evan Cheng
07c4e1085d - It's not safe to promote rotates (at least not trivially).
- Some code refactoring.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:19:46 +00:00
Dan Gohman
3b172f1c01 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 20:06:42 +00:00
Dan Gohman
620427d5a1 Move PHINodesToUpdate out of SelectionDAGBuilder and into
FunctionLoweringInfo, as it isn't SelectionDAG-specific. This isn't
completely natural, as PHI node state is not per-function but rather
per-basic-block, however there's currently no other convenient
per-basic-block state to group it with.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 19:55:20 +00:00
Devang Patel
f1dabde404 Rename InsnAfterLabelMap and InsnBeforeLabelMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 18:43:35 +00:00
Devang Patel
3547a88b50 Keep track of MCSymbol used to mark beginning of a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 18:39:21 +00:00
Jim Grosbach
41a776631d Add mention of ARM atomic builtin support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 18:33:31 +00:00
Devang Patel
bc655eaee0 At this point Start and End are not null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 18:28:58 +00:00
Jim Grosbach
269e0fed84 Update ARM frame index scavenging description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 18:28:43 +00:00
Chris Lattner
cb28286b7b remove dupe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 18:26:17 +00:00
Chris Lattner
83cd35aff9 reword my incoherent babble into something that makes sense
from Wesley Peck!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102096 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 17:39:38 +00:00
Chris Lattner
fb1a739202 two more projects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 17:28:36 +00:00
Chris Lattner
cd062cd54c add some notes from Matthieu Moy!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 17:25:00 +00:00
Chris Lattner
ca73cea8a2 improve tblgen doc, pointed out by Zhongxing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 16:45:27 +00:00
Wesley Peck
1f433615b4 Fixing a typo in the "Clang project" section of the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 14:19:00 +00:00
Wesley Peck
a0c4484bce Small fix to the "Other Improvements and New Features" section of the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 13:53:54 +00:00
Wesley Peck
c0287baced Fixing small typos in the "New Useful APIs" section of the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 13:50:46 +00:00
Wesley Peck
9e385b1367 Fixing small typos in the "ARM Target Improvements" section of the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 13:43:14 +00:00
Wesley Peck
640604ae63 Rewording the "generated debug information" paragraph in the "Interpreter and JIT Improvements" section of the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102060 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 13:36:27 +00:00
Wesley Peck
68d1fe9700 Reworking the wording of the "target data string" paragraph in the "Optimizer Improvments" section of the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 13:28:34 +00:00
Gabor Greif
ed38745a2a <pre> seems to close <p>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 10:25:23 +00:00
Gabor Greif
ee2187a38d the validator coughed up some problems, most of them fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 10:21:43 +00:00
Gabor Greif
c8b3af9f5f shorten link
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102055 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 10:11:24 +00:00
Chris Lattner
f455529b9e static analyzer has its own section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 06:39:56 +00:00
Chris Lattner
8cdd7939ad add mc and static analyzer blurbs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102053 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 06:38:11 +00:00
Chris Lattner
914ce46040 another checkpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102052 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 06:28:20 +00:00
Chris Lattner
7b91eda0de various updates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 05:41:35 +00:00
Chris Lattner
70745c661d fix file header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 05:33:15 +00:00
Dan Gohman
ddb3eafc32 Don't attempt to analyze values which are obviously undef. This fixes some
assertion failures in extreme cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 01:35:11 +00:00
Dan Gohman
0883355976 Tidy a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 01:30:05 +00:00
Jakob Stoklund Olesen
a063e19593 Run LiveVariables instead of computing liveness locally in -regalloc=fast.
This actually makes everything slower, but the plan is to have isel add <kill>
flags the way it is already adding <dead> flags. Then LiveVariables can be
removed again.

When ignoring the time spent in LiveVariables, -regalloc=fast is now twice as
fast as -regalloc=local.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 23:18:07 +00:00
Evan Cheng
e3dd8550c6 Do not try to optimize a copy that has already been marked for deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 20:57:54 +00:00
Devang Patel
708e474c2f Add command line option to disable debug info printing in .s file. This option does not impact debug info generation and preservation through earlier compile starges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 19:08:53 +00:00
Bob Wilson
b913863a95 Fix a performance problem with the new SSAUpdater. This showed up in the
GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 18:39:03 +00:00
Johnny Chen
c048f1d12c Modified some assert() msg strings; no other functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 18:37:48 +00:00
Jakob Stoklund Olesen
00207237dd Add fast register allocator, enabled with -regalloc=fast.
So far this is just a clone of -regalloc=local that has been lobotomized to run
25% faster. It drops the least-recently-used calculations, and is just plain
stupid when it runs out of registers.

The plan is to make this go even faster for -O0 by taking advantage of the short
live intervals in unoptimized code. It should not be necessary to calculate
liveness when most virtual registers are killed 2-3 instructions after they are
born.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 18:02:42 +00:00