oota-llvm.git
16 years agoIf function notes say optimize for size, then adjust alignment.
Devang Patel [Thu, 4 Sep 2008 21:03:41 +0000 (21:03 +0000)]
If function notes say optimize for size, then adjust alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55794 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd an include of SmallSet.h.
Dan Gohman [Thu, 4 Sep 2008 20:49:27 +0000 (20:49 +0000)]
Add an include of SmallSet.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55793 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoInitialize loop data first.
Devang Patel [Thu, 4 Sep 2008 20:36:36 +0000 (20:36 +0000)]
Initialize loop data first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55792 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNeaten this up a bit. No functionality change.
Duncan Sands [Thu, 4 Sep 2008 19:16:20 +0000 (19:16 +0000)]
Neaten this up a bit.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55789 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not unswitch if the function notes say we're optimizing this function for size.
Devang Patel [Thu, 4 Sep 2008 18:55:13 +0000 (18:55 +0000)]
Do not unswitch if the function notes say we're optimizing this function for size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55786 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agotry to seperate the mechanism into something others can use
Andrew Lenharth [Thu, 4 Sep 2008 18:51:26 +0000 (18:51 +0000)]
try to seperate the mechanism into something others can use

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55785 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdjust libcalls tests to expect intrinsic for exp2
Dale Johannesen [Thu, 4 Sep 2008 18:44:20 +0000 (18:44 +0000)]
Adjust libcalls tests to expect intrinsic for exp2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55784 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd intrinsic forms of pow and exp2. The non-intrinsic
Dale Johannesen [Thu, 4 Sep 2008 18:30:46 +0000 (18:30 +0000)]
Add intrinsic forms of pow and exp2.  The non-intrinsic
forms remain to handle older IR files, but will go away soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55781 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTidy up several unbeseeming casts from pointer to intptr_t.
Dan Gohman [Thu, 4 Sep 2008 17:05:41 +0000 (17:05 +0000)]
Tidy up several unbeseeming casts from pointer to intptr_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the ordering of operands to the store (inverted relative to LLVM IR), and fix...
Owen Anderson [Thu, 4 Sep 2008 16:48:33 +0000 (16:48 +0000)]
Fix the ordering of operands to the store (inverted relative to LLVM IR), and fix the testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55777 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoClean up uses of TargetLowering::getTargetMachine.
Dan Gohman [Thu, 4 Sep 2008 15:39:15 +0000 (15:39 +0000)]
Clean up uses of TargetLowering::getTargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55769 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agocleanup as per Duncan's review
Andrew Lenharth [Thu, 4 Sep 2008 14:34:22 +0000 (14:34 +0000)]
cleanup as per Duncan's review

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55766 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a first attempt at implementing stores for X86 fast isel using target hooks.
Owen Anderson [Thu, 4 Sep 2008 07:08:58 +0000 (07:08 +0000)]
Add a first attempt at implementing stores for X86 fast isel using target hooks.
Dan or Evan, please review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55764 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLoad from GV stub should be locally CSE'd.
Evan Cheng [Thu, 4 Sep 2008 06:18:33 +0000 (06:18 +0000)]
Load from GV stub should be locally CSE'd.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55763 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix an overly strict assertion. Source register of a copy may not be killed, it may...
Evan Cheng [Thu, 4 Sep 2008 05:43:55 +0000 (05:43 +0000)]
Fix an overly strict assertion. Source register of a copy may not be killed, it may be killed by an implicit super-register use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55762 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove code that pad number of bytes to pop for X86_FastCall CC. The code doesn't...
Evan Cheng [Thu, 4 Sep 2008 01:04:15 +0000 (01:04 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55756 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd intrinsics for log, log2, log10, exp, exp2.
Dale Johannesen [Thu, 4 Sep 2008 00:47:13 +0000 (00:47 +0000)]
Add intrinsics for log, log2, log10, exp, exp2.
No functional change (and no FE change to generate them).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55753 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo trivial local CSE for constants and other non-Instruction values
Dan Gohman [Wed, 3 Sep 2008 23:32:19 +0000 (23:32 +0000)]
Do trivial local CSE for constants and other non-Instruction values
in FastISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55748 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPut RegsForValue in the llvm namespace to avoid warnings about
Dan Gohman [Wed, 3 Sep 2008 23:18:39 +0000 (23:18 +0000)]
Put RegsForValue in the llvm namespace to avoid warnings about
classes in the llvm namespace having members with types from
anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55747 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCreate HandlePHINodesInSuccessorBlocksFast, a version of
Dan Gohman [Wed, 3 Sep 2008 23:12:08 +0000 (23:12 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55746 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate inline threshold for current function if the notes say, optimize for size.
Devang Patel [Wed, 3 Sep 2008 23:06:09 +0000 (23:06 +0000)]
Update inline threshold for current function if the notes say, optimize for size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55745 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a bug that prevented PRE from applying in some cases.
Owen Anderson [Wed, 3 Sep 2008 23:06:07 +0000 (23:06 +0000)]
Fix a bug that prevented PRE from applying in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55744 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAvoid extra comma.
Devang Patel [Wed, 3 Sep 2008 22:55:40 +0000 (22:55 +0000)]
Avoid extra comma.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55742 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoParse and print opt_size note.
Devang Patel [Wed, 3 Sep 2008 22:10:21 +0000 (22:10 +0000)]
Parse and print opt_size note.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55740 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoInitial version of a Partial Specialization IPO pass. It triggers a couple hundred...
Andrew Lenharth [Wed, 3 Sep 2008 21:00:28 +0000 (21:00 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55734 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not emit a UsedDirective for things in the llvm.used
Dale Johannesen [Wed, 3 Sep 2008 20:34:58 +0000 (20:34 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55722 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix typo in a comment.
Devang Patel [Wed, 3 Sep 2008 20:25:40 +0000 (20:25 +0000)]
Fix typo in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55720 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd missing decls.
Devang Patel [Wed, 3 Sep 2008 20:24:05 +0000 (20:24 +0000)]
Add missing decls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55719 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd parentheses to make code more readable.
Devang Patel [Wed, 3 Sep 2008 19:57:15 +0000 (19:57 +0000)]
Add parentheses to make code more readable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55717 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix comments.
Devang Patel [Wed, 3 Sep 2008 19:52:17 +0000 (19:52 +0000)]
Fix comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55716 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTestcase for commits 55700 and 55714.
Duncan Sands [Wed, 3 Sep 2008 19:38:41 +0000 (19:38 +0000)]
Testcase for commits 55700 and 55714.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55715 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoIf a SCC has a node without a function, then the SCC
Duncan Sands [Wed, 3 Sep 2008 19:37:16 +0000 (19:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55714 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd custom inliner that handles only functions that are marked as always_inline.
Devang Patel [Wed, 3 Sep 2008 18:50:53 +0000 (18:50 +0000)]
Add custom inliner that handles only functions that are marked as always_inline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55713 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle "always inline" note during inline cost analysis.
Devang Patel [Wed, 3 Sep 2008 18:47:45 +0000 (18:47 +0000)]
Handle "always inline" note during inline cost analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55712 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCheck noinline note and ignore other notes.
Devang Patel [Wed, 3 Sep 2008 18:46:35 +0000 (18:46 +0000)]
Check noinline note and ignore other notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55711 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle "noinline" note inside the simple inliner.
Devang Patel [Wed, 3 Sep 2008 18:10:21 +0000 (18:10 +0000)]
Handle "noinline" note inside the simple inliner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55708 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOops, I accidentally broke the fallback case with my last commit.
Owen Anderson [Wed, 3 Sep 2008 17:51:57 +0000 (17:51 +0000)]
Oops, I accidentally broke the fallback case with my last commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55704 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix an issue where we were reusing materializations of constants in blocks not domina...
Owen Anderson [Wed, 3 Sep 2008 17:37:03 +0000 (17:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55703 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate test to check call instruction.
Devang Patel [Wed, 3 Sep 2008 17:05:49 +0000 (17:05 +0000)]
Update test to check call instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55702 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSplit the SelectionDAG-building code, including the FunctionLoweringInfo
Dan Gohman [Wed, 3 Sep 2008 16:12:24 +0000 (16:12 +0000)]
Split the SelectionDAG-building code, including the FunctionLoweringInfo
and SelectionDAGLowering classes, out of SelectionDAGISel.cpp and put
it in a separate file, SelectionDAGBuild.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55701 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix maxo bado thinko.
Duncan Sands [Wed, 3 Sep 2008 16:10:55 +0000 (16:10 +0000)]
Fix maxo bado thinko.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55700 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSeparate MachineInstr-emitting routines from actual scheduling
Dan Gohman [Wed, 3 Sep 2008 16:01:59 +0000 (16:01 +0000)]
Separate MachineInstr-emitting routines from actual scheduling
routines and move them into a separate file, ScheduleDAGEmit.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55699 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix addRegisterDead and addRegisterKilled to be more thorough
Dan Gohman [Wed, 3 Sep 2008 15:56:16 +0000 (15:56 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55698 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSince onlyReadsMemory returns true if in fact
Duncan Sands [Wed, 3 Sep 2008 15:31:24 +0000 (15:31 +0000)]
Since onlyReadsMemory returns true if in fact
doesNotAccessMemory, check doesNotAccessMemory
first, since otherwise functions may be
marked readonly rather than readnone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55697 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCleanup GlobalsModRef a bit. When analysing the
Duncan Sands [Wed, 3 Sep 2008 12:55:42 +0000 (12:55 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55696 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTestcase for PR1678.
Duncan Sands [Wed, 3 Sep 2008 07:52:01 +0000 (07:52 +0000)]
Testcase for PR1678.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55695 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTry to fold each element of a vector. This is needed to maintain structural
Nick Lewycky [Wed, 3 Sep 2008 06:48:55 +0000 (06:48 +0000)]
Try to fold each element of a vector. This is needed to maintain structural
equivalence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55694 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd X86 target hook to implement load (even from GlobalAddress).
Evan Cheng [Wed, 3 Sep 2008 06:44:39 +0000 (06:44 +0000)]
Add X86 target hook to implement load (even from GlobalAddress).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55693 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoIf TargetSelectInstruction returns true, move to next instruction.
Evan Cheng [Wed, 3 Sep 2008 06:43:41 +0000 (06:43 +0000)]
If TargetSelectInstruction returns true, move to next instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55692 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake UpdateValueMap, createResultReg, etc. protected instead of private so they can...
Evan Cheng [Wed, 3 Sep 2008 06:43:10 +0000 (06:43 +0000)]
Make UpdateValueMap, createResultReg, etc. protected instead of private so they can used by target hooks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55691 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't apply this transform to vectors. Fixes PR2756.
Nick Lewycky [Wed, 3 Sep 2008 06:24:21 +0000 (06:24 +0000)]
Don't apply this transform to vectors. Fixes PR2756.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55690 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't crash when trying to constant fold a vector with some elements that can't
Nick Lewycky [Wed, 3 Sep 2008 05:54:33 +0000 (05:54 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55689 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix capitalization in #include of FastISel.h. This unbreaks the build on case-sensit...
Ted Kremenek [Wed, 3 Sep 2008 02:54:11 +0000 (02:54 +0000)]
Fix capitalization in #include of FastISel.h.  This unbreaks the build on case-sensitive filesystems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55687 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUnbreak fast isel.
Evan Cheng [Wed, 3 Sep 2008 01:04:47 +0000 (01:04 +0000)]
Unbreak fast isel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55685 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd additional check to ensure that iv is canonicalized.
Devang Patel [Wed, 3 Sep 2008 00:29:13 +0000 (00:29 +0000)]
Add additional check to ensure that iv is canonicalized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55682 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCheck iteration count.
Devang Patel [Wed, 3 Sep 2008 00:10:56 +0000 (00:10 +0000)]
Check iteration count.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55680 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLet tblgen only generate fastisel routines, not the class definition. This makes...
Evan Cheng [Wed, 3 Sep 2008 00:03:49 +0000 (00:03 +0000)]
Let tblgen only generate fastisel routines, not the class definition. This makes it easier for targets to define its own fastisel class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55679 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhile removing PHI, use basicblock to identify incoming value.
Devang Patel [Wed, 3 Sep 2008 00:02:42 +0000 (00:02 +0000)]
While removing PHI, use basicblock to identify incoming value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55678 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agos/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
Devang Patel [Tue, 2 Sep 2008 22:43:57 +0000 (22:43 +0000)]
s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55676 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoIf all IV uses are extending integer IV then change the type of IV itself, if possible.
Devang Patel [Tue, 2 Sep 2008 22:18:08 +0000 (22:18 +0000)]
If all IV uses are extending integer IV then change the type of IV itself, if possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55674 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorespect inline=never and inline=always notes.
Devang Patel [Tue, 2 Sep 2008 22:16:13 +0000 (22:16 +0000)]
respect inline=never and inline=always notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55673 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago80 col violations.
Evan Cheng [Tue, 2 Sep 2008 21:59:13 +0000 (21:59 +0000)]
80 col violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55668 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRead and write function notes.
Devang Patel [Tue, 2 Sep 2008 21:47:13 +0000 (21:47 +0000)]
Read and write function notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55657 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse bitwise AND.
Devang Patel [Tue, 2 Sep 2008 21:46:44 +0000 (21:46 +0000)]
Use bitwise AND.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55656 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNew testcase for targets without 64-bit atomics;
Dale Johannesen [Tue, 2 Sep 2008 21:19:30 +0000 (21:19 +0000)]
New testcase for targets without 64-bit atomics;
xfail old test for ppc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55651 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFunction notes tests.
Devang Patel [Tue, 2 Sep 2008 20:58:16 +0000 (20:58 +0000)]
Function notes tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55648 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPrint function notes.
Devang Patel [Tue, 2 Sep 2008 20:56:33 +0000 (20:56 +0000)]
Print function notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55647 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoParse function notes.
Devang Patel [Tue, 2 Sep 2008 20:52:40 +0000 (20:52 +0000)]
Parse function notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55646 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoInitialize function notes.
Devang Patel [Tue, 2 Sep 2008 20:51:15 +0000 (20:51 +0000)]
Initialize function notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55645 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix some bugs in the code sequences for atomics.
Dale Johannesen [Tue, 2 Sep 2008 20:30:23 +0000 (20:30 +0000)]
Fix some bugs in the code sequences for atomics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55643 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEnsure that HandlePHINodesInSuccessorBlocks is run for all blocks,
Dan Gohman [Tue, 2 Sep 2008 20:17:56 +0000 (20:17 +0000)]
Ensure that HandlePHINodesInSuccessorBlocks is run for all blocks,
even in FastISel mode in the case where FastISel successfully
selects all the instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55641 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoGetter and setter for function notes.
Devang Patel [Tue, 2 Sep 2008 18:33:55 +0000 (18:33 +0000)]
Getter and setter for function notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55638 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReapply majority of r55557 but with the changes to compilation flags
Daniel Dunbar [Tue, 2 Sep 2008 17:35:16 +0000 (17:35 +0000)]
Reapply majority of r55557 but with the changes to compilation flags
disabled until issues with gcc 4.1 on linux 32-bit are resolved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55636 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoplug memleak: destroy internal buffer
Nuno Lopes [Tue, 2 Sep 2008 12:06:08 +0000 (12:06 +0000)]
plug memleak: destroy internal buffer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55632 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoplug a little memleak in verifyFunction()
Nuno Lopes [Tue, 2 Sep 2008 11:30:10 +0000 (11:30 +0000)]
plug a little memleak in verifyFunction()
# first commit to llvm, so whatch out :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55631 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert r55557, it is causing linking failures on 32bit linux.
Matthijs Kooijman [Tue, 2 Sep 2008 09:51:00 +0000 (09:51 +0000)]
Revert r55557, it is causing linking failures on 32bit linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55628 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMMI may be null.
Evan Cheng [Tue, 2 Sep 2008 08:14:01 +0000 (08:14 +0000)]
MMI may be null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55626 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd Mac OS X compatible JIT callback routine.
Evan Cheng [Tue, 2 Sep 2008 07:49:03 +0000 (07:49 +0000)]
Add Mac OS X compatible JIT callback routine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55625 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevamp ARM JIT.
Evan Cheng [Tue, 2 Sep 2008 06:52:38 +0000 (06:52 +0000)]
Revamp ARM JIT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55624 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange getBinaryCodeForInstr prototype. First operand MachineInstr& should be const...
Evan Cheng [Tue, 2 Sep 2008 06:51:36 +0000 (06:51 +0000)]
Change getBinaryCodeForInstr prototype. First operand MachineInstr& should be const. Make corresponding changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55623 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoProvide two overloads of AnalyzeNewNode.
Gabor Greif [Mon, 1 Sep 2008 15:10:19 +0000 (15:10 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55608 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEven though no caller actually uses the new value
Duncan Sands [Mon, 1 Sep 2008 13:11:13 +0000 (13:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55606 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTurn this legalize types test on.
Duncan Sands [Mon, 1 Sep 2008 12:00:55 +0000 (12:00 +0000)]
Turn this legalize types test on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55605 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a small pass that sets the readnone/readonly
Duncan Sands [Mon, 1 Sep 2008 11:40:11 +0000 (11:40 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55604 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoControl flow instruction encodings.
Evan Cheng [Mon, 1 Sep 2008 08:25:56 +0000 (08:25 +0000)]
Control flow instruction encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55601 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoldm / stm instruction encodings.
Evan Cheng [Mon, 1 Sep 2008 07:48:18 +0000 (07:48 +0000)]
ldm / stm instruction encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55599 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAXI2 and AXI3 instruction encodings.
Evan Cheng [Mon, 1 Sep 2008 07:34:13 +0000 (07:34 +0000)]
AXI2 and AXI3 instruction encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55598 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReorganize instruction formats again; AXI1 encoding.
Evan Cheng [Mon, 1 Sep 2008 07:19:00 +0000 (07:19 +0000)]
Reorganize instruction formats again; AXI1 encoding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55597 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoaddrmode3 instruction encodings.
Evan Cheng [Mon, 1 Sep 2008 07:00:14 +0000 (07:00 +0000)]
addrmode3 instruction encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55596 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReorganize some instruction format definitions. No functionality change.
Evan Cheng [Mon, 1 Sep 2008 01:51:14 +0000 (01:51 +0000)]
Reorganize some instruction format definitions. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55594 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRest of addrmode2 instruction encodings.
Evan Cheng [Mon, 1 Sep 2008 01:27:33 +0000 (01:27 +0000)]
Rest of addrmode2 instruction encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55593 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAddr2 word / byte load encodings.
Evan Cheng [Sun, 31 Aug 2008 19:02:21 +0000 (19:02 +0000)]
Addr2 word / byte load encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55591 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAddr1 instructions opcodes are encoded in bits 21-24; encode S bit.
Evan Cheng [Sun, 31 Aug 2008 18:32:16 +0000 (18:32 +0000)]
Addr1 instructions opcodes are encoded in bits 21-24; encode S bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55590 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix a bunch of 80-col violations
Gabor Greif [Sun, 31 Aug 2008 15:37:04 +0000 (15:37 +0000)]
fix a bunch of 80-col violations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55588 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert the "XFAIL" for the rotate_ops.ll testcase. Instead, mark ISD::ROTR
Bill Wendling [Sun, 31 Aug 2008 02:59:23 +0000 (02:59 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55582 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoExpand for ROTR with MVT::i64.
Bill Wendling [Sun, 31 Aug 2008 02:53:19 +0000 (02:53 +0000)]
Expand for ROTR with MVT::i64.

Dale, Could you please review this?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55581 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCellSPU doesn't appear to support fully the "ISD::ROTR" operation. The DAG
Bill Wendling [Sun, 31 Aug 2008 02:32:12 +0000 (02:32 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55579 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCosmetic changes to Machine LICM. No functionality change.
Bill Wendling [Sun, 31 Aug 2008 02:30:23 +0000 (02:30 +0000)]
Cosmetic changes to Machine LICM. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55578 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAnother situation where ROTR is cheaper than ROTL.
Bill Wendling [Sun, 31 Aug 2008 01:13:31 +0000 (01:13 +0000)]
Another situation where ROTR is cheaper than ROTL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55577 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFor this pattern, ROTR is the cheaper option.
Bill Wendling [Sun, 31 Aug 2008 01:04:56 +0000 (01:04 +0000)]
For this pattern, ROTR is the cheaper option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55576 91177308-0d34-0410-b5e6-96231b3b80d8