Commit Graph

39839 Commits

Author SHA1 Message Date
Chris Lattner 08af5a9dad implement support for sinking a load out the bottom of a block that
has no stores between the load and the end of block.  This works 
great and sinks hundreds of stores, but we can't turn it on because
machineinstrs don't have volatility information and we don't want to
sink volatile stores :(

llvm-svn: 45894
2008-01-12 00:17:41 +00:00
Chris Lattner 1f503ddab5 remove some incorrect classof's.
llvm-svn: 45893
2008-01-11 23:25:16 +00:00
Duncan Sands 5b721fc21d When DAE drops the varargs part of a function, ensure any
attributes on the vararg call arguments are also dropped.

llvm-svn: 45892
2008-01-11 23:13:45 +00:00
Evan Cheng b51d228e79 More cbe byval fixes.
llvm-svn: 45891
2008-01-11 23:10:11 +00:00
Chris Lattner 5a3deb99b3 llvm-g++ 4.0 has completely different code for this warning,
just xfail it.

llvm-svn: 45890
2008-01-11 23:06:56 +00:00
Chris Lattner 031f5e1b8c new testcase
llvm-svn: 45888
2008-01-11 23:04:14 +00:00
Duncan Sands b99f44aa5e Do not allow attributes beyond a function's last
parameter, even if it is a varargs function.  Do
allow attributes on the varargs part of a call,
but not beyond the last argument.  Only allow
selected attributes to be on the varargs part of
a call (currently only 'byval' is allowed).  The
reasoning here is that most attributes, eg inreg,
simply make no sense here.

llvm-svn: 45887
2008-01-11 22:36:48 +00:00
Chris Lattner b5bd924e83 Teach argpromote to ruthlessly hack small byval structs when it can
get away with it, which exposes opportunities to eliminate the memory
objects entirely.  For example, we now compile byval.ll to:

define internal void @f1(i32 %b.0, i64 %b.1) {
entry:
	%tmp2 = add i32 %b.0, 1		; <i32> [#uses=0]
	ret void
}

define i32 @main() nounwind  {
entry:
	call void @f1( i32 1, i64 2 )
	ret i32 0
}

This seems like it would trigger a lot for code that passes around small
structs (e.g. SDOperand's or _Complex)...

llvm-svn: 45886
2008-01-11 22:31:41 +00:00
Duncan Sands 0ebaf91f48 Two occurrences on one line count as one...
llvm-svn: 45885
2008-01-11 21:46:24 +00:00
Duncan Sands 7e46c50c6a If there are attributes on the varargs part of a
call, don't discard them.

llvm-svn: 45884
2008-01-11 21:23:39 +00:00
Scott Michel a8f67e04bd More CellSPU refinements:
- struct_2.ll: Completely unaligned load/store testing

- call_indirect.ll, struct_1.ll: Add test lines to exercise
   X-form [$reg($reg)] addressing

At this point, loads and stores should be under control (he says
in an optimistic tone of voice.)

llvm-svn: 45882
2008-01-11 21:01:19 +00:00
Dale Johannesen 04b99780cf Disable for now.
llvm-svn: 45881
2008-01-11 20:47:33 +00:00
Ted Kremenek 8d71e25590 Fix misspelling of "existent".
Do not use std::cerr; use llvm::cerr instead.

Patch provided by Sam Bishop!

llvm-svn: 45880
2008-01-11 20:42:05 +00:00
Chris Lattner b66fbdde42 Use smallptrset instead of std::set for efficiency.
llvm-svn: 45878
2008-01-11 19:36:30 +00:00
Chris Lattner 4a70261f00 a byval argument is guaranteed to be valid to load.
llvm-svn: 45877
2008-01-11 19:34:32 +00:00
Chris Lattner 4062a625e5 Update this code to use eraseFromParent where possible. Compute
whether an argument is byval and pass into isSafeToPromoteArgument.

llvm-svn: 45876
2008-01-11 19:20:39 +00:00
Chris Lattner e736e55d3c replace a loop with a constant time check.
llvm-svn: 45875
2008-01-11 18:55:10 +00:00
Chris Lattner 669e7054ca another minor datastructure tweak.
llvm-svn: 45874
2008-01-11 18:47:45 +00:00
Chris Lattner a8ba28f6e4 start using smallvector to avoid vector heap thrashing.
llvm-svn: 45873
2008-01-11 18:43:58 +00:00
Chris Lattner c70ed4ba5b add operator==/!= to smallvector.
llvm-svn: 45872
2008-01-11 18:42:02 +00:00
Chris Lattner 596875118c rename MachineInstr::setInstrDescriptor -> setDesc
llvm-svn: 45871
2008-01-11 18:10:50 +00:00
Chris Lattner 806dd0e2ac remove xchg and shift-reg-by-1 instructions, which are dead.
llvm-svn: 45870
2008-01-11 18:00:50 +00:00
Chris Lattner ff5998e66b add a note, remove a done deed.
llvm-svn: 45869
2008-01-11 18:00:13 +00:00
Arnold Schwaighofer 06da9e2d43 hrm - correct spelling.
Actually were not riding any arguments. Sadly there is no semantic spell checker that is going to safe you from such a mistake.

llvm-svn: 45868
2008-01-11 17:10:15 +00:00
Arnold Schwaighofer 6cf72fbbaf Improve tail call optimized call's argument lowering. Before this
commit all arguments where moved to the stack slot where they would
reside on a normal function call before the lowering to the tail call
stack slot. This was done to prevent arguments overwriting each other.
Now only arguments sourcing from a FORMAL_ARGUMENTS node or a
CopyFromReg node with virtual register (could also be a caller's
argument) are lowered indirectly.

 --This line, and those below, will be ignored--

M    X86/X86ISelLowering.cpp
M    X86/README.txt

llvm-svn: 45867
2008-01-11 16:49:42 +00:00
Ted Kremenek 5906b9e79a Added ProgramPoint.cpp, which implements several methods of the subclasses
of ProgramPoint.

llvm-svn: 45866
2008-01-11 16:36:20 +00:00
Arnold Schwaighofer bf1816ea7b Correct a copy and paste error.
llvm-svn: 45865
2008-01-11 14:34:56 +00:00
Evan Cheng ef5285ef88 Some C backend ByVal parameter attribute support. Not yet complete.
llvm-svn: 45864
2008-01-11 09:12:49 +00:00
Evan Cheng 8c51394e01 Rename Int_CVTSI642SSr* to Int_CVTSI2SS64r* for naming consistency and remove unused instructions.
llvm-svn: 45861
2008-01-11 07:37:44 +00:00
Chris Lattner 9283173061 more flags set right
llvm-svn: 45860
2008-01-11 07:18:17 +00:00
Chris Lattner f4b0c99d63 add some missing flags.
llvm-svn: 45859
2008-01-11 06:59:07 +00:00
Chris Lattner 6d7cf509d1 don't include loopinfo.h from this file.
llvm-svn: 45858
2008-01-11 06:30:04 +00:00
Chris Lattner b3220147d2 Move typedef of loop to top of the file where it is more obvious.
llvm-svn: 45857
2008-01-11 06:29:42 +00:00
Chris Lattner b97b83fbf7 Fix 80 col violations
llvm-svn: 45856
2008-01-11 06:27:42 +00:00
Chris Lattner 5cee13f1df document the byval parameter attribute.
llvm-svn: 45855
2008-01-11 06:20:47 +00:00
Chris Lattner 87b0c13104 add some notes.
llvm-svn: 45854
2008-01-11 06:17:47 +00:00
Chris Lattner 908117bf69 When inlining a functino with a byval argument, make an explicit
copy of it in case the callee modifies the struct.

llvm-svn: 45853
2008-01-11 06:09:30 +00:00
Evan Cheng aaef8ce856 A couple of obvious off-by-one bugs.
llvm-svn: 45852
2008-01-11 03:07:46 +00:00
Scott Michel 8d5841ae3c More CellSPU refinement and progress:
- Cleaned up custom load/store logic, common code is now shared [see note
  below], cleaned up address modes

- More test cases: various intrinsics, structure element access (load/store
  test), updated target data strings, indirect function calls.

Note: This patch contains a refactoring of the LoadSDNode and StoreSDNode
structures: they now share a common base class, LSBaseSDNode, that
provides an interface to their common functionality. There is some hackery
to access the proper operand depending on the derived class; otherwise,
to do a proper job would require finding and rearranging the SDOperands
sent to StoreSDNode's constructor. The current refactor errs on the
side of being conservatively and backwardly compatible while providing
functionality that reduces redundant code for targets where loads and
stores are custom-lowered.

llvm-svn: 45851
2008-01-11 02:53:15 +00:00
Evan Cheng 4cc275c3fb Allow parameter attributes on varargs function parameters.
llvm-svn: 45850
2008-01-11 02:13:09 +00:00
Dale Johannesen 193daf0698 Weak zeroes don't go in bss on Darwin.
llvm-svn: 45849
2008-01-11 01:59:45 +00:00
Dale Johannesen 2ff66f08f2 Weak things initialized to 0 don't go in bss on Darwin.
Cosmetic changes to spacing to match gcc (some dejagnu
tests actually care).

llvm-svn: 45848
2008-01-11 00:54:37 +00:00
Ted Kremenek b1dec454bb Renamed ProgramEdge.h to ProgramPoint.h
llvm-svn: 45847
2008-01-11 00:43:12 +00:00
Ted Kremenek e5ccf9a96c Renamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdge
to have a much simpler, cleaner interpretation of what is a "location"
in a function (as encoded by a CFG).

llvm-svn: 45846
2008-01-11 00:40:29 +00:00
Ted Kremenek d7a7abed62 Fixed 80-col violation.
llvm-svn: 45845
2008-01-11 00:18:40 +00:00
Chris Lattner c8226f32e9 Simplify the side effect stuff a bit more and make licm/sinking
both work right according to the new flags.

This removes the TII::isReallySideEffectFree predicate, and adds
TII::isInvariantLoad. 

It removes NeverHasSideEffects+MayHaveSideEffects and adds
UnmodeledSideEffects as machine instr flags.  Now the clients
can decide everything they need.

I think isRematerializable can be implemented in terms of the
flags we have now, though I will let others tackle that.

llvm-svn: 45843
2008-01-10 23:08:24 +00:00
Fariborz Jahanian af5d80cba5 Avoid redefinition of __objcFastEnumerationState
llvm-svn: 45842
2008-01-10 23:04:06 +00:00
Chris Lattner f3bd2cd37c Clamp down on sinking of lots of instructions.
llvm-svn: 45841
2008-01-10 22:35:15 +00:00
Steve Naroff 98f7203680 - Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I noticed it was missing).
- Rename CheckInitializer() to CheckInitializerTypes().
- Removed the isStatic argument to CheckInitializerTypes() and all of it's subroutines. Checking for constant expressions is now done separately.
- Added CheckForConstantInitializer().

llvm-svn: 45840
2008-01-10 22:15:12 +00:00
Fariborz Jahanian 939776756f Recover from user typo not having proper @interface decl and a bad foreach decl.
llvm-svn: 45839
2008-01-10 20:33:58 +00:00