Dan Gohman
63dab69b36
Instead of requiring TLI.LowerCallTo to return an ISD::BUILD_PAIR,
...
use ISD::EXTRACT_ELEMENT. SelectionDAG has a special fast-path for
the cast of an EXTRACT_ELEMENT with a BUILD_PAIR operand, for the
common case.
llvm-svn: 69948
2009-04-24 02:40:23 +00:00
Sanjiv Gupta
f1177e1be7
Allow i16 type indices to gep.
...
llvm-svn: 69946
2009-04-24 02:37:54 +00:00
Dan Gohman
9d13b714f5
Factor out a bit of code that appears in several places into a
...
utility function.
llvm-svn: 69937
2009-04-23 23:13:24 +00:00
Dan Gohman
313018c1d3
Handle Void types in ComputeValueVTs. This doesn't currently occur,
...
but this change makes the code more general and easier to adapt for
new purposes.
llvm-svn: 69935
2009-04-23 22:50:03 +00:00
Dan Gohman
46ab8008a8
Fix spurious indentation in a comment.
...
llvm-svn: 69934
2009-04-23 22:41:05 +00:00
Evan Cheng
ff776c8193
Update comments.
...
llvm-svn: 69919
2009-04-23 20:39:31 +00:00
Evan Cheng
f20fb20367
Fix an obvious type.
...
llvm-svn: 69918
2009-04-23 20:18:13 +00:00
Dan Gohman
c0f47d6ec1
Change SCEVExpander's expandCodeFor to provide more flexibility
...
with the persistent insertion point, and change IndVars to make
use of it. This fixes a bug where IndVars was holding on to a
stale insertion point and forcing the SCEVExpander to continue to
use it.
This fixes PR4038.
llvm-svn: 69892
2009-04-23 15:16:49 +00:00
Sanjiv Gupta
0457bf4420
Banksel immediate constant will always immediately follow the GA/ES, so scan an insn from beginnin to find out the banksel operand.
...
llvm-svn: 69883
2009-04-23 10:34:58 +00:00
Nick Lewycky
32cfba44df
Simplify trunc(extend(x)) in SCEVs, just for completeness. Also fix some odd
...
whitespace in the same file.
llvm-svn: 69870
2009-04-23 05:15:08 +00:00
Dan Gohman
6a4629e856
Add support for printing MO_ExternalSymbol operands in
...
memory operand tuples. This doesn't ever come up in normal
code however.
llvm-svn: 69848
2009-04-23 00:57:37 +00:00
Evan Cheng
bdfff0ba69
Make sure both operands have binary instructions have the same type.
...
llvm-svn: 69844
2009-04-22 23:39:28 +00:00
Evan Cheng
faa208ae5f
A few more places where the check of use_empty is needed.
...
llvm-svn: 69842
2009-04-22 23:09:16 +00:00
Evan Cheng
2af546d5fa
Avoid deferencing use_begin() if value does not have a use.
...
llvm-svn: 69836
2009-04-22 22:45:37 +00:00
Devang Patel
7daece3796
Fix cut-n-pasto.
...
llvm-svn: 69816
2009-04-22 18:51:05 +00:00
Dan Gohman
d6edb69103
Simplify trivial cast-of-cast SCEVs.
...
llvm-svn: 69809
2009-04-22 16:20:48 +00:00
Dan Gohman
0ab6ecf6a1
SCEVExpander's InsertCastOfTo knows how to move existing cast
...
instructions in order to avoid inserting new ones. However, if
the cast instruction is the SCEVExpander's InsertPt, this
causes subsequently emitted instructions to be inserted near
the cast, and not at the location of the original insert point.
Fix this by adjusting the insert point in such cases.
This fixes PR4009.
llvm-svn: 69808
2009-04-22 16:11:16 +00:00
Dan Gohman
471996598f
Use BasicBlock::iterator instead of Instruction* for insert points,
...
to better handle inserting instructions at the end of a block.
llvm-svn: 69807
2009-04-22 16:05:50 +00:00
Sanjiv Gupta
60c6705684
Make the function begin label start after ther data pointer.
...
The address of data frame for function can be obtained by subtracting 2 from the function begin label.
llvm-svn: 69801
2009-04-22 12:02:36 +00:00
Owen Anderson
309568c469
Real fix for PR3549, by using caching for predecessor counts in addition to the predecessors themselves. This halves the time
...
to optimize the testcase, beyond what my previous patch did.
llvm-svn: 69792
2009-04-22 08:50:12 +00:00
Owen Anderson
b36babc111
Use PredIteratorCache in LCSSA, which gives a 37% overall speedup on the testcase from PR3549. More improvements to come.
...
llvm-svn: 69788
2009-04-22 08:09:13 +00:00
Chris Lattner
60c88b66da
use predicate instead of hand-rolled loop
...
llvm-svn: 69752
2009-04-21 23:37:18 +00:00
Dan Gohman
4cb9d25f4a
De-pImpl-ify ScalarEvolution. The pImpl pattern doesn't provide much
...
practical benefit in the case of ScalarEvolution, and it's otherwise
a nuisance.
llvm-svn: 69749
2009-04-21 23:15:49 +00:00
Evan Cheng
a36c6c6819
It has finally happened. Spiller is now using live interval info.
...
This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue.
llvm-svn: 69743
2009-04-21 22:46:52 +00:00
Dan Gohman
19990f2310
When turning (ashr(shl(x, n), n)) into sext(trunc(x)), the width of the
...
type to truncate to should be the number of bits of the value that are
preserved, not the number that are clobbered with sign-extension.
This fixes regressions in ldecod.
llvm-svn: 69704
2009-04-21 20:18:36 +00:00
Chris Lattner
95aad4d625
fix a crash on a pointless but valid zero-length memset, rdar://6808691
...
llvm-svn: 69680
2009-04-21 16:52:12 +00:00
Anton Korobeynikov
b53ac333d7
Silence warnings.
...
Patch by Jay Foad!
llvm-svn: 69679
2009-04-21 16:04:56 +00:00
Anton Korobeynikov
0a64083f49
Drop obsolete reference to __eprintf.
...
Patch by Jay Foad!
llvm-svn: 69678
2009-04-21 16:04:41 +00:00
Duncan Sands
58c9c564a9
Get rid of what looks like a copy-and-pasted typo.
...
Spotted by gcc-4.5.
llvm-svn: 69673
2009-04-21 09:44:39 +00:00
Rafael Espindola
5adc7ad39e
TLS_addr64 and TLS_addr32 define RDI and EAX. They don't use them.
...
This fixes PR4002.
llvm-svn: 69672
2009-04-21 08:22:09 +00:00
Sanjiv Gupta
30ea654901
Handle direct aggregate type arguments.
...
llvm-svn: 69665
2009-04-21 05:54:51 +00:00
Dan Gohman
5cf1e72db9
Teach ScalarEvolution how to recognize zext-inreg and sext-inreg,
...
as they appear in LLVM IR. This isn't particularly interesting
on its own; this is just setting up some infrastructure.
llvm-svn: 69655
2009-04-21 02:26:00 +00:00
Dan Gohman
f920d0a020
This FIXME is fixed, now that SCEV understands pointers.
...
llvm-svn: 69651
2009-04-21 01:41:18 +00:00
Dan Gohman
4e3e945880
Factor out a common base class from SCEVTruncateExpr, SCEVZeroExtendExpr,
...
and SCEVSignExtendExpr.
llvm-svn: 69649
2009-04-21 01:25:57 +00:00
Dan Gohman
2f8d813b3a
Usage getAnalysisToUpdate for TargetData, per PR760.
...
llvm-svn: 69645
2009-04-21 01:11:19 +00:00
Dan Gohman
55d8490e7b
Introduce encapsulation for ScalarEvolution's TargetData object, and refactor
...
the code to minimize dependencies on TargetData.
llvm-svn: 69644
2009-04-21 01:07:12 +00:00
Dan Gohman
5665fdf2e3
Move some assertion checks so they can do more complete checking.
...
llvm-svn: 69643
2009-04-21 00:55:22 +00:00
Dan Gohman
dd1bfdc7b1
Convert ScalarEvolution to use raw_ostream instead of OStream.
...
llvm-svn: 69640
2009-04-21 00:47:46 +00:00
Devang Patel
d679dbbacc
Fix Visual Studio 2008 build failure.
...
Patch by Marius Wachtler
llvm-svn: 69637
2009-04-21 00:08:56 +00:00
Dan Gohman
de72d5129b
Make X86's copyRegToReg able to handle copies to and from subclasses.
...
This makes the extra copyRegToReg calls in ScheduleDAGSDNodesEmit.cpp
unnecessary. Derived from a patch by Jakob Stoklund Olesen.
llvm-svn: 69635
2009-04-20 22:54:34 +00:00
Dan Gohman
69fa329052
Simplify this code. getConstant knows how to make
...
broadcasted vector constants.
llvm-svn: 69634
2009-04-20 22:51:43 +00:00
Dale Johannesen
a263eac5f8
Adjust loop size estimate for full unrolling;
...
GEP's don't usually become instructions.
llvm-svn: 69631
2009-04-20 22:19:33 +00:00
Daniel Dunbar
024320d274
Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:
...
clang: error: unable to make temporary file: /etc/cc: can't make
unique filename: Permission denied
instead of
clang: error: unable to make temporary file: /etc/cc: can't make
unique filenamePermission denied
for example.
Also, audited the uses of MakeErrMsg to make the prefix strings
consistent (not end with newline/punctuation/space/": ").
llvm-svn: 69626
2009-04-20 20:50:13 +00:00
Daniel Dunbar
6326c97515
Remove unused variable.
...
llvm-svn: 69624
2009-04-20 20:34:38 +00:00
Bob Wilson
f7e9ff1d28
Move duplicated AddLiveIn function from X86 and ARM backends to be a method
...
in the MachineFunction class, renaming it to addLiveIn for consistency with
the same method in MachineBasicBlock. Thanks for Anton for suggesting this.
llvm-svn: 69615
2009-04-20 18:36:57 +00:00
Devang Patel
64cae580dc
Match C backend only if it explicitly requested.
...
llvm-svn: 69613
2009-04-20 18:07:22 +00:00
Bob Wilson
840cf4fa18
Revise my previous change 68996 as suggested by Duncan.
...
llvm-svn: 69607
2009-04-20 17:27:09 +00:00
Evan Cheng
e6a6c3a70c
- Remove an arbitrary spill weight tweak that should not have been there.
...
- Find more reloads from SS.
llvm-svn: 69606
2009-04-20 17:23:48 +00:00
Sanjiv Gupta
44b55dc966
Emit the auto variables of a function into a different section than parameters.
...
llvm-svn: 69605
2009-04-20 16:59:35 +00:00
Dan Gohman
a9985913d7
It's not necessary for PrintModulePass to flush the output streams
...
now that errs() is properly non-buffered.
llvm-svn: 69602
2009-04-20 16:26:25 +00:00