1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

11210 Commits

Author SHA1 Message Date
Chris Lattner
ab9dc2e37b comment fix.
llvm-svn: 96248
2010-02-15 18:55:04 +00:00
David Greene
4f983d569c Add non-temporal flags and remove an assumption of default arguments.
llvm-svn: 96240
2010-02-15 17:00:31 +00:00
David Greene
0ed0396052 Add non-temporal flags to MachineMemOperand.
llvm-svn: 96226
2010-02-15 16:48:31 +00:00
Duncan Sands
2acaf3609c Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!

llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Chris Lattner
bc3bc62709 Check in the first big step of rewriting DAGISelEmitter to
produce a table based matcher instead of gobs of C++ Code.

Though it's not done yet, the shrinkage seems promising,
the table for the X86 ISel is 75K and still has a lot of 
optimization to come (compare to the ~1.5M of .o generated
the old way, much of which will go away).

The code is currently disabled by default (the #if 0 in
DAGISelEmitter.cpp).  When enabled it generates a dead
SelectCode2 function in the DAGISel Header which will
eventually replace SelectCode.

There is still a lot of stuff left to do, which are
documented with a trail of FIXMEs.

llvm-svn: 96215
2010-02-15 08:04:42 +00:00
Chris Lattner
8e8498ea02 give SDValue an operator->, allowing V->isTargetOpcode() and
many other natural things.

llvm-svn: 96214
2010-02-15 07:11:34 +00:00
Chris Lattner
2b00dd86ae don't make insanely large node numbers for no reason,
packing somewhat densely is better than not.

llvm-svn: 96213
2010-02-15 06:39:31 +00:00
Chris Lattner
eeadc240f2 make PadToColumn return the stream so you can use:
OS.PadToColumn(42) << "foo";

llvm-svn: 96208
2010-02-15 02:17:50 +00:00
Dan Gohman
6c0fdcea5e When restoring a saved insert location, check to see if the saved
insert location has become an "inserted" instruction since the time
it was saved. If so, advance to the first non-"inserted" instruction.

llvm-svn: 96203
2010-02-15 00:21:43 +00:00
Dan Gohman
4d5f3b74e4 In rememberInstruction, if the value being remembered is the
current insertion point, advance the current insertion point.
This avoids a use-before-def situation in a testcase extracted
from clang which is difficult to reduce to a reasonable-sized
regression test.

llvm-svn: 96151
2010-02-14 03:12:47 +00:00
Dan Gohman
8985140f3e Remove a 'protected' keyword, now that SCEVExpander is no longer
intended to be subclassed.

llvm-svn: 96149
2010-02-14 02:47:26 +00:00
Daniel Dunbar
7a1fd21459 MCAssembler: Switch MCAsmFixup to storing MCFixupKind instead of just a size.
llvm-svn: 96094
2010-02-13 09:28:54 +00:00
Daniel Dunbar
8e9044353a MCAssembler: Sink fixup list into MCDataFragment.
llvm-svn: 96093
2010-02-13 09:28:43 +00:00
Daniel Dunbar
95ae012b0e MCAssembler: Switch MCFillFragment to only taking constant values. Symbolic expressions can always be emitted as data + fixups.
llvm-svn: 96092
2010-02-13 09:28:32 +00:00
Daniel Dunbar
481e926468 MCAssembler: Start applying fixups in the data section.
llvm-svn: 96090
2010-02-13 09:28:15 +00:00
Daniel Dunbar
a699e834fb MCAssembler: Add assorted dump() methods.
llvm-svn: 96089
2010-02-13 09:28:03 +00:00
Evan Cheng
6eb7ff5bbf Teach MachineFrameInfo to track maximum alignment while stack objects are being
created. This ensures it's updated at all time. It means targets which perform
dynamic stack alignment would know whether it is required and whether frame
pointer register cannot be made available register allocation.
This is a fix for rdar://7625239. Sorry, I can't create a reasonably sized test
case.

llvm-svn: 96069
2010-02-13 01:56:41 +00:00
Dan Gohman
1e93b1c022 Override dominates and properlyDominates for SCEVAddRecExpr, as a
SCEVAddRecExpr doesn't necessarily dominate blocks merely dominated
by all of its operands. This fixes an abort compiling 403.gcc.

llvm-svn: 96056
2010-02-13 00:19:39 +00:00
Chris Lattner
946403d05f give MCCodeEmitters access to the current MCContext.
llvm-svn: 96038
2010-02-12 23:12:47 +00:00
Bob Wilson
881d06c0b9 Fix a comment typo.
llvm-svn: 96027
2010-02-12 22:34:54 +00:00
Chris Lattner
2a0d9140f5 doxygenize some comments, patch by Peter Collingbourne!
llvm-svn: 96018
2010-02-12 21:54:28 +00:00
Chris Lattner
2265d6280b Add support for a union type in LLVM IR. Patch by Talin!
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Anton Korobeynikov
7073515c86 Cleanup stdcall / fastcall name mangling.
This should fix alot of problems we saw so far, e.g. PRs 5851 & 2936

llvm-svn: 95980
2010-02-12 15:28:40 +00:00
Dan Gohman
c40eb525ad Reapply the new LoopStrengthReduction code, with compile time and
bug fixes, and with improved heuristics for analyzing foreign-loop
addrecs.

This change also flattens IVUsers, eliminating the stride-oriented
groupings, which makes it easier to work with.

llvm-svn: 95975
2010-02-12 10:34:29 +00:00
Bob Wilson
2fd80c3d94 Add a new pass on machine instructions to optimize away PHI cycles that
reduce down to a single value.  InstCombine already does this transformation
but DAG legalization may introduce new opportunities.  This has turned out to
be important for ARM where 64-bit values are split up during type legalization:
InstCombine is not able to remove the PHI cycles on the 64-bit values but
the separate 32-bit values can be optimized.  I measured the compile time 
impact of this (running llc on 176.gcc) and it was not significant.

llvm-svn: 95951
2010-02-12 01:30:21 +00:00
Charles Davis
d69c12ecc6 Add a new function attribute, 'alignstack'. It will indicate (when the backends
implement support for it) that the stack should be forcibly realigned in the
prologue (and the process reversed in the epilogue).

llvm-svn: 95945
2010-02-12 00:31:15 +00:00
Chris Lattner
144a1b7a24 add a new MCInstPrinter::getOpcodeName interface, when it is
implemented, llvm-mc --show-inst now uses it to print the
instruction opcode as well as the number.

llvm-svn: 95929
2010-02-11 22:39:10 +00:00
Daniel Dunbar
3ee9e4a9a5 MC: Move assembler-backend's fixup list into the fragment.
llvm-svn: 95926
2010-02-11 21:29:46 +00:00
Daniel Dunbar
fa324dd09b MC: Move MCSectionData::Fixup out to MCAsmFixup.
llvm-svn: 95925
2010-02-11 21:29:29 +00:00
Chris Lattner
b82b965968 make getFixupKindInfo return a const reference, allowing
the tables to be const.  Teach MCCodeEmitter to handle
the target-indep kinds so that we don't crash on them.

llvm-svn: 95924
2010-02-11 21:27:18 +00:00
Chris Lattner
63870006bf refactor x86 conditional branches to use a multipattern
that generates the 1-byte and 4-byte immediate versions
from one definition.

llvm-svn: 95902
2010-02-11 19:31:22 +00:00
Jeffrey Yasskin
ad23983452 Fix some of the memcheck errors found in the JIT unittests.
llvm-svn: 95856
2010-02-11 06:41:30 +00:00
Mon P Wang
c17e781f35 The previous fix of widening divides that trap was too fragile as it depends on custom
lowering and requires that certain types exist in ValueTypes.h.  Modified widening to
check if an op can trap and if so, the widening algorithm will apply only the op on
the defined elements.  It is safer to do this in widening because the optimizer can't
guarantee removing unused ops in some cases.

llvm-svn: 95823
2010-02-10 23:37:45 +00:00
Dale Johannesen
98ed32c3d7 Allow isDebug inquiry on any MO.
llvm-svn: 95818
2010-02-10 23:03:20 +00:00
Chris Lattner
5f5bb8b16d add a virtual dtor to MCTargetExpr, hopefully silencing some warnings.
llvm-svn: 95810
2010-02-10 21:37:31 +00:00
Dan Gohman
f2323826d2 Add a hook to AssemblyAnnotationWriter to allow custom info comments
to be printed, in place of the familiar "uses=" comments.

llvm-svn: 95798
2010-02-10 20:41:46 +00:00
Dan Gohman
ec527fddf4 Use doxygen comment syntax.
llvm-svn: 95797
2010-02-10 20:23:33 +00:00
Dan Gohman
efb42fa7c7 Fix several comments which had previously been "the the" where a
different word was intended.

llvm-svn: 95795
2010-02-10 20:04:19 +00:00
Dan Gohman
92b6122204 Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Dan Gohman
fd8f55bc9e Minor code simplification.
llvm-svn: 95780
2010-02-10 15:54:22 +00:00
Dan Gohman
2dd0d36f14 Implement operators |=, &=, and ^= for SmallBitVector, and remove the
restriction in BitVector for |= and ^= that the operand must be the
same length.

llvm-svn: 95768
2010-02-10 05:54:04 +00:00
Daniel Dunbar
d2035fb242 MC: Switch MCFixup to just hold an MCExpr pointer instead of index into the
MCInst it came from.

llvm-svn: 95767
2010-02-10 04:47:08 +00:00
Daniel Dunbar
50b2609956 Fix a signed comparison warning.
llvm-svn: 95766
2010-02-10 04:46:51 +00:00
Chris Lattner
aed1ea28cf "fixup" a comment.
llvm-svn: 95754
2010-02-10 01:46:47 +00:00
Daniel Dunbar
75df429af0 llvm-mc: Remove --show-fixups and always show as part of --show-encoding.
Also, fix a silly memory leak.

llvm-svn: 95752
2010-02-10 01:41:14 +00:00
Chris Lattner
72156036b9 fix a layering violation: VirtRegRewriter.cpp shouldn't use AsmPrinter.h.
llvm-svn: 95748
2010-02-10 01:23:18 +00:00
Chris Lattner
70fd490fa2 Stop MachineInstr.h from #including AsmPrinter.h
llvm-svn: 95741
2010-02-10 01:04:16 +00:00
Chris Lattner
db4b4d819d Move verbose asm instruction comments to using MCStreamer.
The major win of this is that the code is simpler and they 
print on the same line as the instruction again:

        movl    %eax, 96(%esp)          ## 4-byte Spill
        movl    96(%esp), %eax          ## 4-byte Reload
        cmpl    92(%esp), %eax          ## 4-byte Folded Reload
        jl      LBB7_86

llvm-svn: 95738
2010-02-10 00:47:53 +00:00
Dale Johannesen
da728faa59 more comment updates
llvm-svn: 95736
2010-02-10 00:44:23 +00:00
Dale Johannesen
59679b7966 Add isDebug argument to ChangeToRegister; this prevents
the field from being used uninitialized later in some cases.

llvm-svn: 95735
2010-02-10 00:41:49 +00:00
Chris Lattner
ca01d26903 Add ability for MCInstPrinters to add comments for instructions.
Enhance the x86 backend to show the hex values of immediates in
comments when they are large.  For example:

        movl    $1072693248, 4(%esp)    ## imm = 0x3FF00000

llvm-svn: 95728
2010-02-10 00:10:18 +00:00
Daniel Dunbar
1b050afd4e llvm-mc: Add --show-fixups option, for displaying the instruction fixup information in the asm comments.
llvm-svn: 95710
2010-02-09 23:00:14 +00:00
Daniel Dunbar
ddfda89472 MC: First cut at MCFixup, for getting fixup/relocation information out of an MCCodeEmitter.
llvm-svn: 95708
2010-02-09 22:59:55 +00:00
Chris Lattner
7acf9be6c4 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.

llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Jeffrey Yasskin
42bf811d65 Add support for TypeBuilder<const/volatile void*, false>.
Thanks to Jochen Wilhelmy for the suggestion!

llvm-svn: 95677
2010-02-09 19:07:19 +00:00
Eric Christopher
871cf7bce2 Pull these back out, they're a little too aggressive and time
consuming for a simple optimization.

llvm-svn: 95671
2010-02-09 17:29:18 +00:00
Dan Gohman
4346bb14f7 Mention IndVarSimplify in the comment by getSmallConstantTripCount, as
is done for getTripCount.

llvm-svn: 95666
2010-02-09 17:00:40 +00:00
Dan Gohman
3e13fc968d Mention vAny and iPTRAny in a comment.
llvm-svn: 95665
2010-02-09 16:59:14 +00:00
Dale Johannesen
3f7ce68506 Debug operands should not be def or kill.
llvm-svn: 95632
2010-02-09 00:42:08 +00:00
Lang Hames
91b4cae53c Changed the definition of an "invalid" slot to include the empty & tombstone values, but not zero.
llvm-svn: 95631
2010-02-09 00:41:23 +00:00
Chris Lattner
c0d3e6c90d stop using reserved identifiers.
llvm-svn: 95630
2010-02-09 00:40:07 +00:00
Eric Christopher
428b385575 Add a new pass to do llvm.objsize lowering using SCEV.
Initial skeleton and SCEVUnknown lowering implemented,
the rest should come relatively quickly.  Move testcase
to new directory.

Move pass to right before SimplifyLibCalls - which is
moved down a bit so we can take advantage of a few opts.

llvm-svn: 95628
2010-02-09 00:35:38 +00:00
Dan Gohman
71551e837f Add explicit keywords.
llvm-svn: 95626
2010-02-09 00:29:29 +00:00
Chris Lattner
4d97e42ba6 enhance bits_storage to work with enums by using a c-style
cast instead of reinterpret_cast, fixing PR6243.  Apparently
reinterpret_cast and I aren't getting along today.

llvm-svn: 95622
2010-02-09 00:05:45 +00:00
Dan Gohman
30845777be Document that MCExpr::Mod is actually remainder.
Document that MCExpr::Div, Mod, and the comparison operators are all
signed operators.

Document that the comparison operators' results are target-dependent.

Document that the behavior of shr is target-dependent.

llvm-svn: 95619
2010-02-08 23:58:47 +00:00
Sean Callanan
dee7f5dcd4 Added header file declarations and .exports entries
for the new APIs offered by the enhanced disassembler
for inspecting operands.

llvm-svn: 95606
2010-02-08 23:34:25 +00:00
Chris Lattner
32fa6adff6 now that @GOTOFF is no longer represented as a suffix on a
MCSymbol, we can remove the 'suffix' argument of 
GetBlockAddressSymbol.  Do so.

llvm-svn: 95601
2010-02-08 23:10:08 +00:00
Chris Lattner
39d41535ad don't make hte dtor private or we can't construct the class.
llvm-svn: 95587
2010-02-08 22:07:36 +00:00
Chris Lattner
da4372a3c2 use a c-style cast instead of reinterpret-cast, as sometimes the
cast needs to adjust for a vtable pointer when going from base to
derived type (when the base doesn't have a vtable but the
derived type does).

llvm-svn: 95585
2010-02-08 22:05:38 +00:00
Dan Gohman
30a32bc593 Add const qualifiers.
llvm-svn: 95582
2010-02-08 22:00:06 +00:00
Dan Gohman
f45b7c6795 Rename the PerformTailCallOpt variable to GuaranteedTailCallOpt to reflect
its current purpose.

llvm-svn: 95564
2010-02-08 20:27:50 +00:00
Chris Lattner
b3fe7597f5 add scaffolding for target-specific MCExprs.
llvm-svn: 95559
2010-02-08 19:41:07 +00:00
Duncan Sands
983b171d40 Flesh out the list of predicates, for those who like this style. I was
looking for isPointer, and added the rest for uniformity.

llvm-svn: 95557
2010-02-08 19:36:51 +00:00
Daniel Dunbar
e56fb57d08 ImmutableIntervalMap: Fix for unqualified lookup into dependent base class, done
by clang's -fixit! :)

llvm-svn: 95551
2010-02-08 18:08:46 +00:00
Dale Johannesen
05cffb66ae Add a Debug bit to MachineOperand, for uses that
are from debug info.  Add an iterator to MachineRegisterInfo
to skip Debug operands when walking the use list.  No
functional change yet.

llvm-svn: 95473
2010-02-06 02:28:32 +00:00
Jakob Stoklund Olesen
83ebc265b3 Reintroduce the InlineHint function attribute.
This time it's for real! I am going to hook this up in the frontends as well.

The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.

We need some experiments to determine if that is the right thing to do.

llvm-svn: 95466
2010-02-06 01:16:28 +00:00
Devang Patel
102b8a3103 Set DW_AT_artificial only if argument is marked as artificial.
llvm-svn: 95461
2010-02-06 01:02:37 +00:00
Jakob Stoklund Olesen
039cd8ab3a Update CodeMetrics to count 'big' function calls explicitly.
llvm-svn: 95453
2010-02-05 23:21:18 +00:00
Jakob Stoklund Olesen
670458b3be Teach SimplifyCFG about magic pointer constants.
Weird code sometimes uses pointer constants other than null. This patch
teaches SimplifyCFG to build switch instructions in those cases.

Code like this:

void f(const char *x) {
  if (!x)
    puts("null");
  else if ((uintptr_t)x == 1)
    puts("one");
  else if (x == (char*)2 || x == (char*)3)
    puts("two");
  else if ((intptr_t)x == 4)
    puts("four");
  else
    puts(x);
}

Now becomes a switch:

define void @f(i8* %x) nounwind ssp {
entry:
  %magicptr23 = ptrtoint i8* %x to i64            ; <i64> [#uses=1]
  switch i64 %magicptr23, label %if.else16 [
    i64 0, label %if.then
    i64 1, label %if.then2
    i64 2, label %if.then9
    i64 3, label %if.then9
    i64 4, label %if.then14
  ]

Note that LLVM's own DenseMap uses magic pointers.

llvm-svn: 95439
2010-02-05 22:03:18 +00:00
Jeffrey Yasskin
1604115c5a Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.
llc.cpp also defined these flags, meaning that when I linked all of LLVM's
libraries into a single shared library, llc crashed on startup with duplicate
flag definitions.  This patch passes them through the EngineBuilder into
JIT::selectTarget().

llvm-svn: 95390
2010-02-05 16:19:36 +00:00
Daniel Dunbar
96bc973155 MC: Change default comment column to 40 characters.
llvm-svn: 95378
2010-02-05 07:32:18 +00:00
Evan Phoenix
a44be8b7f3 Disable external stubs for X86-32 and X86-64
Instruction selection for X86 now can choose an instruction
sequence that will fit any address of any symbol, no matter
the pointer width. X86-64 uses a mov+call-via-reg sequence
for this.

llvm-svn: 95323
2010-02-04 19:56:59 +00:00
Chris Lattner
e43007d443 add support for the sparcv9-*-* target triple to turn on
64-bit sparc codegen.  Patch by Nathan Keynes!

llvm-svn: 95293
2010-02-04 06:34:01 +00:00
Dan Gohman
be6cf8cfb0 Change the argument to getIntegerSCEV to be an int64_t, rather
than int. This will make it more convenient for LSR, which does
a lot of things with int64_t offsets.

llvm-svn: 95281
2010-02-04 02:43:51 +00:00
Sean Callanan
7662f4139b Filled in a few new APIs for the enhanced
disassembly library that provide access to
instruction information, and fixed ambiguous
wording in the comments for the header.

llvm-svn: 95274
2010-02-04 01:43:08 +00:00
Devang Patel
83d905f82b Provide interface to identifiy artificial methods.
llvm-svn: 95240
2010-02-03 19:57:19 +00:00
Jeffrey Yasskin
92abe5abcc r94686 changed all ModuleProvider parameters to Modules, which made the
1-argument ExecutionEngine::create(Module*) ambiguous with the signature that
used to be ExecutionEngine::create(ModuleProvider*, defaulted_params).  Fixed
by removing the 1-argument create().  Fixes PR6221.

llvm-svn: 95236
2010-02-03 19:18:04 +00:00
Daniel Dunbar
d997cd69cd llvm-mc: Add --show-inst option, for showing the MCInst inline with the assembly
output.

llvm-svn: 95227
2010-02-03 18:18:30 +00:00
Zhongxing Xu
bbb98cd401 Remove redundant declaration.
llvm-svn: 95213
2010-02-03 09:05:21 +00:00
Zhongxing Xu
07020ea237 Add constructors.
llvm-svn: 95212
2010-02-03 09:04:11 +00:00
Chris Lattner
837d242070 make MachineModuleInfoMachO hold non-const MCSymbol*'s instead
of const ones.  non-const ones aren't very useful, because you can't
even, say, emit them.

llvm-svn: 95205
2010-02-03 06:18:30 +00:00
Chris Lattner
e8811c3222 change addPassesToEmitFile to return true on failure instead of its input,
add -filetype=null for performance testing and remove -filetype=dynlib,
which isn't planned to be implemented.

llvm-svn: 95202
2010-02-03 05:55:08 +00:00
Jeffrey Yasskin
853eeb0db1 Reconfigure with autoconf-2.60, and fix autoconf.ac to work with that version.
llvm-svn: 95191
2010-02-03 02:11:49 +00:00
Chris Lattner
a64be6d665 privatize a bunch of methods and move \n printing into them.
llvm-svn: 95186
2010-02-03 01:46:05 +00:00
Chris Lattner
78f57ac8dc Hook up -filetype=obj through the MachO streamer. Here's a demo:
$ cat t.ll 
@g = global i32 42
$ llc t.ll -o t.o -filetype=obj
$ nm t.o
00000000 D _g

There is still a ton of work left.  Instructions are not being encoded
yet apparently.

llvm-svn: 95162
2010-02-02 23:57:42 +00:00
Evan Cheng
9057fea7ef Revert 95130.
llvm-svn: 95160
2010-02-02 23:55:14 +00:00
Chris Lattner
643f2f9bc4 refactor code so that LLVMTargetMachine creates the asmstreamer and
mccontext instead of having AsmPrinter do it.  This allows other 
types of MCStreamer's to be passed in.

llvm-svn: 95155
2010-02-02 23:37:42 +00:00
Chris Lattner
7dd4ad3ced Remove a bunch of stuff around the edges of the ELF writer.
Now the only use of the ELF writer is the JIT, which won't be
easy to fix in the short term. :( :(

llvm-svn: 95148
2010-02-02 22:31:11 +00:00
Daniel Dunbar
eb0b81040a MC/Mach-O: Set SOME_INSTRUCTIONS bit for sections.
llvm-svn: 95135
2010-02-02 21:44:01 +00:00
Chris Lattner
21bcba21e7 eliminate all the dead addSimpleCodeEmitter implementations.
eliminate random "code emitter" stuff in Alpha, except for
the JIT path.  Next up, remove the template cruft.

llvm-svn: 95131
2010-02-02 21:31:47 +00:00