Commit Graph

39581 Commits

Author SHA1 Message Date
Chris Lattner 317332fc2a Start inferring side effect information more aggressively, and fix many bugs in the
x86 backend where instructions were not marked maystore/mayload, and perf issues where
instructions were not marked neverHasSideEffects.  It would be really nice if we could
write patterns for copy instructions.

I have audited all the x86 instructions down to MOVDQAmr.  The flags on others and on
other targets are probably not right in all cases, but no clients currently use this
info that are enabled by default.

llvm-svn: 45829
2008-01-10 07:59:24 +00:00
Evan Cheng 4c1f731905 Clearify the meaning of immutable StackObject.
llvm-svn: 45828
2008-01-10 07:19:43 +00:00
Chris Lattner 70ddafaf45 Fix a crash on code like: let x = 1 {x
llvm-svn: 45827
2008-01-10 07:01:53 +00:00
Chris Lattner 2e38f2458c rename X86InstrX86-64.td -> X86Instr64bit.td
llvm-svn: 45826
2008-01-10 05:50:42 +00:00
Chris Lattner 520d4adad3 add SDNPSideEffect node property declaration
llvm-svn: 45825
2008-01-10 05:48:23 +00:00
Chris Lattner aca7ca3730 remove explicit sets of 'neverHasSideEffects' that can now be
inferred from the instr patterns.

llvm-svn: 45824
2008-01-10 05:45:39 +00:00
Chris Lattner 86c458a178 if an instr lacks a pattern, assume it has side effects (unless never has s-e is true).
llvm-svn: 45823
2008-01-10 05:40:54 +00:00
Chris Lattner 42c63ef96e start inferring 'no side effects'.
llvm-svn: 45822
2008-01-10 05:39:30 +00:00
Chris Lattner 94de7bc3aa get def use info more correct.
llvm-svn: 45821
2008-01-10 05:12:37 +00:00
Ted Kremenek aa8c904dfc Added some text about the ccc script provided by Sanghyeon Seo.
llvm-svn: 45820
2008-01-10 04:59:05 +00:00
Chris Lattner 9e69654461 Infer mayload
llvm-svn: 45819
2008-01-10 04:44:48 +00:00
Chris Lattner c72335878d add SDNPMayLoad to the 'load' sdnode definition. This is enough to get all the x86
instructions (with patterns) that load memory marked, for example.

llvm-svn: 45818
2008-01-10 04:44:32 +00:00
Chris Lattner 1ca2068227 realize that instructions who match intrinsics that read memory read memory.
Also, instructions with any nodes that are SDNPMayLoad also read memory.

llvm-svn: 45817
2008-01-10 04:38:57 +00:00
Chris Lattner f171482a66 verify that the frame index is immutable before remat'ing (still disabled)
or being side-effect free.

llvm-svn: 45816
2008-01-10 04:16:31 +00:00
Owen Anderson d445b8813f Don't use LiveVariables::VarInfo::DefInst.
llvm-svn: 45815
2008-01-10 03:12:54 +00:00
Evan Cheng 0f8c7c4a73 Codegen improvement has reduced one spill.
llvm-svn: 45814
2008-01-10 02:54:40 +00:00
Evan Cheng a26552493b Mark byval parameter stack objects mutable for now.
llvm-svn: 45813
2008-01-10 02:24:25 +00:00
Evan Cheng 301b0cade5 Add a isImmutable bit to StackObject. Fixed stack objects are immutable (in the function) unless specified otherwise.
llvm-svn: 45812
2008-01-10 02:18:37 +00:00
Dale Johannesen 7ecb3b79c7 Emit unused EH frames for weak definitions on Darwin,
because assembler/linker can't cope with weak absolutes.
PR 1880.

llvm-svn: 45811
2008-01-10 02:03:30 +00:00
Chris Lattner 2cbf2f39ee add support for the GCC -include option.
llvm-svn: 45810
2008-01-10 01:53:41 +00:00
Seo Sanghyeon 77133e6d30 Compiler driver
llvm-svn: 45809
2008-01-10 01:43:47 +00:00
Chris Lattner bceeefdc9c Fix some 80 col violations
llvm-svn: 45808
2008-01-10 01:43:14 +00:00
Chris Lattner d2cdb97747 Ted apparently likes crazy whitespace at the end of line. Crush his spirit by
removing them, fitting the file into 80 columns. :)

llvm-svn: 45807
2008-01-10 01:41:55 +00:00
Fariborz Jahanian 7262fca0a6 Put return type of synthesize method on same line as method declaration, space after method declaration header.
llvm-svn: 45806
2008-01-10 01:39:52 +00:00
Owen Anderson 4f45cef2f9 Get rid of all uses of LiveVariables::VarInfo::DefInst in favor of the equivalent API from
MachineRegisterInfo.  Once all clients are switched over, the former will be going away.

llvm-svn: 45805
2008-01-10 01:36:43 +00:00
Chris Lattner cb0e1bcf0c provide def_* and use_* iterators in addition to reg_* iterators.
The first only returns definitions of a register, the second only
returns uses, the third returns both.

llvm-svn: 45803
2008-01-10 01:01:27 +00:00
Ted Kremenek 3d55c84c99 Added "InfeasibleEdge" to represent an infeasible state transition.
llvm-svn: 45802
2008-01-10 00:58:25 +00:00
Owen Anderson 51b8e20ccf Add more comments explaining the basics of how the decision of when to rename and when to insert
copies is made.

llvm-svn: 45799
2008-01-10 00:47:01 +00:00
Evan Cheng fead113fe0 Do not use the stack pointer directly, issue a copyfromreg instead. Otherwise we can end up with something like ADD32ri %esp, x which two-address pass won't like.
llvm-svn: 45798
2008-01-10 00:37:26 +00:00
Owen Anderson 8958a78576 Get rid of the isKillInst predicate. LiveVariables already provides this information.
llvm-svn: 45797
2008-01-10 00:33:11 +00:00
Chris Lattner ec79bba97f Fix PR1845 and rdar://5676945. Generic vectors smaller
than hardware supported type will be scalarized, so we
can infer their alignment from that info.

We now codegen pr1845 into:

_boolVectorSelect:
	lbz r2, 0(r3)
	stb r2, -16(r1)
	blr 

llvm-svn: 45796
2008-01-10 00:30:57 +00:00
Chris Lattner e34d7d0e24 new testcase for PR1845
llvm-svn: 45795
2008-01-10 00:30:38 +00:00
Fariborz Jahanian db701b47d2 Pass rewritten output to 'clang' for verification.
llvm-svn: 45794
2008-01-10 00:30:24 +00:00
Fariborz Jahanian 82ae0152a7 Allow messaging expression as foreach's collection expression.
llvm-svn: 45793
2008-01-10 00:24:29 +00:00
Evan Cheng 73d1017871 Remove comments that do not correspond to anything after recent refactoring.
llvm-svn: 45792
2008-01-10 00:09:10 +00:00
Owen Anderson 1c8152ba03 Copies need to be inserted before the first terminator, not at the end of the block.
llvm-svn: 45791
2008-01-10 00:01:41 +00:00
Steve Naroff a385fb8c2e Add a FIXME to commit r45784. Thanks mrs!
llvm-svn: 45790
2008-01-09 23:44:05 +00:00
Steve Naroff e6b0ec8b5e Fix Sema::ActOnDeclarator() to call MergeFunctionDecl for function decls that aren't in scope. Since C functions are in a flat namespace, we need to give them special treatment (when compared with variables and typedefs).
llvm-svn: 45789
2008-01-09 23:34:55 +00:00
Ted Kremenek 24ea11d4e0 Renamed various traits and classes. Added "Infeasible" bit to ExplodedNodeImpl
so that nodes can be marked as representing an infeasible program point. This
flag lets the path-sensitive solver know that no successors should be generated
for such nodes.

llvm-svn: 45788
2008-01-09 23:11:36 +00:00
Evan Cheng 0e400d4cb7 Special copy SUnit's do not have SDNode's.
llvm-svn: 45787
2008-01-09 23:01:55 +00:00
Ted Kremenek 84ab850e46 Renamed Stmt***Edge and ***StmtEdge (where *** = "Stmt" or "Blk") classes to
BExpr*** and ***BExpr respectively. These edges represent program locations
between the entrance/exit of a block and Block-level Expressions.

Also added ***SExpr and SExpr*** ProgramEdges to represent the locations in the
program between the evaluation of subexpressions and block-level expressions.

llvm-svn: 45786
2008-01-09 22:52:38 +00:00
Ted Kremenek fed4cce0cc Removed some files related to the path-sensitive solver as part of some
code restructuring.  (new files will be introduced shortly)

llvm-svn: 45785
2008-01-09 22:49:37 +00:00
Steve Naroff c6edcbdb5d Fix ASTContext::typesAreCompatible to allow for int/enum compatibility (C99 6.7.2.2p4).
Fix Sema::MergeFunctionDecl to allow for function type compatibility (by using the predicate on ASTContext). Function types don't have to be identical to be compatible...

llvm-svn: 45784
2008-01-09 22:43:08 +00:00
Owen Anderson 436db42a3c Clean up StrongPHIElimination a bit, and add some more comments to the internal structures. There's
still more work to do on this front.

llvm-svn: 45783
2008-01-09 22:40:54 +00:00
Steve Naroff 08ddb8c55c Teach Sema::ActOnCompoundLiteral about constraint C99 6.5.2.5p3.
llvm-svn: 45782
2008-01-09 20:58:06 +00:00
Duncan Sands 48f22f0b80 Fix compile failures with g++-4.3.
llvm-svn: 45781
2008-01-09 19:42:09 +00:00
Chris Lattner 204e4a27b6 many cleanups and fixed, contributed by Sam Bishop
llvm-svn: 45780
2008-01-09 19:28:50 +00:00
Chris Lattner 119d81a4f4 Fix isIntegerConstantExpr to compare against zero for casts to bool instead of
truncating.  This allows us to compile:
 void foo() {
  static _Bool foo = 4;
}

into:
@foo1 = internal global i8 1
instead of:
@foo1 = internal global i8 4

llvm-svn: 45779
2008-01-09 18:59:34 +00:00
Chris Lattner 41a1ef0dfe implement proper support for _Bool in memory, which is usually i8, not i1.
This fixes a crash reported by Seo Sanghyeon

llvm-svn: 45778
2008-01-09 18:47:25 +00:00
Fariborz Jahanian 6fa7516bc9 Type-cast RHS of assignment to prevent warning compiling rewritten foreach code.
llvm-svn: 45777
2008-01-09 18:15:42 +00:00