1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

35738 Commits

Author SHA1 Message Date
Dan Gohman
074a744147 Change &| to |&.
llvm-svn: 44345
2007-11-27 00:50:57 +00:00
Dan Gohman
dfda7ca2cc Change grep '' to grep {}.
Change 2>&1 | to |&.

llvm-svn: 44344
2007-11-27 00:10:35 +00:00
Dan Gohman
21665f8f17 Don't redirect llvm-as's stderr to llvm-dis.
Change grep '' to grep {}.

llvm-svn: 44343
2007-11-27 00:07:33 +00:00
Dan Gohman
d12155d8c8 Remove unnecessary && from the RUN lines of this test.
llvm-svn: 44342
2007-11-27 00:03:38 +00:00
Dan Gohman
a9f8208852 Don't lower srem/urem X%C to X-X/C*C unless the division is actually
optimized. This avoids creating illegal divisions when the combiner is
running after legalize; this fixes PR1815. Also, it produces better
code in the included testcase by avoiding the subtract and multiply
when the division isn't optimized.

llvm-svn: 44341
2007-11-26 23:46:11 +00:00
Chuck Rose III
57c2305216 Add TGParser files to VStudio project files. Removed generated files section from TableGen project file as it is no longer needed. #Include <algorithm> directly from TGParser.cpp so it can see std::reverse.
llvm-svn: 44340
2007-11-26 23:19:59 +00:00
Owen Anderson
2aa0218a6c Fix another bug that was causing siod to fail.
llvm-svn: 44325
2007-11-26 07:17:19 +00:00
Owen Anderson
8b919de439 Fix a silly bug that Nicholas noticed.
llvm-svn: 44324
2007-11-26 03:27:38 +00:00
Owen Anderson
05275b7b14 Allow GVN to eliminate read-only function calls when it can detect that they are redundant.
llvm-svn: 44323
2007-11-26 02:26:36 +00:00
Anton Korobeynikov
14246a2eba Remove another leak. Due to some reason AliasSetTracker didn't had any dtor...
llvm-svn: 44320
2007-11-25 23:52:02 +00:00
Nick Lewycky
1536b3f230 Add new SCEV, SCEVSMax. This allows LLVM to analyze do-while loops.
llvm-svn: 44319
2007-11-25 22:41:31 +00:00
Chris Lattner
d1e03b5387 Implement PR1822
llvm-svn: 44318
2007-11-25 21:27:53 +00:00
Anton Korobeynikov
b7ee8cdcba Remove a leak. Destroy LoopInfoBase object. releaseMemory() is actually called in its dtor.
llvm-svn: 44317
2007-11-25 18:41:39 +00:00
Duncan Sands
114968a3e8 Fix PR1816. If a bitcast of a function only exists because of a
trivial difference in function attributes, allow calls to it to
be converted to direct calls.  Based on a patch by Török Edwin.
While there, move the various lists of mutually incompatible
parameters etc out of the verifier and into ParameterAttributes.h.

llvm-svn: 44315
2007-11-25 14:10:56 +00:00
Chris Lattner
be0c5a0500 Fix a long standing deficiency in the X86 backend: we would
sometimes emit "zero" and "all one" vectors multiple times,
for example:

_test2:
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M1
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M2
	ret

instead of:

_test2:
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M1
	movq	%mm0, _M2
	ret

This patch fixes this by always arranging for zero/one vectors
to be defined as v4i32 or v2i32 (SSE/MMX) instead of letting them be
any random type.  This ensures they get trivially CSE'd on the dag.
This fix is also important for LegalizeDAGTypes, as it gets unhappy
when the x86 backend wants BUILD_VECTOR(i64 0) to be legal even when
'i64' isn't legal.

This patch makes the following changes:

1) X86TargetLowering::LowerBUILD_VECTOR now lowers 0/1 vectors into
   their canonical types.
2) The now-dead patterns are removed from the SSE/MMX .td files.
3) All the patterns in the .td file that referred to immAllOnesV or
   immAllZerosV in the wrong form now use *_bc to match them with a
   bitcast wrapped around them.
4) X86DAGToDAGISel::SelectScalarSSELoad is generalized to handle 
   bitcast'd zero vectors, which simplifies the code actually.
5) getShuffleVectorZeroOrUndef is updated to generate a shuffle that
   is legal, instead of generating one that is illegal and expecting
   a later legalize pass to clean it up.
6) isZeroShuffle is generalized to handle bitcast of zeros.
7) several other minor tweaks.

This patch is definite goodness, but has the potential to cause random
code quality regressions.  Please be on the lookout for these and let 
me know if they happen.

llvm-svn: 44310
2007-11-25 00:24:49 +00:00
Chris Lattner
424aad9995 Implement expand support for MERGE_VALUEs that only produces one result.
llvm-svn: 44304
2007-11-24 19:12:15 +00:00
Chris Lattner
8a1dfeecab add a immAllZerosV_bc pattern fragment for consistency with others.
llvm-svn: 44303
2007-11-24 19:02:07 +00:00
Chris Lattner
3862759b53 remove bogus assertion that broke CodeGen/Generic/cast-fp.ll on x86
among others.

llvm-svn: 44302
2007-11-24 18:37:20 +00:00
Chris Lattner
c06f8366b4 Implement support for custom legalization in DAGTypeLegalizer::ExpandOperand.
Improve a comment.
Unbreak Duncan's carefully written path compression where I didn't realize
what was happening!

llvm-svn: 44301
2007-11-24 18:11:42 +00:00
Chris Lattner
28262fbaf2 Several changes:
1) Change the interface to TargetLowering::ExpandOperationResult to 
   take and return entire NODES that need a result expanded, not just
   the value.  This allows us to handle things like READCYCLECOUNTER,
   which returns two values.
2) Implement (extremely limited) support in LegalizeDAG::ExpandOp for MERGE_VALUES.
3) Reimplement custom lowering in LegalizeDAGTypes in terms of the new
   ExpandOperationResult.  This makes the result simpler and fully 
   general.
4) Implement (fully general) expand support for MERGE_VALUES in LegalizeDAGTypes.
5) Implement ExpandOperationResult support for ARM f64->i64 bitconvert and ARM
   i64 shifts, allowing them to work with LegalizeDAGTypes.
6) Implement ExpandOperationResult support for X86 READCYCLECOUNTER and FP_TO_SINT,
   allowing them to work with LegalizeDAGTypes.

LegalizeDAGTypes now passes several more X86 codegen tests when enabled and when
type legalization in LegalizeDAG is ifdef'd out.

llvm-svn: 44300
2007-11-24 07:07:01 +00:00
Chris Lattner
9020367ea0 add a note
llvm-svn: 44299
2007-11-24 06:13:33 +00:00
Chris Lattner
6304b1e16d upgrade this test
llvm-svn: 44298
2007-11-24 05:39:29 +00:00
Chris Lattner
36854c740d Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
llvm-svn: 44296
2007-11-23 22:42:31 +00:00
Chris Lattner
cdc6bbd519 simplify some code.
llvm-svn: 44295
2007-11-23 22:36:49 +00:00
Chris Lattner
57a40dc2ad Fix APInt::countTrailingZeros to return BitWidth if the input is zero instead of returning some random large number.
llvm-svn: 44294
2007-11-23 22:36:25 +00:00
Chris Lattner
642ae99085 add a comment.
llvm-svn: 44293
2007-11-23 22:35:18 +00:00
Chris Lattner
f9379ef949 splice some lines together, no functionality change.
llvm-svn: 44292
2007-11-23 22:34:59 +00:00
Chris Lattner
4aab2642b9 !< is >=, not >. Thanks to Max Hailperin for pointing this out!
llvm-svn: 44291
2007-11-23 22:19:33 +00:00
Duncan Sands
265752ae8f Ding dong, the DoesntAccessMemoryFns and
OnlyReadsMemoryFns tables are dead!  We
get more, and more accurate, information
from gcc via the readnone and readonly
function attributes.

llvm-svn: 44288
2007-11-23 19:30:27 +00:00
Duncan Sands
0973ae4c8c Remove some logic I thoughtlessly copied over
from the old ADCE implementation (there it was
correct because the transform was being done
for read-only functions).

llvm-svn: 44287
2007-11-23 09:10:17 +00:00
Chris Lattner
ac2de0424b Fix a bug where we'd try to find a scev value for a bitcast operand,
even though the bitcast operand did not have integer type.  This fixes
PR1814.

llvm-svn: 44286
2007-11-23 08:46:22 +00:00
Chris Lattner
bff48b8f0d Fix PR1817.
llvm-svn: 44284
2007-11-22 23:47:13 +00:00
Chris Lattner
54f0c2bed9 add some static icmpinst predicates.
llvm-svn: 44283
2007-11-22 23:43:29 +00:00
Chris Lattner
59d787cb83 add missing #include
llvm-svn: 44282
2007-11-22 23:19:05 +00:00
Anton Korobeynikov
f46167c649 Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)
llvm-svn: 44281
2007-11-22 22:30:10 +00:00
Duncan Sands
e79932aed4 Turn invokes of nounwind functions into ordinary calls.
llvm-svn: 44280
2007-11-22 22:24:59 +00:00
Duncan Sands
703986d327 Teach alias analysis about readnone/readonly functions.
Based on a patch by Török Edwin.

llvm-svn: 44279
2007-11-22 21:43:27 +00:00
Duncan Sands
6ec98952e0 Readonly/readnone functions are allowed to throw
exceptions, so don't turn invokes of them into
calls.

llvm-svn: 44278
2007-11-22 21:40:06 +00:00
Chris Lattner
192e1e5ae8 resolve the last fixme's in the new tblgen parser.
llvm-svn: 44277
2007-11-22 21:06:59 +00:00
Chris Lattner
ac95162b44 change the Init print methods to return strings, and implement
print in terms of that.

llvm-svn: 44276
2007-11-22 21:05:25 +00:00
Chris Lattner
118519d38d eliminate a bunch of print methods that are duplicate with the getAsString() method.
llvm-svn: 44275
2007-11-22 20:51:34 +00:00
Chris Lattner
c447b7a449 Rewrite the tblgen parser in a recursive descent style, eliminating the bison parser.
This makes the parser much easier to understand, eliminates a ton of global variables,
and gives tblgen nice caret diagnostics.  It is also faster, but tblgen probably doesn't
care about performance.

There are a couple of FIXMEs which I will take care of next.

llvm-svn: 44274
2007-11-22 20:49:04 +00:00
Duncan Sands
d05a55f03f Rename the 'const' parameter attribute to 'readnone',
and the 'pure' parameter attribute to 'readonly'.
Names suggested by DannyB.

llvm-svn: 44273
2007-11-22 20:23:04 +00:00
Nick Lewycky
aff0962501 Instead of calculating constant factors, calculate the number of trailing
bits. Patch from Wojciech Matyjewicz.

llvm-svn: 44268
2007-11-22 07:59:40 +00:00
Nick Lewycky
e34dd3a90f Create nodes for inline asm so that we don't crash looking for the node later.
llvm-svn: 44267
2007-11-22 03:07:37 +00:00
Chuck Rose III
644434c904 Switching back to strtoll. Including config.h. On VStudio builds, this overrides strtoll.
llvm-svn: 44264
2007-11-21 19:36:25 +00:00
Duncan Sands
7a8a7099b1 Fix a bug in which node A is replaced by node B, but later
node A gets back into the DAG again because it was hiding in
one of the node maps: make sure that node replacement happens
in those maps too.

llvm-svn: 44263
2007-11-21 16:43:19 +00:00
Nick Lewycky
a734aa84f3 typo
llvm-svn: 44262
2007-11-21 05:21:54 +00:00
Dale Johannesen
6293438d50 Fix compiler warning.
llvm-svn: 44261
2007-11-21 00:45:00 +00:00
Chuck Rose III
b1944d8afb This change does a couple of things. First it gets the Visual Studio builds working.
I added the lexing files to the VStudio projects and removed the .l files from the 
VStudio projects.  There was a problem with use of strtoll in TGLexer.cpp and Chris
suggested switching to strtol, so that's included here.

Additionally, this checkin adds minimal x64 builds to the VStudio builds.  Build issues
related to x64 in the windows specific files for DynamicLibrary.inc and Singals.inc
are worked around, but not ultimately solved.  Binaries used to be stored in

...\win32\{Debug|Release}

but are now kept in

...\win32\bin\{win32|x64}\{Debug|Release}

intermediate files will continue to be stored in the individual project directories under 
win32.  

Some names will likely change in the future to reflect that the vstudio projects
are no longer 32-bit only, but I wanted to get things up and running today so kept away
from bigger restructuring.

llvm-svn: 44260
2007-11-21 00:37:56 +00:00