Commit Graph

1397 Commits

Author SHA1 Message Date
Chris Lattner
fe3db46fe0 Parse the %*# constraint modifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26341 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-23 23:36:53 +00:00
Evan Cheng
aea20f50e5 Added x86 integer vector types: 64-bit packed byte integer (v16i8), 64-bit
packed word integer (v8i16), and 64-bit packed doubleword integer (v2i32).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26294 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-20 22:34:53 +00:00
Chris Lattner
ed1e1e232f Another work around for the 'symbols with different types can have the same
name' issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26149 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-13 21:43:26 +00:00
Chris Lattner
2f0eec6520 validate matching constraints and remember when we see them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25892 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-02 00:23:53 +00:00
Jeff Cohen
09f0bd39b1 Fix VC++ compilation error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25869 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-01 04:37:04 +00:00
Chris Lattner
a55079a5cc Beef up the interface to inline asm constraint parsing, making it more general, useful, and easier to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25866 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-01 01:29:47 +00:00
Reid Spencer
e2a5fb0e08 Fix auto-upgrade of intrinsics to work properly with both assembly and
bytecode reading. This code is crufty, the result of much hacking to get things
working correctly. Cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25682 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 11:49:27 +00:00
Chris Lattner
f0b415f178 add method for constraint parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25637 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 02:21:59 +00:00
Chris Lattner
3b91778659 parse and verify the constraint string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25631 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 00:48:33 +00:00
Chris Lattner
3188b73642 Make sure the only user of InlineAsm's are direct calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25626 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 00:08:45 +00:00
Chris Lattner
80cd115618 Print InlineAsm objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25617 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 22:26:05 +00:00
Chris Lattner
863517aea0 Change inline asms to be uniqued like constants, not embedded in a Module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 18:57:27 +00:00
Chris Lattner
cc041ba03a Initial checkin of the InlineAsm class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25570 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 04:13:11 +00:00
Chris Lattner
42a162ed80 Pretty print file-scope asm blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25568 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 00:45:30 +00:00
Chris Lattner
71cdba3177 syntax change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25567 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 00:40:17 +00:00
Chris Lattner
18365506eb Print out inline asm strings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25556 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 23:03:36 +00:00
Reid Spencer
c79925a395 For PR411:
No functionality changes, just improve the code by a) providing better
function names, b) eliminating a call to get_suffix and c) tightening up
a function elimination test to reduce further checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25540 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 07:42:30 +00:00
Chris Lattner
1ac2d51806 Speedup and simplify pass registration by the observation that there is
exactly one PassInfo object per RegisterPass object and that their lifetimes
are the same.  As such, there is no reason for the RegisterPass object to
dynamically allocate the PassInfo object at compiler startup time: just inline
the object by-value.  This should reduce codesize, heap size, and startup time. Yaay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 01:01:04 +00:00
Chris Lattner
f690bc8c07 Remove dead expression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25480 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-20 18:04:43 +00:00
Chris Lattner
75d3226b5e Don't use invalidated use_iterator's. This fixes a crash compiling povray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25479 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-20 18:01:41 +00:00
Reid Spencer
e559184d70 Don't forget about casting the result of an upgraded call to an intrinsic
in the case where it needs to cast back to a signed type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25447 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 07:00:29 +00:00
Reid Spencer
ff696cc1fc Make get_suffix faster by using a switch on getTypeID rather than a series
of comparisons on the various type objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 05:37:27 +00:00
Reid Spencer
d615bd9013 Don't accept the ctpop, cttz, or ctlz intrinsics with signed arguments. The
interface requires unsigned arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25433 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 01:20:03 +00:00
Reid Spencer
4283ac7857 Add a new interface function to AutoUpgrade for simultaneously upgrading
the Function and the CallInst: UpgradeCallsToIntrinsic(Function*). Also,
re-factor the AutoUpgrade implementation to eliminate some duplication of
code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25432 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 01:18:29 +00:00
Robert Bocchino
c152f9cd26 VMCore support for the insertelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25408 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 20:07:22 +00:00
Reid Spencer
0b118206bf For PR411:
This patch is an incremental step towards supporting a flat symbol table.
It de-overloads the intrinsic functions by providing type-specific intrinsics
and arranging for automatically upgrading from the old overloaded name to
the new non-overloaded name. Specifically:
  llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64
  llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64
  llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64
  llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64
  llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64
New code should not use the overloaded intrinsic names. Warnings will be
emitted if they are used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-16 21:12:35 +00:00
Reid Spencer
e86bf519e1 For PR411:
This file makes the helper functions for auto-upgrade of llvm assembly and
bytecode more accessible. This is part of de-overloading of intrinsic
functions to support the flat symbol table (no type planes).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25365 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-16 21:06:01 +00:00
Chris Lattner
e2ba1b32ec Thanks to Daniel Berlin's ETForest fix, we can now use it again for the verifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25345 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-15 21:58:50 +00:00
Chris Lattner
14c02b752a ET-Forest has issues with unreachable blocks. Temporarily disable verifiers use
of it until they are resolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25341 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-15 20:00:51 +00:00
Chris Lattner
3776fea371 add a missing break that Reid noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25328 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-15 08:40:16 +00:00
Chris Lattner
25abb1dc09 Change ET-Forest to automatically recalculate its DFSnum's if too many slow
queries are made.

Patch by Daniel Berlin!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25323 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-14 20:55:09 +00:00
Nate Begeman
6fb3bd6a65 Add bswap intrinsics as documented in the Language Reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25309 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-14 01:25:24 +00:00
Chris Lattner
71d0e3de8d Add recognition and verification of new llvm.stacksave/llvm.stackrestore intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25266 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 02:15:39 +00:00
Chris Lattner
d9d681d128 Patch #10 from Saem:
"Extracts a few more methods, reduces some redundancy in the code at
the same time."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25248 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-12 16:48:23 +00:00
Chris Lattner
0b2192c99b Convert the verifier over to use ETForest instead of DominatorSet. Patch
by Daniel Berlin


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25242 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-12 06:17:59 +00:00
Jeff Cohen
df46b26d94 Fix VC++ compilation error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25214 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 16:21:23 +00:00
Chris Lattner
3159048c00 Patch #9 from Saem:
"Cut up the runPasses method into smaller pieces.  The small private
helpers should  be easier to deal with when code shuffling arising
from creating the new specialised batchers, not to mention, they're
much easier to understand.

I inlined them, in case function call overhead would be noticeable --
doubtful."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25213 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 16:14:49 +00:00
Chris Lattner
a2664c50d6 Simple is good. CVS is for revision control, not file headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25206 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 05:39:45 +00:00
Chris Lattner
f1b59d4172 Simple is good
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25205 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 05:38:55 +00:00
Robert Bocchino
bb90a7aa7b Added constant folding support for the extractelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25187 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 20:03:46 +00:00
Robert Bocchino
b52ee7f5ff Added support for the extractelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25181 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 19:05:34 +00:00
Reid Spencer
eb7116bb08 For PR411:
First step in refactoring the SymbolTable is to split it into two classes,
one for a symbol table of types and one for a symbol table of Values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25175 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 09:51:48 +00:00
Chris Lattner
6b135b74bd Bugfix for etforest updating. Contributed by Daniel Berlin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25152 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-09 07:58:01 +00:00
Reid Spencer
d41c981c39 Saem Ghani's PassManager Patch #8:
This fixes a "gccass" regression. The -debug-pass=Structure option now
prints all the appropriate output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25151 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-08 22:57:07 +00:00
Chris Lattner
ccacd3ccc2 Initial implementation of the ET-Forest data structure for dominators and
post-dominators.  This code was written/adapted by Daniel Berlin!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25144 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-08 08:22:18 +00:00
Chris Lattner
d659360e58 Patch #7 from Saem:
"added the asserts and casts, fixed the comments and started the break
down of the larger methods.  A few more patches and the breakdown
should be complete."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25142 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-07 23:16:58 +00:00
Chris Lattner
2f690c84fa Implement a few symbolic constant folding things. X ? Y : Y is Y.
Fold:
seteq ({ short }* cast (int 1 to { short }*), { short }* null)
setlt ({ short }* cast (int 1 to { short }*), { short }* cast (int 2 to { short }*))

to false/true.  These last two commonly occur in the output of compilers that
tag integers, like cozmic's scheme compiler.

Tested by Regression/Assembler/ConstantExprFold.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25112 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-05 07:49:30 +00:00
Chris Lattner
2c822cce61 fix some formatting problems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25110 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-05 07:19:51 +00:00
Chris Lattner
7f7b730d79 Patch #6's in Saem's refactor-the-passmanager patch series. From him:
This sanitises the world, blows away the specialisations and adds
traits per passmanager type -- seemed most natural.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25085 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 07:47:13 +00:00
Chris Lattner
eadf7a3541 Saem's patch #5 of the passmanager refactoring
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25078 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 05:02:04 +00:00
Chris Lattner
53745b852d patch #4 in Saem's passmanager refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25077 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 04:36:11 +00:00
Chris Lattner
84e1064f45 implement constant folding of ==/!= on constant packed, simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25074 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 02:20:54 +00:00
Chris Lattner
d2a7ea45b0 implement constant folding for the element-wise binary operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25073 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 02:15:02 +00:00
Chris Lattner
d15ed59734 don't crash when trying to constant fold packed expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25072 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 02:03:29 +00:00
Chris Lattner
2054295796 Fix an assertion to allow constant folding of packed values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25071 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 01:01:04 +00:00
Chris Lattner
361dfa62be silence some warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25066 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-03 17:52:18 +00:00
Chris Lattner
505b0701dd Finally commit Saem's 'patch #3' to refactor the pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-03 07:05:17 +00:00
Chris Lattner
0b8e076d0b Patch #1 of Saem Ghani's Pass Manager refactoring. From the man:
"All this should do is create what will eventually be the specialised
passmanagers.  Currently, the templates are inheriting them, once the
template specialisations' methods have been absorbed, patches
submitted method by method.  I'll nuke the specialisations and have
the new objects inherit directly from passmanagert, and sanitise the
world of all references to templates.
"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25053 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-30 20:00:46 +00:00
Duraid Madina
3e317534c7 more HP-UX cleanliness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25015 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-26 08:35:06 +00:00
Reid Spencer
14f497452f Revert previous patch. Additional tests fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24968 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 21:46:37 +00:00
Reid Spencer
84c744fe58 Fix PR409:
Implement the suggested check to ensure that out-of-range float constants
don't get accepted by LLVM accidentally. Adjust the supporting test cases
as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24963 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 21:07:29 +00:00
Chris Lattner
b9d4100f32 Get logical operations to like packed types, allow BinOp::getNot to create
the right vector of -1's as its operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24906 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 18:22:19 +00:00
Chris Lattner
30614675f4 Add a flag to Module::getGlobalVariable to allow it to return vars with
internal linkage.

Patch provided by Evan Jones, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24604 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-05 05:30:21 +00:00
Nate Begeman
6a648614e8 Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24511 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-29 05:45:29 +00:00
Nate Begeman
5fbb5d2459 Teach LLVM how to scalarize packed types. Currently, this only works on
packed types with an element count of 1, although more generic support is
coming.  This allows LLVM to turn the following code:

void %foo(<1 x float> * %a) {
entry:
  %tmp1 = load <1 x float> * %a;
  %tmp2 = add <1 x float> %tmp1, %tmp1
  store <1 x float> %tmp2, <1 x float> *%a
  ret void
}

Into:

_foo:
        lfs f0, 0(r3)
        fadds f0, f0, f0
        stfs f0, 0(r3)
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24416 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 00:36:38 +00:00
Chris Lattner
a1fecc9c26 This requires proper dominance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24408 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:27:53 +00:00
Chris Lattner
3787c95e86 * Fix DerivedType::dropAllTypeUses to not change the number of types in a
type when it gets refined.  This allows us to hash on this crucial value.
* Fix several issues in TypeMap::RefineAbstractType that prevent it from
  handling hash values that change correctly.
* Define hashTypeStructure to not always return 0.  :)

This last part (which depends on the first two) speeds up gccld time on eon
from 3.78s to 2.75s with a release build (a 28% speedup!).  This resolves
PR474.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24372 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 06:09:47 +00:00
Chris Lattner
d358cfc1bf Fix handling of multiple unnamed globals with the same type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24362 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 01:32:03 +00:00
Chris Lattner
c35abc2393 Add some dummy method impls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24345 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 03:26:33 +00:00
Chris Lattner
cfe822728f Move some methods around. Refactor the parts of TypeMap that do not depend
on its template arguments into a base class so that the code isn't duplicated
5 times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24343 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 03:14:09 +00:00
Chris Lattner
bcf6bc2610 Split the type refinement case completely out of the type-becomes-concrete
case, simplifying the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24340 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 01:58:06 +00:00
Chris Lattner
66cafb33bc Separate the type-became-concrete case from the type-is-resolved case, the
former of which takes much less work than the later.  This speeds up linking
eon from 3.749 to 3.637s with a release build (about 3%).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24338 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 01:27:50 +00:00
Chris Lattner
7548590ecc Unswitch a loop, add more assertions, eliminate use of removeUserFromConcrete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24324 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 08:39:48 +00:00
Chris Lattner
d4f328e8c1 Tiny speedup, improve comments and code organization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24323 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 08:22:41 +00:00
Chris Lattner
60962dbfba print section info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24313 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 00:10:19 +00:00
Andrew Lenharth
51b8d54922 continued readcyclecounter support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24300 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-11 16:47:30 +00:00
Chris Lattner
92c4bb904f Fix the optimized code handling of user asm strings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24296 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 23:24:26 +00:00
Chris Lattner
bc076665cb speedup the common case where nothing needs to be quoted
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24294 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 21:47:01 +00:00
Chris Lattner
91150e5d46 Allow per-character control over what target assemblers allow in symbol
names.  This also changes the default to allow all of "$_." in addition
to letters and numbers as symbol names.  If you don't want this, use
markCharUnacceptable to remove one of these or markCharAcceptable to add
to the set.  This corresponds with what GAS accepts by default.

Also, this includes some minor speedups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24293 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 21:40:01 +00:00
Chris Lattner
ac8c834288 Add a new option for targets that accept quoted labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24283 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 19:30:07 +00:00
Chris Lattner
2f9bc4f2d3 remove the M instance var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24281 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 19:02:18 +00:00
Chris Lattner
9ddf21276e Make this more efficient of the common case where we are only mangling globals.
Do not mangle internal global names that do not collide with anything.

This gives us strings that now look like this:

__2E_str_1:                             ; '.str_1'
        .asciz  "foo"

instead of this:

l1__2E_str_1:                           ; '.str_1'
        .asciz  "foo"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24277 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 18:48:58 +00:00
Chris Lattner
d115ef8973 Force packed vectors to be a power of two in length.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24264 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 01:40:59 +00:00
Chris Lattner
30caa2876c print alignment info for globals and functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24212 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 06:48:53 +00:00
Chris Lattner
6033716140 verify that alignments are always a power of 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24200 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 21:57:54 +00:00
Chris Lattner
9fad0b9974 fix printing the alignment directive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24197 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 21:20:34 +00:00
Nate Begeman
14b0529532 Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.

No targets currently do anything with this information, nor is it presrved
in the bytecode representation.  That's coming up next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24196 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 09:21:28 +00:00
Chris Lattner
306f6fefc9 Fix an iterator invalidation problem in code used by the -strip pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24124 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-31 18:42:37 +00:00
Chris Lattner
b4871ad694 Allow $
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23721 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-14 01:28:34 +00:00
Chris Lattner
71abaab1d2 add a hack to work around broken VC++ scoping rules. Thx to JeffC for pointing
this out to me


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23655 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 05:23:36 +00:00
Chris Lattner
a1e3f54396 refactor a bit of code.
When moving constant entries in 'Map' if the entry is the representative
constant for the abstractypemap, make sure to update it as well.  This
fixes the bcreader failures from last night on several C++ apps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23628 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 21:35:50 +00:00
Chris Lattner
23ec01fcc3 Minor speedup to avoid array searches given a Use*. This speeds up bc reading
of the python test from 1:00 to 54s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23627 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 18:47:09 +00:00
Chris Lattner
d0ff1adbdb Change the signature of replaceUsesOfWithOnConstant. The bool was always
true dynamically.  Finally, pass the Use* that replaceAllUsesWith has into
the method for future use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23626 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 18:13:04 +00:00
Chris Lattner
a55b30a225 For large constants (e.g. arrays and structs with many elements) just
creating the keys and doing comparisons to index into 'Map' takes a lot
of time.  For these large constants, keep an inverse map so that 'remove'
and move operations are much faster.

This speeds up a release build of the bc reader on Eric's nasty python
bytecode file from 1:39 to 1:00s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23624 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 17:48:46 +00:00
Chris Lattner
d7a3fc6819 minor cleanup/fastpath for the bcreader. This speeds up the bcreader
from 1:41 -> 1:39 on the large python .bc file in a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23623 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 16:52:46 +00:00
Chris Lattner
c182a88aec implement the struct version of the array speedup, speeding up the
testcase a bit more from 1:48 -> 1.40.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23619 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 01:17:50 +00:00
Chris Lattner
cea141f1d1 Change ConstantArray::replaceUsesOfWithOnConstant to attempt to update
constant arrays in place instead of reallocating them and replaceAllUsesOf'ing
the result.  This speeds up a release build of the bcreader from:

136.987u 120.866s 4:24.38
to
49.790u 49.890s 1:40.14

... a 2.6x speedup parsing a large python bc file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23614 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 22:51:37 +00:00
Chris Lattner
5cbade9f83 move some methods, no other changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23613 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 21:58:36 +00:00
Chris Lattner
dfdd6c5d7a minor microoptimizations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23612 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 21:56:24 +00:00
Chris Lattner
df0ef1d0fe Split SimpleConstantVal up into its components, so each Constant subclass getsa different enum value. This allows 'classof' for these to be really simple,not needing to call getType() anymore.
This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23467 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 06:09:08 +00:00
Chris Lattner
5b845c9443 Add support for a marker byte that indicates that we shouldn't add the user
prefix to a symbol name


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23421 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-24 08:24:28 +00:00
Chris Lattner
8064e8fbf4 add printer support for flag operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23054 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 17:59:23 +00:00
Jim Laskey
3a1eff732b Move code dependency for MathExtras.h out of Constants.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 20:06:22 +00:00
Jim Laskey
cb6682fa44 Culling out use of unions for converting FP to bits and vice versa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22838 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 19:34:49 +00:00
Andrew Lenharth
9ca65c7110 only build .a on alpha
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22787 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-14 15:14:34 +00:00
Andrew Lenharth
40b37cc28d Testing a variable before it is defined doesn't work so well. It is a fairly small thing, so just let everyone build the .a file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22783 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-13 14:58:23 +00:00
Andrew Lenharth
7ac17529d2 Fix oversized GOT problem with gcc-4 on alpha
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22777 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-13 05:09:50 +00:00
Chris Lattner
6a13aed525 Add a helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22768 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-12 22:14:06 +00:00
Chris Lattner
0fe34d8912 add new helper function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22698 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-08 05:21:50 +00:00
Chris Lattner
d7231ac523 PHINode::hasConstantValue should never return the PHI itself, even if the
PHI is its only operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22676 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 15:37:31 +00:00
Chris Lattner
80f4d88a97 Fix an iterator invalidation problem when we decide a phi has a constant value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22675 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 15:34:10 +00:00
Chris Lattner
8313a25d27 Invoke instructions do not dominate all successors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22671 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 01:03:27 +00:00
Chris Lattner
1325b42a7d Now that hasConstantValue is more careful w.r.t. returning values that only
dominate the PHI node, this code can go away.  This also makes passes more
aggressive, e.g. implementing Transforms/CondProp/phisimplify2.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22670 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 01:02:04 +00:00
Chris Lattner
b3b48e11da Use the bool argument to hasConstantValue to decide whether the client is
prepared to deal with return values that do not dominate the PHI.  If we
cannot prove that the result dominates the PHI node, do not return it if
the client can't cope.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22669 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 01:00:58 +00:00
Chris Lattner
9acbd611ec Mark hasConstantValue as a const method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22666 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 00:49:06 +00:00
Nate Begeman
c523f4c096 Add an extra parameter that Chris requested
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22665 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-04 23:50:43 +00:00
Nate Begeman
a83ba0f5c9 Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
BasicBlock's removePredecessor routine.  This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22664 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-04 23:24:19 +00:00
Jeff Cohen
00b16889ab Eliminate all remaining tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:12:32 +00:00
Andrew Lenharth
558bc88a00 core changes for varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22254 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-18 18:34:52 +00:00
Reid Spencer
edd5d9ece1 Some cleanups for compilation with GCC 4.0.0 to remove warnings:
* Use C++ style casts, not C style casts
* Abstract base classes should have virtual destructor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22057 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 16:13:11 +00:00
Chris Lattner
37c121acf4 Verify that varargs functions all have ccc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21792 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-08 22:27:09 +00:00
Chris Lattner
d511898b58 add support for explicit calling conventions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21746 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 20:26:43 +00:00
Chris Lattner
ddb6db4fa1 Add a 'tail' marker for call instructions, patch contributed by
Alexander Friedman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21722 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 05:51:46 +00:00
Andrew Lenharth
691ef2ba06 Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
population (ctpop).  Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.

More coming soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21676 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-03 17:19:30 +00:00
Chris Lattner
f818cfe096 fix a bug in the 1 index GEP handling code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21670 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-03 16:44:45 +00:00
Chris Lattner
38bacf29e8 add direct support for making GEP instrs with one index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21665 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-03 05:43:30 +00:00
Jeff Cohen
a97e8db835 Use ANSI-approved way of getting the value infinity (otherwise VC++ won't compile it)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21662 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-03 03:13:01 +00:00
Andrew Lenharth
8b9e3e6511 fold fp div by 0 to inf, the way gcc does. This is legal according to the FP spec
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21655 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 21:25:47 +00:00
Chris Lattner
eed37bad01 Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21627 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 03:44:07 +00:00
Chris Lattner
22cab6c752 Unbreak the sparc backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21598 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 18:57:15 +00:00
Chris Lattner
3f80a38859 don't let Reid build void*'s :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21571 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 20:03:33 +00:00
Chris Lattner
91bd25d9df Make dominates(A,B) work with post dominators. Patch contributed by
Naveen Neelakantam, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21543 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 20:50:33 +00:00
Reid Spencer
e8f3848639 Older compilers won't like the inline virtual destructor in the header file
so we put the destructor in Pass.cpp and make it non-inline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21520 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-25 01:01:35 +00:00
Reid Spencer
2b2a528374 Shut GCC 4.0 up about classes with virtual functions but no virtual
destructor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21510 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 22:27:20 +00:00
Chris Lattner
64001d0a13 Allow these methods to take a generic Value* to simplify clients. Use
const_cast instead of c casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21493 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24 07:28:37 +00:00
Chris Lattner
ea1049139e Fix a bug in my previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21485 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:01:39 +00:00
Chris Lattner
4f0247c10d Add a method, remove last use of Type.def
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21483 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:00:09 +00:00
Jeff Cohen
9d80930e95 Eliminate tabs and trailing spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21480 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 21:38:35 +00:00
Misha Brukman
fd93908ae8 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 23:48:37 +00:00
Misha Brukman
edf128a7fa Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21420 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 22:36:52 +00:00
Chris Lattner
566f600779 Improve doxygen, from part of Evan's patch that didn't apply.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21394 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 16:06:03 +00:00
Chris Lattner
0f67dd6237 Improve doxygen documentation, patch contributed by Evan Jones!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21393 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 16:04:49 +00:00
Chris Lattner
3464547968 add an argument to allow avoiding deleting phi nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21255 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-12 18:52:14 +00:00
Andrew Lenharth
7f4ec3b2e3 First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20900 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 20:05:49 +00:00
Alkis Evlogimenos
1cecd3a1d2 Add new function getPtrPtrFromArrayPtr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20684 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 11:40:31 +00:00
Misha Brukman
fd67824386 Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20638 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-16 05:42:00 +00:00
Chris Lattner
39220ded94 stop using arg_front
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20599 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 05:03:36 +00:00
Chris Lattner
e4d5c441e0 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:54:21 +00:00
Chris Lattner
76da61621c correct the computation of the isAbstract bit for types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20533 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 17:34:27 +00:00
Reid Spencer
9dbf1e5bb8 Fix a typo in an assertion comment.
Patch contributed by Vladimir Merzliakov.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20529 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 15:19:41 +00:00