1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

41248 Commits

Author SHA1 Message Date
Bill Wendling
f9a01704af Remove space that was forgotten.`
llvm-svn: 56240
2008-09-16 06:30:47 +00:00
Dan Gohman
37457ca74b Don't take the time to CheckDAGForTailCallsAndFixThem when tail calls
are not enabled. Instead just omit the tail call flag when calls are
created.

llvm-svn: 56235
2008-09-16 01:42:28 +00:00
Dan Gohman
64622ff4d6 Fix spacing in the grep line for this test, following the recent
SCEV-whitespace changes.

llvm-svn: 56234
2008-09-16 01:37:08 +00:00
Dan Gohman
54ef20348e Re-enables the new vector select in the bitcode reader, by modifying the
bitcode reader/writer as follows:

- add and use new bitcode FUNC_CODE_INST_VSELECT to handle the llvm
select opcode using either i1 or [N x i1] as the selector.
- retain old BITCODE FUNC_CODE_INST_SELECT in the bitcode reader to
handle select on i1 for backwards compatibility with existing bitcode
files.
- re-enable the vector-select.ll test program.

Also, rename the recently added bitcode opcode FUNC_CODE_INST_VCMP to
FUNC_CODE_INST_CMP2 and make the bitcode writer use it to handle
fcmp/icmp on scalars or vectors. In the bitcode writer, use
FUNC_CODE_INST_CMP for vfcmp/vicmp only. In the bitcode reader, have
FUNC_CODE_INST_CMP handle icmp/fcmp returning bool, for backwards
compatibility with existing bitcode files.

Patch by Preston Gurd!

llvm-svn: 56233
2008-09-16 01:01:33 +00:00
Dan Gohman
0045cec2ba Teach ScalarEvolution to consider loop preheaders in the search for
an if statement that guards a loop, to allow indvars to avoid smax
operations in more situations.

llvm-svn: 56232
2008-09-15 22:18:04 +00:00
Owen Anderson
553caa6ed4 Live intervals for live-in registers should begin at the beginning of a basic block, not at the first
instruction.  Also, their valno's should have an unknown def.  This has no effect currently, but was
causing issues when StrongPHIElimination was enabled.

llvm-svn: 56231
2008-09-15 22:00:38 +00:00
Dan Gohman
faa15214e0 Teach LSR to optimize away SMAX operations for tripcounts in common
cases.  See the comment above OptimizeSMax for the full story, and
the testcase for an example. This cancels out a pessimization
commonly attributed to indvars, and will allow us to lift some of
the artificial throttles in indvars, rather than add new ones.

llvm-svn: 56230
2008-09-15 21:22:06 +00:00
Devang Patel
b980f023ca Extract optimization pass selection code from llvm-gcc into a separate routine.
This can be used by other stand alone tools, such as 'opt'.

llvm-svn: 56229
2008-09-15 21:13:42 +00:00
Bruno Cardoso Lopes
f6ad396dfa Fixed Bug 2751
http://llvm.org/bugs/show_bug.cgi?id=2751

Abicall was enabled even when static code model was provided 
in the command line.
The correct behavior is to disable abicall when static is
specified.

llvm-svn: 56228
2008-09-15 21:06:55 +00:00
Dan Gohman
f38d63884f Re-enable SelectionDAG CSE for calls. It matters in the case of
libcalls, as in this testcase on ARM.

llvm-svn: 56226
2008-09-15 19:46:03 +00:00
Bruno Cardoso Lopes
5463c59693 Added testcase for bswap allegrexel intrinsic
llvm-svn: 56225
2008-09-15 19:38:11 +00:00
Duncan Sands
1f456b0b4a End of the GlobalsModRef experiment.
llvm-svn: 56222
2008-09-15 18:42:38 +00:00
Dan Gohman
cfe792b491 Update the LLVM polygen grammar for recent language changes:
x86_ssecallcc, function notes, and some whitespace adjustments.

llvm-svn: 56221
2008-09-15 16:10:51 +00:00
Nick Lewycky
d33536e62a Fix documentation for these functions; they do not only modify users within the
block specified by the InstList. Patch by Stefanus Du Toit.

llvm-svn: 56200
2008-09-15 06:31:52 +00:00
Evan Cheng
db1693cb14 Correctly update kill infos after extending a live range and merge 2 val#'s; fix 56165 - do not mark val# copy field if the copy does not define the val#.
llvm-svn: 56199
2008-09-15 06:28:41 +00:00
Nick Lewycky
7ceb1c1d32 Add "sample" documentation to sample project.
This fixes part of PR2793.

llvm-svn: 56198
2008-09-15 05:31:29 +00:00
Dan Gohman
6418cb3998 Fix WriteAsOperand to not emit a leading space character. Adjust
its callers to emit a space character before calling it when a
space is needed.

This fixes several spurious whitespace issues in
ScalarEvolution's debug dumps. See the test changes for
examples.

This also fixes odd space-after-tab indentation in the output
for switch statements, and changes calls from being printed like
this:
  call void @foo( i32 %x )
to this:
  call void @foo(i32 %x)

llvm-svn: 56196
2008-09-14 17:21:12 +00:00
Dale Johannesen
57fc1bdfdc adjust last patch per review feedback
llvm-svn: 56194
2008-09-14 01:44:36 +00:00
Gabor Greif
2c1afeb67b minor correction
llvm-svn: 56190
2008-09-13 18:51:27 +00:00
Dan Gohman
fa32c7c6d9 Remove isImm(), isReg(), and friends, in favor of
isImmediate(), isRegister(), and friends, to avoid confusion
about having two different names with the same meaning. I'm
not attached to the longer names, and would be ok with
changing to the shorter names if others prefer it.

llvm-svn: 56189
2008-09-13 17:58:21 +00:00
Duncan Sands
8d5640ac90 Fix PR2792: treat volatile loads as writing memory somewhere.
Treat stores as reading memory, just to play safe.

llvm-svn: 56188
2008-09-13 12:45:50 +00:00
Evan Cheng
63b98ccd5e Fix random abort.
llvm-svn: 56184
2008-09-13 01:55:59 +00:00
Dan Gohman
3450a8252f Define CallSDNode, an SDNode subclass for use with ISD::CALL.
Currently it just holds the calling convention and flags
for isVarArgs and isTailCall.

And it has several utility methods, which eliminate magic
5+2*i and similar index computations in several places.

CallSDNodes are not CSE'd. Teach UpdateNodeOperands to handle
nodes that are not CSE'd gracefully.

llvm-svn: 56183
2008-09-13 01:54:27 +00:00
Evan Cheng
775a37e4b4 Typo.
llvm-svn: 56182
2008-09-13 01:44:01 +00:00
Evan Cheng
200cdea934 Rely on instruction format to determine so_reg operand for now.
llvm-svn: 56181
2008-09-13 01:38:29 +00:00
Evan Cheng
0a3a595612 Revert 56176. All those instruction formats are still needed.
llvm-svn: 56180
2008-09-13 01:35:33 +00:00
Evan Cheng
1ac0a5f278 Accidentially flipped the condition.
llvm-svn: 56179
2008-09-13 01:29:57 +00:00
Evan Cheng
d68f2947a9 Add debug dumps.
llvm-svn: 56178
2008-09-13 01:15:21 +00:00
Evan Cheng
18fd8337b3 Eliminate unnecessary instruction formats.
llvm-svn: 56176
2008-09-12 23:15:39 +00:00
Evan Cheng
66e7651a16 Addrmode 1 S bit can be dynamically set. Look for CPSR def.
llvm-svn: 56172
2008-09-12 22:45:55 +00:00
Evan Cheng
adf6720626 Rewrite address mode 1 code emission routines.
llvm-svn: 56171
2008-09-12 22:01:15 +00:00
Duncan Sands
ed2eeb11d8 The "alias" keyword comes first.
llvm-svn: 56170
2008-09-12 20:48:21 +00:00
Evan Cheng
07046dae41 On some targets, non-move instructions can become move instructions because of coalescing. e.g.
vr2 = OR vr0, vr1
=>
vr2 = OR vr1, vr1   // after coalescing vr0 with vr1

Update the value# of the destination register with the copy instruction if that happens.

llvm-svn: 56165
2008-09-12 18:13:14 +00:00
Dan Gohman
082879cfde Change ConstantSDNode and ConstantFPSDNode to use ConstantInt* and
ConstantFP* instead of APInt and APFloat directly.

This reduces the amount of time to create ConstantSDNode
and ConstantFPSDNode nodes when ConstantInt* and ConstantFP*
respectively are already available, as is the case in
SelectionDAGBuild.cpp. Also, it reduces the amount of time
to legalize constants into constant pools, and the amount of
time to add ConstantFP operands to MachineInstrs, due to
eliminating ConstantInt::get and ConstantFP::get calls.

It increases the amount of work needed to create new constants
in cases where the client doesn't already have a ConstantInt*
or ConstantFP*, such as legalize expanding 64-bit integer constants
to 32-bit constants. And it adds a layer of indirection for the
accessor methods. But these appear to be outweight by the benefits
in most cases.

It will also make it easier to make ConstantSDNode and
ConstantFPNode more consistent with ConstantInt and ConstantFP.

llvm-svn: 56162
2008-09-12 18:08:03 +00:00
Dale Johannesen
6395da3510 Pass "earlyclobber" bit through to machine
representation; coalescer and RA need to know
about it.  No functional change.

llvm-svn: 56161
2008-09-12 17:49:03 +00:00
Dan Gohman
89660301e3 Rename ConstantSDNode::getValue to getZExtValue, for consistency
with ConstantInt. This led to fixing a bug in TargetLowering.cpp
using getValue instead of getAPIntValue.

llvm-svn: 56159
2008-09-12 16:56:44 +00:00
Duncan Sands
05a3e3ea40 Give GlobalsModRef a whirl in the nightly testers.
I placed it just before GVN because that it is the
pass most likely to benefit from it.  Some quick
and dirty testing confirms that this is a decent
place for it.

llvm-svn: 56144
2008-09-12 08:23:37 +00:00
Duncan Sands
94a4573005 Rather than marking all internal globals "Ref"
when a readonly declaration is called, set a
flag.  This is faster and uses less memory.
In theory it is less accurate, because before
only those internal globals that were read
by someone were being marked "Ref", but now
all are.  But in practice, thanks to other
passes, all internal globals of the kind
considered here will be both read and stored
to: those only read will have been turned
into constants, and those only stored to will
have been deleted.

llvm-svn: 56143
2008-09-12 07:29:58 +00:00
Dale Johannesen
fbc17046ff The sequence for ppcf128 compares was not IEEE
safe in the presence of NaNs.

llvm-svn: 56136
2008-09-12 00:30:56 +00:00
Dan Gohman
0b6d3a9a9b On 64-bit targets, change 32-bit getelementptr indices to be 64-bit
getelementptr indices, inserting an explicit cast if necessary.
This helps expose the sign-extension operation to other optimizations.

llvm-svn: 56133
2008-09-11 23:06:38 +00:00
Dan Gohman
5e154a591d Fix a vectorshuffle instcombine bug introduced by r55995.
Patch by Nicolas Capens!

llvm-svn: 56129
2008-09-11 22:47:57 +00:00
Arnold Schwaighofer
9cfcc68e04 Add indirect tail call (function pointer) examples.
llvm-svn: 56127
2008-09-11 22:24:28 +00:00
Jim Grosbach
a25a322741 udpate header comment: s/VP/VFP/
llvm-svn: 56126
2008-09-11 21:41:29 +00:00
Arnold Schwaighofer
adfb111f10 When tailcallopt is enabled all fastcc calls must have an aligned argument stack size. Add a test case.
llvm-svn: 56119
2008-09-11 20:28:43 +00:00
Evan Cheng
5c7e3783ef Fix PR2748. Avoid coalescing physical register with virtual register which would create illegal extract_subreg. e.g.
vr1024 = extract_subreg vr1025, 1
...
vr1024 = mov8rr AH
If vr1024 is coalesced with AH, the extract_subreg is now illegal since AH does not have a super-reg whose sub-register 1 is AH.

llvm-svn: 56118
2008-09-11 20:07:10 +00:00
Owen Anderson
743d45821a Fix a bug in ANY_EXTEND handling that was breaking 403.gcc on X86-64 in fast isel.
llvm-svn: 56117
2008-09-11 19:44:55 +00:00
Duncan Sands
0a66a0ae55 Fix comment typo.
llvm-svn: 56116
2008-09-11 19:41:10 +00:00
Duncan Sands
39a7ae3d01 Intrinsics don't touch internal global variables
(unless passed one via a parameter), even if they
are IntrWriteMem.

llvm-svn: 56115
2008-09-11 19:35:55 +00:00
Dan Gohman
4ae5fa57b4 Fix a copy+paste bug that Duncan spotted. For several
cases it was still getting lucky and detecting overflow
but it was clearly incorrect.

llvm-svn: 56113
2008-09-11 18:53:02 +00:00
Evan Cheng
99be914c9a Fix PR2783 - coalescer bug. Missing a TargetRegisterInfo::isVirtualRegister check.
llvm-svn: 56112
2008-09-11 18:40:32 +00:00