Evan Cheng
8d8f47d50b
Load from GV stub should be locally CSE'd.
...
llvm-svn: 55763
2008-09-04 06:18:33 +00:00
Evan Cheng
93d40ae1e1
Fix an overly strict assertion. Source register of a copy may not be killed, it may be killed by an implicit super-register use.
...
llvm-svn: 55762
2008-09-04 05:43:55 +00:00
Evan Cheng
3152edf474
Remove code that pad number of bytes to pop for X86_FastCall CC. The code doesn't do the "aligning" for Cygwin, Mingw, and Windows. But aligning it on Darwin and Linux breaks gcc compatibility. That ruled out all the platforms we support!
...
llvm-svn: 55756
2008-09-04 01:04:15 +00:00
Dale Johannesen
da2d80688b
Add intrinsics for log, log2, log10, exp, exp2.
...
No functional change (and no FE change to generate them).
llvm-svn: 55753
2008-09-04 00:47:13 +00:00
Dan Gohman
e039d5580e
Do trivial local CSE for constants and other non-Instruction values
...
in FastISel.
llvm-svn: 55748
2008-09-03 23:32:19 +00:00
Dan Gohman
45df9951f5
Put RegsForValue in the llvm namespace to avoid warnings about
...
classes in the llvm namespace having members with types from
anonymous namespaces.
llvm-svn: 55747
2008-09-03 23:18:39 +00:00
Dan Gohman
7bda51f5a4
Create HandlePHINodesInSuccessorBlocksFast, a version of
...
HandlePHINodesInSuccessorBlocks that works FastISel-style. This
allows PHI nodes to be updated correctly while using FastISel.
This also involves some code reorganization; ValueMap and
MBBMap are now members of the FastISel class, so they needn't
be passed around explicitly anymore. Also, SelectInstructions
is changed to SelectInstruction, and only does one instruction
at a time.
llvm-svn: 55746
2008-09-03 23:12:08 +00:00
Devang Patel
a26e2075b8
Update inline threshold for current function if the notes say, optimize for size.
...
llvm-svn: 55745
2008-09-03 23:06:09 +00:00
Owen Anderson
2fbfb70530
Fix a bug that prevented PRE from applying in some cases.
...
llvm-svn: 55744
2008-09-03 23:06:07 +00:00
Devang Patel
397d895bb8
Avoid extra comma.
...
llvm-svn: 55742
2008-09-03 22:55:40 +00:00
Devang Patel
3771a1281f
Parse and print opt_size note.
...
llvm-svn: 55740
2008-09-03 22:10:21 +00:00
Andrew Lenharth
9fed8f5b9c
Initial version of a Partial Specialization IPO pass. It triggers a couple hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still.
...
llvm-svn: 55734
2008-09-03 21:00:28 +00:00
Dale Johannesen
5c1ff11fc3
Do not emit a UsedDirective for things in the llvm.used
...
list that have internal linkage; the linker doesn't need
or want this. (These objects must still be preserved
at compile time, so just removing them from the llvm.used
list doesn't work.) Should affect only Darwin.
llvm-svn: 55722
2008-09-03 20:34:58 +00:00
Devang Patel
a563d24e5d
Fix typo in a comment.
...
llvm-svn: 55720
2008-09-03 20:25:40 +00:00
Devang Patel
f58f96f810
Add missing decls.
...
llvm-svn: 55719
2008-09-03 20:24:05 +00:00
Devang Patel
a4211876e5
Add parentheses to make code more readable.
...
llvm-svn: 55717
2008-09-03 19:57:15 +00:00
Devang Patel
50c66cdb0d
Fix comments.
...
llvm-svn: 55716
2008-09-03 19:52:17 +00:00
Duncan Sands
b86a788862
Testcase for commits 55700 and 55714.
...
llvm-svn: 55715
2008-09-03 19:38:41 +00:00
Duncan Sands
ee088a7093
If a SCC has a node without a function, then the SCC
...
analysis would bail out without removing function
records for other members of the SCC (which may exist
if those functions read or wrote global variables).
Since these are initialized to "readnone", this
resulted in incorrect alias analysis results.
llvm-svn: 55714
2008-09-03 19:37:16 +00:00
Devang Patel
924d9084d8
Add custom inliner that handles only functions that are marked as always_inline.
...
llvm-svn: 55713
2008-09-03 18:50:53 +00:00
Devang Patel
0d442ffa2b
Handle "always inline" note during inline cost analysis.
...
llvm-svn: 55712
2008-09-03 18:47:45 +00:00
Devang Patel
79661994b1
Check noinline note and ignore other notes.
...
llvm-svn: 55711
2008-09-03 18:46:35 +00:00
Devang Patel
62be9ad270
Handle "noinline" note inside the simple inliner.
...
llvm-svn: 55708
2008-09-03 18:10:21 +00:00
Owen Anderson
b1b9398ea7
Oops, I accidentally broke the fallback case with my last commit.
...
llvm-svn: 55704
2008-09-03 17:51:57 +00:00
Owen Anderson
ea666816c2
Fix an issue where we were reusing materializations of constants in blocks not dominated by the materialization. This is
...
the simple fix, materializing the constant before every use. It might be better to either track domination of uses or
to materialize all constants and the beginning of the function and let remat sort when to do materialization at uses.
llvm-svn: 55703
2008-09-03 17:37:03 +00:00
Devang Patel
167adebb3f
Update test to check call instruction.
...
llvm-svn: 55702
2008-09-03 17:05:49 +00:00
Dan Gohman
575fad337c
Split the SelectionDAG-building code, including the FunctionLoweringInfo
...
and SelectionDAGLowering classes, out of SelectionDAGISel.cpp and put
it in a separate file, SelectionDAGBuild.cpp.
llvm-svn: 55701
2008-09-03 16:12:24 +00:00
Duncan Sands
e74d7502d2
Fix maxo bado thinko.
...
llvm-svn: 55700
2008-09-03 16:10:55 +00:00
Dan Gohman
b10f1a5c60
Separate MachineInstr-emitting routines from actual scheduling
...
routines and move them into a separate file, ScheduleDAGEmit.cpp.
llvm-svn: 55699
2008-09-03 16:01:59 +00:00
Dan Gohman
c7367b4546
Fix addRegisterDead and addRegisterKilled to be more thorough
...
when searching for redundant subregister dead/kill bits.
Previously it was common to see instructions marked like this:
"RET %EAX<imp-use,kill>, %AX<imp-use,kill>"
With this change, addRegisterKilled continues scanning after
finding the %EAX operand, so it proceeds to discover the
redundant %AX kill and eliminates it, producing this:
"RET %EAX<imp-use,kill>"
This currently has no effect on the generated code.
llvm-svn: 55698
2008-09-03 15:56:16 +00:00
Duncan Sands
0eca0571f8
Since onlyReadsMemory returns true if in fact
...
doesNotAccessMemory, check doesNotAccessMemory
first, since otherwise functions may be
marked readonly rather than readnone.
llvm-svn: 55697
2008-09-03 15:31:24 +00:00
Duncan Sands
42c644ef03
Cleanup GlobalsModRef a bit. When analysing the
...
callgraph, when one member of a SCC calls another
then the analysis would drop to mod-ref because
there is (usually) no function info for the callee
yet; fix this. Teach the analysis about function
attributes, in particular the readonly attribute
(which requires being careful about globals).
llvm-svn: 55696
2008-09-03 12:55:42 +00:00
Duncan Sands
13ea919664
Testcase for PR1678.
...
llvm-svn: 55695
2008-09-03 07:52:01 +00:00
Nick Lewycky
ac5c7d514f
Try to fold each element of a vector. This is needed to maintain structural
...
equivalence.
llvm-svn: 55694
2008-09-03 06:48:55 +00:00
Evan Cheng
a41ee2974b
Add X86 target hook to implement load (even from GlobalAddress).
...
llvm-svn: 55693
2008-09-03 06:44:39 +00:00
Evan Cheng
31ddd09f4a
If TargetSelectInstruction returns true, move to next instruction.
...
llvm-svn: 55692
2008-09-03 06:43:41 +00:00
Evan Cheng
fa67546ef9
Make UpdateValueMap, createResultReg, etc. protected instead of private so they can used by target hooks.
...
llvm-svn: 55691
2008-09-03 06:43:10 +00:00
Nick Lewycky
2fcb26cc75
Don't apply this transform to vectors. Fixes PR2756.
...
llvm-svn: 55690
2008-09-03 06:24:21 +00:00
Nick Lewycky
f023db6444
Don't crash when trying to constant fold a vector with some elements that can't
...
be folded. Instead, fail to fold the entire vector.
We could also return a vector with some elements folded and some not. If anyone
thinks that's a better approach, please speak up!
llvm-svn: 55689
2008-09-03 05:54:33 +00:00
Ted Kremenek
2175b55dc7
Fix capitalization in #include of FastISel.h. This unbreaks the build on case-sensitive filesystems.
...
llvm-svn: 55687
2008-09-03 02:54:11 +00:00
Evan Cheng
8f23ec96b0
Unbreak fast isel.
...
llvm-svn: 55685
2008-09-03 01:04:47 +00:00
Devang Patel
bcd39345de
Add additional check to ensure that iv is canonicalized.
...
llvm-svn: 55682
2008-09-03 00:29:13 +00:00
Devang Patel
b530f08122
Check iteration count.
...
llvm-svn: 55680
2008-09-03 00:10:56 +00:00
Evan Cheng
24422d4928
Let tblgen only generate fastisel routines, not the class definition. This makes it easier for targets to define its own fastisel class.
...
llvm-svn: 55679
2008-09-03 00:03:49 +00:00
Devang Patel
81fed043c5
While removing PHI, use basicblock to identify incoming value.
...
llvm-svn: 55678
2008-09-03 00:02:42 +00:00
Devang Patel
7e59270272
s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
...
llvm-svn: 55676
2008-09-02 22:43:57 +00:00
Devang Patel
43c5a52e07
If all IV uses are extending integer IV then change the type of IV itself, if possible.
...
llvm-svn: 55674
2008-09-02 22:18:08 +00:00
Devang Patel
bfa535af9f
respect inline=never and inline=always notes.
...
llvm-svn: 55673
2008-09-02 22:16:13 +00:00
Evan Cheng
09ff2e7372
80 col violations.
...
llvm-svn: 55668
2008-09-02 21:59:13 +00:00
Devang Patel
ca9d93e627
Read and write function notes.
...
llvm-svn: 55657
2008-09-02 21:47:13 +00:00
Devang Patel
805b37ca43
Use bitwise AND.
...
llvm-svn: 55656
2008-09-02 21:46:44 +00:00
Dale Johannesen
1a83a9973b
New testcase for targets without 64-bit atomics;
...
xfail old test for ppc.
llvm-svn: 55651
2008-09-02 21:19:30 +00:00
Devang Patel
cc4d6ce532
Function notes tests.
...
llvm-svn: 55648
2008-09-02 20:58:16 +00:00
Devang Patel
600879c8e8
Print function notes.
...
llvm-svn: 55647
2008-09-02 20:56:33 +00:00
Devang Patel
c57b7a0fc8
Parse function notes.
...
llvm-svn: 55646
2008-09-02 20:52:40 +00:00
Devang Patel
d334a43a86
Initialize function notes.
...
llvm-svn: 55645
2008-09-02 20:51:15 +00:00
Dale Johannesen
bc69829b22
Fix some bugs in the code sequences for atomics.
...
llvm-svn: 55643
2008-09-02 20:30:23 +00:00
Dan Gohman
115267fdc6
Ensure that HandlePHINodesInSuccessorBlocks is run for all blocks,
...
even in FastISel mode in the case where FastISel successfully
selects all the instructions.
llvm-svn: 55641
2008-09-02 20:17:56 +00:00
Devang Patel
9989ddeb15
Getter and setter for function notes.
...
llvm-svn: 55638
2008-09-02 18:33:55 +00:00
Daniel Dunbar
61e0a821cc
Reapply majority of r55557 but with the changes to compilation flags
...
disabled until issues with gcc 4.1 on linux 32-bit are resolved.
llvm-svn: 55636
2008-09-02 17:35:16 +00:00
Nuno Lopes
114a582019
plug memleak: destroy internal buffer
...
llvm-svn: 55632
2008-09-02 12:06:08 +00:00
Nuno Lopes
99341f2d9d
plug a little memleak in verifyFunction()
...
# first commit to llvm, so whatch out :)
llvm-svn: 55631
2008-09-02 11:30:10 +00:00
Matthijs Kooijman
7b704a502b
Revert r55557, it is causing linking failures on 32bit linux.
...
llvm-svn: 55628
2008-09-02 09:51:00 +00:00
Evan Cheng
52b181206f
MMI may be null.
...
llvm-svn: 55626
2008-09-02 08:14:01 +00:00
Evan Cheng
df8cdc3717
Add Mac OS X compatible JIT callback routine.
...
llvm-svn: 55625
2008-09-02 07:49:03 +00:00
Evan Cheng
3be5b728b1
Revamp ARM JIT.
...
llvm-svn: 55624
2008-09-02 06:52:38 +00:00
Evan Cheng
34f3a962b0
Change getBinaryCodeForInstr prototype. First operand MachineInstr& should be const. Make corresponding changes.
...
llvm-svn: 55623
2008-09-02 06:51:36 +00:00
Gabor Greif
9c64e61176
Provide two overloads of AnalyzeNewNode.
...
The first can update the SDNode in an SDValue
while the second is called with SDNode* and
returns a possibly updated SDNode*.
This patch has no intended functional impact,
but helps eliminating ugly temporary SDValues.
llvm-svn: 55608
2008-09-01 15:10:19 +00:00
Duncan Sands
4b31a2a7ce
Even though no caller actually uses the new value
...
(what matters is that it is added to the worklist),
it seems more logical to return it.
llvm-svn: 55606
2008-09-01 13:11:13 +00:00
Duncan Sands
fdbe925974
Turn this legalize types test on.
...
llvm-svn: 55605
2008-09-01 12:00:55 +00:00
Duncan Sands
130d9efec3
Add a small pass that sets the readnone/readonly
...
attributes on functions, based on the result of
alias analysis. It's not hardwired to use
GlobalsModRef even though this is the only (AFAIK)
alias analysis that results in this pass actually
doing something. Enable as follows:
opt ... -globalsmodref-aa -markmodref ...
Advantages of this pass: (1) records the result
of globalsmodref in the bitcode, meaning it is
available for use by later passes (currently
the pass manager isn't smart enough to magically
make an advanced alias analysis available to all
later passes), which may expose more optimization
opportunities; (2) hopefully speeds up compilation
when code is optimized twice, for example when a
file is compiled to bitcode, then later LTO is done
on it: marking functions readonly/readnone when
producing the initial bitcode should speed up alias
analysis during LTO; (3) good for discovering that
globalsmodref doesn't work very well :)
Not currently turned on by default.
llvm-svn: 55604
2008-09-01 11:40:11 +00:00
Evan Cheng
fa558788e7
Control flow instruction encodings.
...
llvm-svn: 55601
2008-09-01 08:25:56 +00:00
Evan Cheng
c288cc0572
ldm / stm instruction encodings.
...
llvm-svn: 55599
2008-09-01 07:48:18 +00:00
Evan Cheng
c37532b24a
AXI2 and AXI3 instruction encodings.
...
llvm-svn: 55598
2008-09-01 07:34:13 +00:00
Evan Cheng
a282723499
Reorganize instruction formats again; AXI1 encoding.
...
llvm-svn: 55597
2008-09-01 07:19:00 +00:00
Evan Cheng
169eccc24e
addrmode3 instruction encodings.
...
llvm-svn: 55596
2008-09-01 07:00:14 +00:00
Evan Cheng
624844b4dd
Reorganize some instruction format definitions. No functionality change.
...
llvm-svn: 55594
2008-09-01 01:51:14 +00:00
Evan Cheng
cccca875b1
Rest of addrmode2 instruction encodings.
...
llvm-svn: 55593
2008-09-01 01:27:33 +00:00
Evan Cheng
01fd3f129a
Addr2 word / byte load encodings.
...
llvm-svn: 55591
2008-08-31 19:02:21 +00:00
Evan Cheng
5b6c931e1f
Addr1 instructions opcodes are encoded in bits 21-24; encode S bit.
...
llvm-svn: 55590
2008-08-31 18:32:16 +00:00
Gabor Greif
81d6a38434
fix a bunch of 80-col violations
...
llvm-svn: 55588
2008-08-31 15:37:04 +00:00
Bill Wendling
aebd2662d3
Revert the "XFAIL" for the rotate_ops.ll testcase. Instead, mark ISD::ROTR
...
instructions in CellSPU as "Expand" so that they won't be generated. I added a
"FIXME" so that this hack can be addressed and reverted once ISD::ROTR is
supported in the .td files.
llvm-svn: 55582
2008-08-31 02:59:23 +00:00
Bill Wendling
62cf24343c
Expand for ROTR with MVT::i64.
...
Dale, Could you please review this?
llvm-svn: 55581
2008-08-31 02:53:19 +00:00
Bill Wendling
91bf1e0dc5
CellSPU doesn't appear to support fully the "ISD::ROTR" operation. The DAG
...
combiner can now generate ROTR if the backend says that it can handle it. Cell
SPU says this, but gets an error from code gen saying that it can't select
ROTR. I'm xfailing this test until this can be fixed.
llvm-svn: 55579
2008-08-31 02:32:12 +00:00
Bill Wendling
58bb4f1bf0
Cosmetic changes to Machine LICM. No functionality change.
...
llvm-svn: 55578
2008-08-31 02:30:23 +00:00
Bill Wendling
11284ea499
Another situation where ROTR is cheaper than ROTL.
...
llvm-svn: 55577
2008-08-31 01:13:31 +00:00
Bill Wendling
4822a7ac8a
For this pattern, ROTR is the cheaper option.
...
llvm-svn: 55576
2008-08-31 01:04:56 +00:00
Bill Wendling
fc72416447
- Fix comment so that it describes how the code really works:
...
// fold (or (shl x, (*ext y)), (srl x, (*ext (sub 32, y)))) ->
// (rotl x, y)
// fold (or (shl x, (*ext y)), (srl x, (*ext (sub 32, y)))) ->
// (rotr x, (sub 32, y))
Example: (x == 0xDEADBEEF and y == 4)
(x << 4) | (x >> 28)
=> 0xEADBEEF0 | 0x0000000D
=> 0xEADBEEFD
(rotl x, 4)
=> 0xEADBEEFD
(rotr x, 28)
=> 0xEADBEEFD
- Fix comment and code for second version. It wasn't using the rot* propertly.
// fold (or (shl x, (*ext (sub 32, y))), (srl x, (*ext r))) ->
// (rotr x, y)
// fold (or (shl x, (*ext (sub 32, y))), (srl x, (*ext r))) ->
// (rotl x, (sub 32, y))
(x << 28) | (x >> 4)
=> 0xD0000000 | 0x0DEADBEE
=> 0xDDEADBEE
(rotl x, 4)
=> 0xEADBEEFD
(rotr x, 28)
=> (0xEADBEEFD)
llvm-svn: 55575
2008-08-31 00:37:27 +00:00
Gabor Greif
66ccf603a9
typo
...
llvm-svn: 55574
2008-08-30 22:16:05 +00:00
Gabor Greif
e12264bf41
fix some 80-col violations
...
llvm-svn: 55571
2008-08-30 19:29:20 +00:00
Gordon Henriksen
eeb6537abb
PR2731: C and Ocaml bindings for setTailCall and isTailCall.
...
Based on patch by Giorgos Korfiatis.
llvm-svn: 55570
2008-08-30 16:34:54 +00:00
Gordon Henriksen
b52d1ed7e9
Fix ConstantExpr::getInsertElement.
...
Breakage was exposed in the Ocaml bindings tests after Chris
uncommented an assertion in r55084.
llvm-svn: 55566
2008-08-30 15:41:51 +00:00
Gabor Greif
a719239719
fix some 80-col violations
...
llvm-svn: 55565
2008-08-30 10:09:02 +00:00
Evan Cheng
a3771d5bd9
Re-apply 55467 with fix. If copy is being replaced by remat'ed def, transfer the implicit defs onto the remat'ed instruction.
...
llvm-svn: 55564
2008-08-30 09:09:33 +00:00
Evan Cheng
542ac62971
Fold isRematerializable checks into isSafeToReMat.
...
llvm-svn: 55563
2008-08-30 09:07:18 +00:00
Evan Cheng
b8d588d89c
For now, can't mark XOR64rr isAsCheapAsAMove. It's technically correct. But various passes cannot handle remating these.
...
llvm-svn: 55562
2008-08-30 08:54:22 +00:00
Evan Cheng
cfb7f3abdf
Transform (x << (y&31)) -> (x << y). This takes advantage of the fact x86 shift instructions 2nd operand (shift count) is limited to 0 to 31 (or 63 in the x86-64 case).
...
llvm-svn: 55558
2008-08-30 02:03:58 +00:00
Daniel Dunbar
8eec985ac7
Enable -fvisibility-inlines-hidden by default for compilers which
...
support it.
llvm-svn: 55557
2008-08-30 01:16:19 +00:00
Dale Johannesen
35c2abf4c2
Testcases for ppc atomics.
...
llvm-svn: 55556
2008-08-30 00:54:31 +00:00
Owen Anderson
6f0c51d9da
Fix an issue where a use might be selected before a def, and then we didn't respect the pre-chosen vreg
...
assignment when selecting the def. This is the naive solution to the problem: insert a copy to the pre-chosen
vreg. Other solutions might be preferable, such as:
1) Passing the dest reg into FastEmit_. However, this would require the higher level code to know about reg classes, which they don't currently.
2) Selecting blocks in reverse postorder. This has some compile time cost for computing the order, and we'd need to measure its impact.
llvm-svn: 55555
2008-08-30 00:38:46 +00:00
Dale Johannesen
340d264f52
Add ppc partial-word ATOMIC_CMP_SWAP.
...
llvm-svn: 55554
2008-08-30 00:08:53 +00:00
Evan Cheng
3fddc7e906
Swap fp comparison operands and change predicate to allow load folding (safely this time).
...
llvm-svn: 55553
2008-08-29 23:22:12 +00:00
Evan Cheng
f93bc7f755
Use static_cast instead of C style cast.
...
llvm-svn: 55552
2008-08-29 23:21:31 +00:00
Evan Cheng
894be333f1
Fix 80 col. violations.
...
llvm-svn: 55551
2008-08-29 23:20:46 +00:00
Evan Cheng
0b82607fa1
xfail this.
...
llvm-svn: 55550
2008-08-29 22:59:13 +00:00
Evan Cheng
5e7658c2e4
Back out 55498. It broken Apple style bootstrapping.
...
llvm-svn: 55549
2008-08-29 22:21:44 +00:00
Evan Cheng
b3ed09703c
Backing out 55521. Not safe.
...
llvm-svn: 55548
2008-08-29 22:13:21 +00:00
Dale Johannesen
f0a88d6b2a
Add partial word version of ATOMIC_SWAP.
...
llvm-svn: 55546
2008-08-29 18:29:46 +00:00
Owen Anderson
0673a8af14
Add initial support for fast isel of instructions that have inputs pinned to physical registers.
...
llvm-svn: 55545
2008-08-29 17:45:56 +00:00
Chris Lattner
b1a635b30c
regenerate
...
llvm-svn: 55542
2008-08-29 17:20:18 +00:00
Chris Lattner
b25e5eab23
Asmprint nameless instructions as:
...
%4 = add ...
instead of:
add ... ; 4
This makes opt -print-cfg output actually usable and makes .ll files
generally easier to read. This fixes PR2480
llvm-svn: 55541
2008-08-29 17:19:30 +00:00
Chris Lattner
9fc9d2ec3b
allow this to pass.
...
llvm-svn: 55540
2008-08-29 17:18:26 +00:00
Chris Lattner
a51c7030e2
Add support for parsing .ll files that have numbers in front of
...
nameless values, such as:
%3 = add i32 4, 2
This fixes the first half of PR2480
llvm-svn: 55539
2008-08-29 17:12:13 +00:00
Evan Cheng
44b2138b9a
TableGen'ing instruction encodings.
...
llvm-svn: 55533
2008-08-29 07:42:03 +00:00
Evan Cheng
c139c221dd
addrmode1 (data processing) instruction encoding: bits 5-6 are 0, bits 7-10 encode the opcode.
...
llvm-svn: 55531
2008-08-29 07:40:52 +00:00
Evan Cheng
9f717afd68
MVN is addrmode1.
...
llvm-svn: 55530
2008-08-29 07:36:24 +00:00
Daniel Dunbar
278e909124
Add GlobalValue::{removeFromParent,eraseFromParent}
...
llvm-svn: 55529
2008-08-29 07:30:15 +00:00
Evan Cheng
ee98fa9db2
More refactoring.
...
llvm-svn: 55528
2008-08-29 06:41:12 +00:00
Daniel Dunbar
c70fa60b5e
Add DenseMap::lookup:
...
/// lookup - Return the entry for the specified key, or a default
/// constructed value if no such entry exists.
llvm-svn: 55523
2008-08-29 00:48:44 +00:00
Evan Cheng
960b17a3c2
Swap fp comparison operands and change predicate to allow load folding.
...
llvm-svn: 55521
2008-08-28 23:48:31 +00:00
Evan Cheng
2d37f19ef2
Refactor ARM instruction format definitions into a separate file. No functionality changes.
...
llvm-svn: 55518
2008-08-28 23:39:26 +00:00
Dan Gohman
d58f3e36d0
Add a target callback for FastISel.
...
llvm-svn: 55512
2008-08-28 23:21:34 +00:00
Gabor Greif
95d77f5466
remove tabs, fix > 80 cols
...
llvm-svn: 55511
2008-08-28 23:19:51 +00:00
Bill Wendling
a4fe47e4cc
Add another description to my entry.
...
llvm-svn: 55510
2008-08-28 23:16:37 +00:00
Gabor Greif
76a6d27a71
just a brain dump for a small tool
...
that brings us to 80-col violations
or tabs.
Usage:
visit-violations <file>
At the moment it outputs editor invocations.
llvm-svn: 55509
2008-08-28 23:15:28 +00:00
Chris Lattner
e6fe88391a
rename destroy -> releaseMemory to properly hook into passmgr.
...
llvm-svn: 55508
2008-08-28 22:56:53 +00:00
Nicolas Geoffray
b011a8f611
Add support for JIT exceptions on Darwin. Since we're dealing with libgcc,
...
whose darwin code was written after the ability to dynamically register frames,
we need to do special hacks to make things work.
llvm-svn: 55507
2008-08-28 22:34:49 +00:00
Gabor Greif
2dd54ed593
fix the output dumbness I have introduced some time ago
...
llvm-svn: 55506
2008-08-28 22:32:39 +00:00
Gabor Greif
f304a7aa4d
erect abstraction boundaries for accessing SDValue members, rename Val -> Node to reflect semantics
...
llvm-svn: 55504
2008-08-28 21:40:38 +00:00
Dan Gohman
c45733f194
Implement null and undef values for FastISel.
...
llvm-svn: 55500
2008-08-28 21:19:07 +00:00
Mon P Wang
1e137300bd
In lowering SELECT_CC, removed cases where we can't flip the true and false when the compare value has a NaN
...
llvm-svn: 55499
2008-08-28 21:04:05 +00:00
Dan Gohman
f27e33baa7
Optimize DAGCombiner's worklist processing. Previously it started
...
its work by putting all nodes in the worklist, requiring a big
dynamic allocation. Now, DAGCombiner just iterates over the AllNodes
list and maintains a worklist for nodes that are newly created or
need to be revisited. This allows the worklist to stay small in most
cases, so it can be a SmallVector.
This has the side effect of making DAGCombine not miss a folding
opportunity in alloca-align-rounding.ll.
llvm-svn: 55498
2008-08-28 21:01:56 +00:00
Dan Gohman
17da671922
Move CaseBlock, JumpTable, and BitTestBlock to be members of
...
SelectionDAGLowering instead of being in an anonymous namespace.
This fixes warnings about SelectionDAGLowering having fields
using anonymous namespaces.
llvm-svn: 55497
2008-08-28 20:38:18 +00:00
Dan Gohman
360c57f683
Fix a FastISel bug where the instructions from lowering the arguments
...
were being emitted after the first instructions of the entry block.
llvm-svn: 55496
2008-08-28 20:28:56 +00:00
Rafael Espindola
26d54b3ef3
Use resize instead of reserve. Reserve doesn't change size().
...
llvm-svn: 55486
2008-08-28 18:32:53 +00:00
Rafael Espindola
6c8a99a778
Reduce the size of the Parts vector.
...
llvm-svn: 55483
2008-08-28 18:29:58 +00:00
Owen Anderson
d8a82b75e2
Hook up support for fast-isel of trunc instructions, using the newly working support for EXTRACT_SUBREG.
...
llvm-svn: 55482
2008-08-28 18:26:01 +00:00
Owen Anderson
787f100462
Add support for fast-isel of opcodes that require use of extract_subreg. Because of how extract_subreg is treated, it requires special case handling.
...
llvm-svn: 55480
2008-08-28 18:06:12 +00:00
Dale Johannesen
a32affb9ba
Implement partial-word binary atomics on ppc.
...
llvm-svn: 55478
2008-08-28 17:53:09 +00:00
Owen Anderson
9cd1a5e530
FastEmitInst_extractsubreg doesn't need to be passed the register class. It can get it from MachineRegisterInfo instead.
...
llvm-svn: 55476
2008-08-28 17:47:37 +00:00
Dan Gohman
04cf2e4540
Revert r55467; it causes regressions in UnitTests/Vector/divides,
...
Benchmarks/sim/sim, and others on x86-64.
llvm-svn: 55475
2008-08-28 17:22:54 +00:00
Rafael Espindola
029c1c8460
Correctly resize the Parts array.
...
llvm-svn: 55471
2008-08-28 14:24:45 +00:00
Evan Cheng
6975602024
If a copy isn't coalesced, but its src is defined by trivial computation. Re-materialize the src to replace the copy.
...
llvm-svn: 55467
2008-08-28 07:53:51 +00:00
Evan Cheng
97af20f85f
FsFLD0S{S|D} and V_SETALLONES are as cheap as moves.
...
llvm-svn: 55466
2008-08-28 07:52:25 +00:00
Chris Lattner
e5a22c06c5
Make the verifier reject instructions which have null pointers
...
for operands: rdar://6179606. no testcase, because I can't write
a .ll file that is this broken ;-)
llvm-svn: 55460
2008-08-28 04:02:44 +00:00
Chris Lattner
65df1188c6
Clear the intervals list in "destroy", patch by
...
Prakash Prabhu!
llvm-svn: 55458
2008-08-28 03:33:03 +00:00
Dale Johannesen
41be0d4445
Split the ATOMIC NodeType's to include the size, e.g.
...
ATOMIC_LOAD_ADD_{8,16,32,64} instead of ATOMIC_LOAD_ADD.
Increased the Hardcoded Constant OpActionsCapacity to match.
Large but boring; no functional change.
This is to support partial-word atomics on ppc; i8 is
not a valid type there, so by the time we get to lowering, the
ATOMIC_LOAD nodes looks the same whether the type was i8 or i32.
The information can be added to the AtomicSDNode, but that is the
largest SDNode; I don't fully understand the SDNode allocation,
but it is sensitive to the largest node size, so increasing
that must be bad. This is the alternative.
llvm-svn: 55457
2008-08-28 02:44:49 +00:00
Dale Johannesen
897b2380d8
This test crashes on non-x86 host; make SSE explicit.
...
Feel free to fix a better way!
llvm-svn: 55456
2008-08-28 01:51:09 +00:00
Dan Gohman
0e92132f2a
Fix a missing #include. Patch by Andrew John Hughes.
...
llvm-svn: 55451
2008-08-28 00:20:07 +00:00
Dan Gohman
e1a9a780a5
Reorganize the lifetimes of the major objects SelectionDAGISel
...
works with.
SelectionDAG, FunctionLoweringInfo, and SelectionDAGLowering
objects now get created once per SelectionDAGISel instance, and
can be reused across blocks and across functions. Previously,
they were created and destroyed each time they were needed.
This reorganization simplifies the handling of PHI nodes, and
also SwitchCases, JumpTables, and BitTestBlocks. This
simplification has the side effect of fixing a bug in FastISel
where successor PHI nodes weren't being updated correctly.
This is also a step towards making the transition from FastISel
into and out of SelectionDAG faster, and also making
plain SelectionDAG faster on code with lots of little blocks.
llvm-svn: 55450
2008-08-27 23:52:12 +00:00
Owen Anderson
5f57bc2247
Add a helper method that will be used to support EXTRACT_SUBREG for selecting trunc's in fast-isel.
...
llvm-svn: 55439
2008-08-27 22:30:02 +00:00
Bill Wendling
76105a4a4f
Make "movdq2q" and "movq2dq" dependent upon having SSE2 because they use the
...
SSE2 registers as well as the MMX registers.
llvm-svn: 55436
2008-08-27 21:32:04 +00:00
Bill Wendling
25b4cad510
Put file scoped constants in an anonymous namespace. Use the "using namespace
...
llvm" for consistency.
llvm-svn: 55435
2008-08-27 21:10:13 +00:00
Evan Cheng
f016b263e2
Move the check whether it's worth remating to caller.
...
llvm-svn: 55434
2008-08-27 20:58:54 +00:00
Devang Patel
d6adbb6a0f
Do not apply the transformation if the target does not support DestTy natively.
...
llvm-svn: 55433
2008-08-27 20:55:23 +00:00
Devang Patel
d3a1b46aad
Backout 55429
...
llvm-svn: 55432
2008-08-27 20:51:49 +00:00
Dan Gohman
61cfa3095d
Fix FastISel's bitcast code for the case where getRegForValue fails.
...
llvm-svn: 55431
2008-08-27 20:41:38 +00:00
Evan Cheng
57dc078570
Refactor isSafeToReMat out of 2addr pass.
...
llvm-svn: 55430
2008-08-27 20:33:50 +00:00
Devang Patel
fdef44d7c4
Add facility to create a target.
...
llvm-svn: 55429
2008-08-27 20:00:27 +00:00
Owen Anderson
90609850b2
Use TargetLowering to get the types in fast isel, which handles pointer types correctly for our purposes.
...
llvm-svn: 55428
2008-08-27 18:58:30 +00:00
Dan Gohman
d01789be23
Don't check TLI.getOperationAction. The FastISel way is to
...
just try to do the action and let the tablegen-generated code
determine if there is target-support for an operation.
llvm-svn: 55427
2008-08-27 18:15:05 +00:00
Dan Gohman
b0b5a27438
Add a new FastISel method, getRegForValue, which takes care of
...
the details of materializing constants and other values into
registers, and make use of it in several places.
llvm-svn: 55426
2008-08-27 18:10:19 +00:00
Dan Gohman
f2a6c1579f
Add a comment about the current floating-point constant code in FastISel.
...
llvm-svn: 55425
2008-08-27 18:01:42 +00:00
Devang Patel
cf7ca5d0ba
Fix typos and whitespaces. Other cosmetic changes based on feedback.
...
llvm-svn: 55424
2008-08-27 17:50:18 +00:00
Chris Lattner
81e23091d9
Minor cleanup.
...
llvm-svn: 55423
2008-08-27 17:36:58 +00:00
Dan Gohman
7f2777e8d2
Reinstate the x86-64 portion of r55190. When doing extloads into
...
64-bit registers from 16-bit and smaller memory locations, prefer
instructions that define the entire 64-bit register, to avoid
partial-register updates.
llvm-svn: 55422
2008-08-27 17:33:15 +00:00
Dan Gohman
3a3a52de58
Optimize ScheduleDAGRRList's topological sort to use one pass instead
...
of two, and to not need a scratch std::vector. Also, compute the ordering
immediately in the result array, instead of in another scratch std::vector
that is copied to the result array.
llvm-svn: 55421
2008-08-27 16:29:48 +00:00
Dan Gohman
9cbdedcbcf
Optimize ScheduleDAG's ComputeDepths and ComputeHeights to not need
...
a scratch std::vector.
llvm-svn: 55420
2008-08-27 16:27:25 +00:00
Dan Gohman
a5b15bd09b
Remove the std::ostream form of PseudoSourceValue's print,
...
which isn't needed anymore.
llvm-svn: 55419
2008-08-27 16:19:44 +00:00
Dan Gohman
6d153b02c9
Update a comment to reflect recent changes.
...
llvm-svn: 55418
2008-08-27 16:18:22 +00:00
Dan Gohman
539f74c87d
Unbreak PseudoSourceValue::print. This fixes -print-machine-instrs
...
and various other things.
llvm-svn: 55415
2008-08-27 15:24:43 +00:00
Dan Gohman
6d618724b5
Diagnose uses of unsized types with the byval attribute in the
...
verifier. See PR2711 for details.
llvm-svn: 55414
2008-08-27 14:48:06 +00:00
Dan Gohman
4051bf47ec
Update wording, as aggregates are now first-class.
...
llvm-svn: 55413
2008-08-27 14:44:57 +00:00
Evan Cheng
183edfdd86
Add DebugInfoBuilder. Patch by Talin!
...
llvm-svn: 55409
2008-08-27 06:51:14 +00:00
Dan Gohman
5ca269e684
Basic FastISel support for floating-point constants.
...
llvm-svn: 55401
2008-08-27 01:09:54 +00:00
Owen Anderson
54aff7bb23
Fix handling of inttoptr and ptrtoint when unhandled operands are present.
...
llvm-svn: 55400
2008-08-27 00:35:37 +00:00
Owen Anderson
140549256f
Add support for fast isel of inttoptr and ptrtoint in the cases where truncation is not needed.
...
llvm-svn: 55399
2008-08-27 00:31:01 +00:00
Owen Anderson
ca1711a5b5
Factor out a large amoutn of the cast handling code in fast isel into helper methods.
...
This simultaneously makes the code simpler and adds support for sext as well.
llvm-svn: 55398
2008-08-26 23:46:32 +00:00
Dan Gohman
abb6a0b773
Add a MachineInstrBuilder method for adding floating-point
...
immediate operands.
llvm-svn: 55397
2008-08-26 23:19:23 +00:00
Owen Anderson
343310a715
Add support for fast isel of zext.
...
llvm-svn: 55396
2008-08-26 23:14:49 +00:00
Gabor Greif
abfdf928d8
disallow direct access to SDValue::ResNo, provide a getter instead
...
llvm-svn: 55394
2008-08-26 22:36:50 +00:00
Owen Anderson
655c1dc63d
Add support for fptosi of constants in fast isel.
...
llvm-svn: 55393
2008-08-26 22:34:28 +00:00
Owen Anderson
b39e0decf8
Put a heuristic in place to prevent GVN from falling into bad cases with massively complicated CFGs.
...
This speeds up a particular testcase from 12+ hours to 5 seconds with little perceptible loss of quality.
llvm-svn: 55391
2008-08-26 22:07:42 +00:00
Dan Gohman
d56f73f2f2
Optimize SelectionDAG's topological sort to use one pass instead
...
of two, and to not need a scratch std::vector. Also, use the
SelectionDAG's topological sort in LegalizeDAG instead of having
a separate implementation.
llvm-svn: 55389
2008-08-26 21:42:18 +00:00
Dan Gohman
6fda9208d9
Refactor the bitcast code into its own function.
...
llvm-svn: 55387
2008-08-26 21:28:54 +00:00
Dan Gohman
44003cc354
Refactor a bunch of FastISelEmitter code into a helper class, and
...
put each major step in a separate function. This makes the high
level sequence of events easier to follow.
llvm-svn: 55385
2008-08-26 21:21:20 +00:00
Dan Gohman
b5e04bfb18
Make FastISel use the correct argument type when casting GEP indices.
...
llvm-svn: 55384
2008-08-26 20:57:08 +00:00
Dan Gohman
3bcbbece19
Don't select binary instructions with illegal types.
...
llvm-svn: 55383
2008-08-26 20:52:40 +00:00
Owen Anderson
3c4dc434ee
Add support for fast isel of sitofp, and remove some unnecessary and imprecise legality checks.
...
llvm-svn: 55381
2008-08-26 20:37:00 +00:00
Cedric Venet
cf7154b2d6
- small bug corrected: incorrect iterator type.
...
- fix to please VS: add a return after an assert.
llvm-svn: 55380
2008-08-26 19:49:04 +00:00
Owen Anderson
e0ac9765b2
Use a combination of copyRegToReg and ISD::BIT_CONVERT when doing fast isel of bitcasts,
...
allowing it to support the full range of conversions people might ask for in a correct manner.
llvm-svn: 55378
2008-08-26 18:51:24 +00:00
Owen Anderson
42ccd39689
These assertions should be return false's instead, allowing the client to detect the failure.
...
llvm-svn: 55377
2008-08-26 18:50:40 +00:00
Owen Anderson
3ea3efec44
We need to check that the return type is correct, even in cases where we don't
...
have a return type that differs from the operand types.
llvm-svn: 55376
2008-08-26 18:50:00 +00:00
Owen Anderson
27fb3dcbc7
Make TargetInstrInfo::copyRegToReg return a bool indicating whether the copy requested
...
was inserted or not. This allows bitcast in fast isel to properly handle the case
where an appropriate reg-to-reg copy is not available.
llvm-svn: 55375
2008-08-26 18:03:31 +00:00
Devang Patel
4310d39844
If IV is used in a int-to-float cast inside the loop then try to eliminate the cast operation.
...
llvm-svn: 55374
2008-08-26 17:57:54 +00:00
Owen Anderson
bf05ebaccf
Add support for fast isel of non-constant fptosi instructions.
...
llvm-svn: 55373
2008-08-26 17:44:42 +00:00
Gabor Greif
b4a173e92f
fix doxygen comment
...
llvm-svn: 55372
2008-08-26 17:44:40 +00:00
Ted Kremenek
31707c0edf
Grammar fix.
...
llvm-svn: 55371
2008-08-26 16:41:15 +00:00
Ted Kremenek
2e75d8aed0
Added "str()" method to raw_string_ostream.
...
str() mirrors the same method in std::ostringstream.
str() flushes the buffered stream contents to string and returns a reference to the string.
llvm-svn: 55370
2008-08-26 16:34:01 +00:00
Chris Lattner
491a930ea3
code simplification, no functionality change.
...
llvm-svn: 55363
2008-08-26 07:01:28 +00:00