Chris Lattner
ba567fa77b
split TargetInstrDesc out into its own header file.
...
llvm-svn: 45696
2008-01-07 07:33:08 +00:00
Chris Lattner
f83aae613c
rename TargetInstrDescriptor -> TargetInstrDesc.
...
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.
llvm-svn: 45695
2008-01-07 07:27:27 +00:00
Chris Lattner
c9e870d7c6
remove a dead method.
...
llvm-svn: 45694
2008-01-07 06:47:10 +00:00
Chris Lattner
e78ce25794
simplify some code.
...
llvm-svn: 45693
2008-01-07 06:47:00 +00:00
Chris Lattner
57e851edfe
Rename all the M_* flags to be namespace qualified enums, and switch
...
all clients over to using predicates instead of these flags directly.
These are now private values which are only to be used to statically
initialize the tables.
llvm-svn: 45692
2008-01-07 06:42:05 +00:00
Chris Lattner
e83299018e
use predicate.
...
llvm-svn: 45691
2008-01-07 06:37:29 +00:00
Chris Lattner
c745aa59b3
add more and significantly better comments to the rest of the machineinstr
...
flags that can be set. Add predicates for the ones lacking it, and switch
some clients over to using the predicates instead of Flags directly.
llvm-svn: 45690
2008-01-07 06:21:53 +00:00
Chris Lattner
18038a0aac
simplify some code using new predicates
...
llvm-svn: 45689
2008-01-07 05:40:58 +00:00
Chris Lattner
1cdb8f4da1
add some mroe comments, add a isImplicitDef() method, add
...
isConditionalBranch() and isUnconditionalBranch() methods.
llvm-svn: 45688
2008-01-07 05:38:38 +00:00
Chris Lattner
9b987de2c5
rename hasVariableOperands() -> isVariadic(). Add some comments.
...
Evan, please review the comments I added to getNumDefs to make sure
that they are accurate, thx.
llvm-svn: 45687
2008-01-07 05:19:29 +00:00
Chris Lattner
b0e50db817
Move M_* flags down in the file. Move SchedClass up in the
...
TargetInstrDescriptor class and shrink to 16-bits, saving a
word in TargetInstrDescriptor. Add some comments.
llvm-svn: 45686
2008-01-07 05:06:49 +00:00
Chris Lattner
354275d0b2
remove a dead field.
...
llvm-svn: 45685
2008-01-07 04:57:42 +00:00
Chris Lattner
26171363b9
the name field of instructions is never set to a non-empty string,
...
just unconditionally use the def name of the instruction.
llvm-svn: 45684
2008-01-07 04:57:31 +00:00
Chris Lattner
4421b821f5
no need to explicitly clear these fields.
...
llvm-svn: 45683
2008-01-07 04:55:09 +00:00
Gordon Henriksen
e90b061f6a
Removing a leaked file.
...
llvm-svn: 45681
2008-01-07 03:23:52 +00:00
Chris Lattner
9d38dfa4a5
Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor
...
llvm-svn: 45680
2008-01-07 03:13:06 +00:00
Chris Lattner
55343065e3
remove MachineOpCode typedef.
...
llvm-svn: 45679
2008-01-07 02:48:55 +00:00
Chris Lattner
96d0a93f8e
remove some uses of MachineOpCode, move getSchedClass
...
into TargetInstrDescriptor from TargetInstrInfo.
llvm-svn: 45678
2008-01-07 02:46:03 +00:00
Chris Lattner
93e1e6ee12
Add predicates methods to TargetOperandInfo, and switch all clients
...
over to using them, instead of diddling Flags directly. Change the
various flags from const variables to enums.
llvm-svn: 45677
2008-01-07 02:39:19 +00:00
Gordon Henriksen
edbfece273
Setting GlobalDirective in TargetAsmInfo by default rather than
...
providing a misleading facility. It's used once in the MIPS backend
and hardcoded as "\t.globl\t" everywhere else.
llvm-svn: 45676
2008-01-07 02:31:11 +00:00
Gordon Henriksen
f0803127c6
Deleting an empty file. Thanks, /usr/bin/patch!
...
llvm-svn: 45675
2008-01-07 02:29:04 +00:00
Chris Lattner
f7f96d818f
Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
...
that it is cheap and efficient to get.
Move a variety of predicates from TargetInstrInfo into
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around. Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.
Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.
llvm-svn: 45674
2008-01-07 01:56:04 +00:00
Owen Anderson
2e866e9cdf
Update CodeGen for MRegisterInfo --> TargetInstrInfo changes.
...
llvm-svn: 45673
2008-01-07 01:35:56 +00:00
Owen Anderson
f19692b2f6
Move even more functionality from MRegisterInfo into TargetInstrInfo.
...
Some day I'll get it all moved over...
llvm-svn: 45672
2008-01-07 01:35:02 +00:00
Gordon Henriksen
759ed9d805
Ammending r45669 with a missing file.
...
llvm-svn: 45671
2008-01-07 01:33:09 +00:00
Gordon Henriksen
db4f51e1b9
With this patch, the LowerGC transformation becomes the
...
ShadowStackCollector, which additionally has reduced overhead with
no sacrifice in portability.
Considering a function @fun with 8 loop-local roots,
ShadowStackCollector introduces the following overhead
(x86):
; shadowstack prologue
movl L_llvm_gc_root_chain$non_lazy_ptr, %eax
movl (%eax), %ecx
movl $___gc_fun, 20(%esp)
movl $0, 24(%esp)
movl $0, 28(%esp)
movl $0, 32(%esp)
movl $0, 36(%esp)
movl $0, 40(%esp)
movl $0, 44(%esp)
movl $0, 48(%esp)
movl $0, 52(%esp)
movl %ecx, 16(%esp)
leal 16(%esp), %ecx
movl %ecx, (%eax)
; shadowstack loop overhead
(none)
; shadowstack epilogue
movl 48(%esp), %edx
movl %edx, (%ecx)
; shadowstack metadata
.align 3
___gc_fun: # __gc_fun
.long 8
.space 4
In comparison to LowerGC:
; lowergc prologue
movl L_llvm_gc_root_chain$non_lazy_ptr, %eax
movl (%eax), %ecx
movl %ecx, 48(%esp)
movl $8, 52(%esp)
movl $0, 60(%esp)
movl $0, 56(%esp)
movl $0, 68(%esp)
movl $0, 64(%esp)
movl $0, 76(%esp)
movl $0, 72(%esp)
movl $0, 84(%esp)
movl $0, 80(%esp)
movl $0, 92(%esp)
movl $0, 88(%esp)
movl $0, 100(%esp)
movl $0, 96(%esp)
movl $0, 108(%esp)
movl $0, 104(%esp)
movl $0, 116(%esp)
movl $0, 112(%esp)
; lowergc loop overhead
leal 44(%esp), %eax
movl %eax, 56(%esp)
leal 40(%esp), %eax
movl %eax, 64(%esp)
leal 36(%esp), %eax
movl %eax, 72(%esp)
leal 32(%esp), %eax
movl %eax, 80(%esp)
leal 28(%esp), %eax
movl %eax, 88(%esp)
leal 24(%esp), %eax
movl %eax, 96(%esp)
leal 20(%esp), %eax
movl %eax, 104(%esp)
leal 16(%esp), %eax
movl %eax, 112(%esp)
; lowergc epilogue
movl 48(%esp), %edx
movl %edx, (%ecx)
; lowergc metadata
(none)
llvm-svn: 45670
2008-01-07 01:30:53 +00:00
Gordon Henriksen
88a41c672b
Enabling the target-independent garbage collection infrastructure by hooking it
...
up to the various compiler pipelines.
This doesn't actually add support for any GC algorithms, which means it
temporarily breaks a few tests. To be fixed shortly.
llvm-svn: 45669
2008-01-07 01:30:38 +00:00
Chris Lattner
6b6e6f1f6e
The pic base can't be duplicated.
...
llvm-svn: 45668
2008-01-06 23:49:32 +00:00
Chris Lattner
14310afe42
rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.
...
llvm-svn: 45667
2008-01-06 23:38:27 +00:00
Gordon Henriksen
87171d82dc
Modify Makefile.rules to allow makefiles to prepend to C.Flags and
...
fiends. Change Makefile.ocaml to not touch CFLAGS.
llvm-svn: 45663
2008-01-06 21:54:35 +00:00
Chris Lattner
2b8bb9d2a4
improve description of alignment, patch by Alain Frisch.
...
llvm-svn: 45662
2008-01-06 21:04:43 +00:00
Chris Lattner
f8d3ea59f3
Fix typo noticed by 'Danny' in PR1901
...
llvm-svn: 45661
2008-01-06 19:51:52 +00:00
Chris Lattner
a09bc3d9a4
back out accidental commit.
...
llvm-svn: 45660
2008-01-06 19:19:32 +00:00
Chris Lattner
6badc24aa5
fix an accidental commit that broke all the testers :(
...
llvm-svn: 45659
2008-01-06 19:18:52 +00:00
Duncan Sands
fd975e4b3d
The transform that tries to turn calls to bitcast functions into
...
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes. This is illogical - the callee's
attributes should be of no relevance here. Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.
llvm-svn: 45658
2008-01-06 18:27:01 +00:00
Duncan Sands
b8489f09a2
When transforming a call to a bitcast function into
...
a direct call with cast parameters and cast return
value (if any), instcombine was prepared to cast any
non-void return value into any other, whether castable
or not. Add a new predicate for testing whether casting
is valid, and check it both for the return value and
(as a cleanup) for the parameters.
llvm-svn: 45657
2008-01-06 10:12:28 +00:00
Chris Lattner
5489888580
rename isStore -> mayStore to more accurately reflect what it captures.
...
llvm-svn: 45656
2008-01-06 08:36:04 +00:00
Duncan Sands
63b3355183
Remove an unused variable.
...
llvm-svn: 45655
2008-01-06 07:43:13 +00:00
Chris Lattner
8b4b75c771
Change the 'isStore' inferrer to look for 'SDNPMayStore'
...
instead of "ISD::STORE". This allows us to mark target-specific dag
nodes as storing (such as ppc byteswap stores). This allows us to remove
more explicit isStore flags from the .td files.
Finally, add a warning for when a .td file contains an explicit
isStore and tblgen is able to infer it.
llvm-svn: 45654
2008-01-06 06:44:58 +00:00
Chris Lattner
2bb919b542
remove explicit isStore flags that are now inferrable.
...
llvm-svn: 45653
2008-01-06 05:55:01 +00:00
Chris Lattner
9f8735181f
remove some isStore flags that are now inferred automatically.
...
llvm-svn: 45652
2008-01-06 05:53:26 +00:00
Chris Lattner
06c02cdcbc
describe isStore and simplify the implementation of hasUnmodelledSideEffects.
...
No functionality change.
llvm-svn: 45651
2008-01-06 05:43:21 +00:00
Chris Lattner
01d46ed7cc
set the 'isstore' flag for instructions whose pattern is an
...
intrinsic that writes to memory.
llvm-svn: 45650
2008-01-06 05:36:50 +00:00
Nick Lewycky
e05651c6d7
Accept both %y, %x and %x, %y as valid answers.
...
llvm-svn: 45649
2008-01-06 03:12:44 +00:00
Chris Lattner
ed75a9c636
remove some old hacky code that tried to infer whether a store
...
occured in a pattern, but failed miserably. The new code works for
any instruction that has a store in its pattern, including all the
x86 mem op mem instructions.
The only target-independent code that uses this is branch folding,
so this won't change anything in practice.
llvm-svn: 45648
2008-01-06 02:16:26 +00:00
Chris Lattner
51500436de
rearrange some code to allow inferring instr info from the pattern of the instr, but don't do so yet.
...
llvm-svn: 45647
2008-01-06 01:53:37 +00:00
Chris Lattner
7414f541ca
improve const correctness.
...
llvm-svn: 45646
2008-01-06 01:52:22 +00:00
Chris Lattner
e9f0c9b6f9
Split the impl of CodeGenInstruction out to its own .cpp file, add a getName() accessor.
...
llvm-svn: 45645
2008-01-06 01:35:39 +00:00
Chris Lattner
e0f76407f9
final cleanups.
...
llvm-svn: 45644
2008-01-06 01:21:51 +00:00
Chris Lattner
4eecc7c085
further simplifications and cleanup
...
llvm-svn: 45643
2008-01-06 01:20:13 +00:00