Commit Graph

8174 Commits

Author SHA1 Message Date
Daniel Dunbar d39e0974fe Add IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
- Names are lame, but it seems better to be explicit.

llvm-svn: 66295
2009-03-06 22:26:07 +00:00
Daniel Dunbar dcf8d3c9eb Add Module::getNamedValue; use to normalize access to Module symbol
table.
 - No functionality change.

llvm-svn: 66289
2009-03-06 22:04:43 +00:00
Tanya Lattner 8498d2dd2b Add default constructor to SDNode to make gcc 3.4.6 happy.
llvm-svn: 66280
2009-03-06 18:17:45 +00:00
Chris Lattner 040ce02174 some nits noticed by Duncan
llvm-svn: 66274
2009-03-06 17:05:04 +00:00
Chris Lattner a59518276e fix header comment and include guard.
llvm-svn: 66273
2009-03-06 16:54:19 +00:00
Chris Lattner e48f897ca7 add a bunch more passes to the C bindings (PR3734), patch by
Lennart Augustsson!

llvm-svn: 66272
2009-03-06 16:52:18 +00:00
Chris Lattner 4c1e9541d3 Sprinkle some PrettyStackEntry magic into the passmanager. With this, we now
get nice and happy stack traces when we crash in an optimizer or codegen.  For
example, an abort put in UnswitchLoops now looks like this:

Stack dump:
0.	Program arguments: clang pr3399.c -S -O3 
1.	<eof> parser at end of file
2.	per-module optimization passes
3.	Running pass 'CallGraph Pass Manager' on module 'pr3399.c'.
4.	Running pass 'Loop Pass Manager' on function '@foo'
5.	Running pass 'Unswitch loops' on basic block '%for.inc'
Abort

llvm-svn: 66260
2009-03-06 06:45:05 +00:00
Gabor Greif b3805878d1 do not close friendship with every odd class
llvm-svn: 66229
2009-03-06 01:09:27 +00:00
Devang Patel 0c970f94e9 Add "check/remove dbg var" helper routines.
llvm-svn: 66223
2009-03-06 00:19:37 +00:00
Nick Lewycky c540cc6591 Regenerate.
llvm-svn: 66157
2009-03-05 08:20:44 +00:00
Gabor Greif ebd4998c1f ooops, forgot to include the pointless-write eliminator in my previous checkin
llvm-svn: 66081
2009-03-04 21:54:31 +00:00
Dale Johannesen a31552c151 Add some cautionary comments.
llvm-svn: 66080
2009-03-04 21:53:29 +00:00
Chris Lattner 68061d5995 add some helper classes for building light-weight symbolic stack traces
that get printed when a program crashes.  This is the first step of many.

llvm-svn: 66076
2009-03-04 21:40:23 +00:00
Dale Johannesen df4226c0e2 Re-commit 65975 and a fix for the problem that
was causing llvm-gcc to fail to build.  I've
verified it bootstraps now; good enough for me.

llvm-svn: 66073
2009-03-04 21:24:04 +00:00
Chris Lattner 4fdd042d9e Add a new 'AddSignalHandler' function to Signals.h that allows
arbitrary functions to be run when a crash happens.  Delete 
RemoveDirectoryOnSignal as it is dead and has never had clients.

Change PrintStackTraceOnErrorSignal to be implemented in terms of
AddSignalHandler.

I updated the Win32 versions of these APIs, but can't test them.
If there are any problems, I'd be happy to fix them as well.

llvm-svn: 66072
2009-03-04 21:21:36 +00:00
Gabor Greif de2fb05246 Give sentinel traits the right to determine the policy where the sentinel is kept.
This should result in less indirect memory accesses, less dead writes and tighter code.

llvm-svn: 66061
2009-03-04 20:36:44 +00:00
Gabor Greif a954a99c40 "Ghostify" embedded sentinels. This is a real win in all cases
because less bytes are allocated and subobject construction is gone.
For reference how it works, see BasicBlock.h.
Btw. it is very assuring to see that somebody has invented
this ilist-embedded sentinel technique before me :-)

llvm-svn: 66026
2009-03-04 06:57:48 +00:00
Dale Johannesen 159d2159ee Temporarily revert 65975, which breaks the llvm-gcc build.
While the patch is clearly correct in itself, it's become
apparent other places are assuming debug intrinsics are
marked as touching memory...this needs more testing.

llvm-svn: 65992
2009-03-04 01:14:28 +00:00
Devang Patel 8720a0b9a7 Dbg Intrinsics do not access memory.
llvm-svn: 65975
2009-03-03 22:33:54 +00:00
Dan Gohman 9a8a28da99 Make a comment less terse.
llvm-svn: 65953
2009-03-03 17:44:54 +00:00
Dan Gohman 92b551bc2b Fix a bunch of Doxygen syntax issues. Escape special characters,
and put @file directives on their own comment line.

llvm-svn: 65920
2009-03-03 02:55:14 +00:00
Dale Johannesen e1bb2f86f9 When sinking an insn in InstCombine bring its debug
info with it.
Don't count debug info insns against the scan maximum
in FindAvailableLoadedValue (lest they affect codegen).

llvm-svn: 65910
2009-03-03 01:09:07 +00:00
Bob Wilson 85cefe8567 Generalize BuildVectorSDNode::isConstantSplat to use APInts and handle
arbitrary vector sizes.  Add an optional MinSplatBits parameter to specify
a minimum for the splat element size.  Update the PPC target to use the
revised interface.

llvm-svn: 65899
2009-03-02 23:24:16 +00:00
Gabor Greif 659b0f3063 drop support for GCC 2.x as it is hopelessly broken anyway
llvm-svn: 65864
2009-03-02 19:49:29 +00:00
Gabor Greif 1ab00bf883 Declare Sentinel fragments as mutable to get rid
of some pointless casting. This fragment logically
does not belong to ilist anyway, but to "ghostly"
NodeType.

llvm-svn: 65843
2009-03-02 14:47:45 +00:00
Gabor Greif 502bf8d994 remove a deprecated interface that was pretty useless
llvm-svn: 65842
2009-03-02 12:42:07 +00:00
Gabor Greif 21e3ec35fe fix typo
llvm-svn: 65839
2009-03-02 12:10:56 +00:00
Mikhail Glushenkov ecfab627fd Move code from Main.cpp to the include dir.
User drivers based on llvmc must all share the initialization code.
Putting main() into libCompilerDriver is not a very good idea IMO (and ld gave
me some strange EH-related error anyway).

llvm-svn: 65825
2009-03-02 09:03:02 +00:00
Mikhail Glushenkov f552ed69f9 Cosmetic fixes: include guards.
llvm-svn: 65824
2009-03-02 09:02:28 +00:00
Mikhail Glushenkov a9780b2202 Plugin::Priority() doesn't need to be pure virtual.
llvm-svn: 65823
2009-03-02 09:02:01 +00:00
Mikhail Glushenkov 661f4c9131 Add a comment.
llvm-svn: 65822
2009-03-02 09:01:39 +00:00
Mikhail Glushenkov 931d4521c3 Reorganize llvmc code.
Move the code from 'llvmc/driver' into a new CompilerDriver library, and change
the build system accordingly. Makes it easier for projects using LLVM to build
their own llvmc-based drivers.

Tested with objdir != srcdir.

llvm-svn: 65821
2009-03-02 09:01:14 +00:00
Gabor Greif 144fa6a08a Another sentinel optimization. This one should always
be a win, since almost every interesting function has at least one Argument.

llvm-svn: 65778
2009-03-01 17:13:15 +00:00
Gabor Greif 6f8d4ae3c0 Reuse a technique (pioneered for BasicBlocks) of superposing ilist with
its sentinel. This is quite a win when a function really has a basic block.                  
When the function is just a declaration (and stays so) the old way did not
allocate a sentinel. So this change is most beneficial when the ratio of
function definition to declaration is high. I.e. linkers etc. Incidentally  
these are the most resource demanding applications, so I expect that the
reduced malloc traffic, locality and space savings outweigh the cost of
addition of two pointers to Function.

llvm-svn: 65776
2009-03-01 16:38:10 +00:00
Gabor Greif b122c4cb1d fix a comment
llvm-svn: 65768
2009-03-01 09:45:52 +00:00
Gabor Greif 19b2d443b5 Fix a typo. Thanks baldrick!
llvm-svn: 65767
2009-03-01 09:43:41 +00:00
Chris Lattner 242d91a476 simplify handling "don't print top level name" processing, so that we get
stuff like %A = type { %A*} instead of an upref.

llvm-svn: 65748
2009-03-01 01:16:21 +00:00
Bob Wilson d8ea0e144e Combine PPC's GetConstantBuildVectorBits and isConstantSplat functions to a new
method in a BuildVectorSDNode "pseudo-class".

llvm-svn: 65747
2009-03-01 01:13:55 +00:00
Chris Lattner 92c5c12bdb move type name population out of TypePrinting class into a static
AsmWriter.cpp method.

llvm-svn: 65736
2009-02-28 23:20:19 +00:00
Chris Lattner b543cae7d6 delete a bunch of duplicated type printing logic, using the type printing
stuff in AsmWriter.cpp for Type::getDescription().

llvm-svn: 65734
2009-02-28 23:01:57 +00:00
Gabor Greif d07987f5b6 add description how the ilist_traits<Instruction> works
llvm-svn: 65732
2009-02-28 22:46:37 +00:00
Chris Lattner faaa7ac1f2 the module is not required to exist, allow it to default, giving this
class a nice default ctor.

llvm-svn: 65731
2009-02-28 22:41:33 +00:00
Chris Lattner 3a5e4d7a2e disable copying and assignment.
llvm-svn: 65730
2009-02-28 22:35:24 +00:00
Chris Lattner 3ad4682b23 expose TypePrinting as a public API.
llvm-svn: 65729
2009-02-28 22:34:45 +00:00
Chris Lattner 24025261d3 Change WriteTypeSymbolic to not put a space out before types, also, remove
the old std::ostream version.

llvm-svn: 65720
2009-02-28 21:05:51 +00:00
Gabor Greif e57d407fc2 make traits more flexible by splitting out node-related fragment
llvm-svn: 65690
2009-02-28 10:17:32 +00:00
Evan Cheng 2f235908ed Avoid unused parameter warning.
llvm-svn: 65670
2009-02-28 01:10:24 +00:00
Gabor Greif 97084b8481 group friendship
llvm-svn: 65633
2009-02-27 15:46:23 +00:00
Rafael Espindola 000421eade Refactor TLS code and add some tests. The tests and expected results are:
pic |  declaration | linkage  | visibility |

!pic |  declaration | external | default    | tls1.ll     tls2.ll     | local exec
 pic |  declaration | external | default    | tls1-pic.ll tls2-pic.ll | general dynamic
!pic | !declaration | external | default    | tls3.ll     tls4.ll     | initial exec
 pic | !declaration | external | default    | tls3-pic.ll tls4-pic.ll | general dynamic

!pic |  declaration | external | hidden     | tls7.ll     tls8.ll     | local exec
 pic |  declaration | external | hidden     | X                       | local dynamic
!pic | !declaration | external | hidden     | tls9.ll     tls10.ll    | local exec
 pic | !declaration | external | hidden     | X                       | local dynamic

!pic |  declaration | internal | default    | tls5.ll     tls6.ll     | local exec
 pic |  declaration | internal | default    | X                       | local dynamic

The ones marked with an X have not been implemented since local dynamic is not implemented.

llvm-svn: 65632
2009-02-27 13:37:18 +00:00
Gabor Greif 3e2acf9508 fix comments
llvm-svn: 65627
2009-02-27 09:33:37 +00:00