Commit Graph

6146 Commits

Author SHA1 Message Date
Christopher Lamb
fe63fb986d Implement address space attribute for LLVM pointer types. Address spaces are
regions of memory that have a target specific relationship, as described in the 
Embedded C Technical Report. 

This also implements the 2007-12-11-AddressSpaces test, 
which demonstrates how address space attributes can be used in LLVM IR.

In addition, this patch changes the bitcode signature for stores (in a backwards 
compatible manner), such that the pointer type, rather than the pointee type, is 
encoded. This permits type information in the pointer (e.g. address space) to be 
preserved for stores.

LangRef updates are forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 08:59:05 +00:00
Anton Korobeynikov
64735ccb2b Add first and really dirty version of generic Trie structure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44851 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 06:53:44 +00:00
Evan Cheng
22f07ffd27 Switch over to MachineLoopInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44838 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 02:09:15 +00:00
Gordon Henriksen
ad93c4f936 CollectorMetadata and Collector are rejiggered to get along with
per-function collector model. Collector is now the factory for
CollectorMetadata, so the latter may be subclassed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44827 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 00:30:17 +00:00
Chris Lattner
57d7d3f2d7 Move TargetData::hostIsLittleEndian out of line, which means we
don't have to #include config.h in it.  #including config.h breaks
other projects that have their own autoconf stuff and try to #include
the llvm headers.  One obscure example is llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44825 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 00:28:59 +00:00
Gordon Henriksen
bbc6597f02 Adding Ocaml bindings for the bitreader as requested by Sarah
Thompson. Usage should be something like this:

open Llvm
open Llvm_bitreader

match read_bitcode_file fn with
  | Bitreader_failure msg ->
      prerr_endline msg
  | Bitreader_success m -> 
      ...;
      dispose_module m

Compile with: ocamlc llvm.cma llvm_bitreader.cma
              ocamlopt llvm.cmxa llvm_bitreader.cmxa


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44824 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 00:20:48 +00:00
Chris Lattner
f286f6fd93 Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use
targetdata to validate that it is safe.  While I'm in there, fix some const
correctness issues and generalize the interface to the "operand folder".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 22:53:04 +00:00
Ted Kremenek
9324665a78 Added two bounds checks to the BitVector class to detect
out-of-bounds bit accesses.  The checks are only performed
in a Debug build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 22:28:35 +00:00
Chris Lattner
555c729a2f split isBinaryOp into a static and member version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44814 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 22:18:53 +00:00
Duncan Sands
cbb8badce8 Make PruneEH update the nounwind/noreturn attributes
on functions as it calculates them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44802 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 19:09:40 +00:00
Duncan Sands
1eff70451f Fix PR1836: in the interpreter, read and write apints
using the minimum possible number of bytes.  For little
endian targets run on little endian machines, apints are
stored in memory from LSB to MSB as before.  For big endian
targets on big endian machines they are stored from MSB to
LSB which wasn't always the case before (if the target and
host endianness doesn't match values are stored according
to the host's endianness).  Doing this requires knowing the
endianness of the host, which is determined when configuring -
thanks go to Anton for this.  Only having access to little
endian machines I was unable to properly test the big endian
part, which is also the most complicated...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44796 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 17:43:13 +00:00
Gordon Henriksen
53c34b1db9 Delete the CollectorNamePool if it should become empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44775 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 03:35:18 +00:00
Gordon Henriksen
80a75bfae9 Adding a collector name attribute to Function in the IR. These
methods are new to Function:

  bool hasCollector() const;
  const std::string &getCollector() const;
  void setCollector(const std::string &);
  void clearCollector();

The assembly representation is as such:

  define void @f() gc "shadow-stack" { ...

The implementation uses an on-the-side table to map Functions to 
collector names, such that there is no overhead. A StringPool is 
further used to unique collector names, which are extremely
likely to be unique per process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 03:18:06 +00:00
Gordon Henriksen
afba8fe662 Reverting dtor devirtualization patch.
_sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed
_sabre_: the vtable lives to fight another day

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 02:14:30 +00:00
Chris Lattner
65b211807d remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 01:51:38 +00:00
Gordon Henriksen
ed455c8fa2 Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 22:46:10 +00:00
Gordon Henriksen
8d1ea75060 Fix a very silly typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44732 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 01:12:08 +00:00
Bill Wendling
041b3f8356 Reverting 44702. It wasn't correct to rename them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44727 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 23:58:46 +00:00
Gordon Henriksen
7446d0cfc5 Incorporating review feedback from Reid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 20:10:40 +00:00
Chris Lattner
921f0d40ec remove dead #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 19:06:21 +00:00
Chris Lattner
73481e04da eliminate dependency on Bitcode headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 19:01:44 +00:00
Chris Lattner
065d97e7fc remove dead #include, APInt.h already has the needed forward decls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 19:00:38 +00:00
Gordon Henriksen
985cb62234 Adding a StringPool data structure, which GC will use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44705 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 17:07:47 +00:00
Bill Wendling
320c630c1b Renaming:
isTriviallyReMaterializable -> hasNoSideEffects
  isReallyTriviallyReMaterializable -> isTriviallyReMaterializable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44702 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 07:17:56 +00:00
Chris Lattner
edfd10de87 Implement correct isa<UnaryInstruction>, problem reported by "ST".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 04:37:52 +00:00
Owen Anderson
5fc4abac3d Fix several cache coherence bugs in MemDep/GVN that were found. Also add some (disabled) debugging code
to make such problems easier to diagnose in the future, written by Duncan Sands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 01:37:09 +00:00
Bill Wendling
0f940c95d4 Initial commit of the machine code LICM pass. It successfully hoists this:
_foo:
        li r2, 0
LBB1_1: ; bb
        li r5, 0
        stw r5, 0(r3)
        addi r2, r2, 1
        addi r3, r3, 4
        cmplw cr0, r2, r4
        bne cr0, LBB1_1 ; bb
LBB1_2: ; return
        blr 

to:

_foo:
        li r2, 0
        li r5, 0
LBB1_1: ; bb
        stw r5, 0(r3)
        addi r2, r2, 1
        addi r3, r3, 4
        cmplw cr0, r2, r4
        bne cr0, LBB1_1 ; bb
LBB1_2: ; return
        blr

ZOMG!! :-)

Moar to come...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44687 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07 21:42:31 +00:00
Owen Anderson
050fe638a5 Fix a stupid error that Chris pointed out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44674 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07 04:04:55 +00:00
Chris Lattner
34c9433004 add a new ExecutionEngine::createJIT which can be used if you only want
to create a JIT.  This lets you specify JIT-specific configuration items
like the JITMemoryManager to use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44647 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-06 01:34:04 +00:00
Chris Lattner
9f2f142d25 simplify creation of the interpreter, make ExecutionEngine ctor protected,
delete one ExecutionEngine ctor, minor cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44646 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-06 01:08:09 +00:00
Evan Cheng
5ef3a04b54 Fix for PR1831: if all defs of an interval are re-materializable, then it's a preferred spill candiate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44644 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-06 00:01:56 +00:00
Chris Lattner
22d806605e improve header guard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44641 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 23:45:41 +00:00
Chris Lattner
8907b4ba47 split the JIT memory management code out from the main JIT logic into its
own JITMemoryManager interface.  There is no functionality change with 
this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44640 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 23:39:57 +00:00
Evan Cheng
018f9b020b - Mark last use of a split interval as kill instead of letting spiller track it.
This allows an important optimization to be re-enabled.
- If all uses / defs of a split interval can be folded, give the interval a
  low spill weight so it would not be picked in case spilling is needed (avoid
  pushing other intervals in the same BB to be spilled).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44601 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 03:22:34 +00:00
Evan Cheng
d64b5c82b9 Add a argument to storeRegToStackSlot and storeRegToAddr to specify whether
the stored register is killed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 03:14:33 +00:00
Scott Michel
f89a22a3d1 fixed header attribution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44599 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 02:08:01 +00:00
Scott Michel
b216a1b0b9 More stuff for CellSPU -- this should be enough to get an error-free
compilation (no files missing). Test cases remain to be checked in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44598 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 02:01:41 +00:00
Ted Kremenek
7da75c5a40 Added "Emitter" functor to allow easy emitting of elements of a container
using std::for_each.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44589 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 00:13:07 +00:00
Duncan Sands
a3355ffb3d Rather than having special rules like "intrinsics cannot
throw exceptions", just mark intrinsics with the nounwind
attribute.  Likewise, mark intrinsics as readnone/readonly
and get rid of special aliasing logic (which didn't use
anything more than this anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 20:06:50 +00:00
Evan Cheng
aee4af68ae Remove redundant foldMemoryOperand variants and other code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44517 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 08:30:39 +00:00
Duncan Sands
dff6710717 Integrate the readonly/readnone logic more deeply
into alias analysis.  This meant updating the API
which now has versions of the getModRefBehavior,
doesNotAccessMemory and onlyReadsMemory methods
which take a callsite parameter.  These should be
used unless the callsite is not known, since in
general they can do a better job than the versions
that take a function.  Also, users should no longer
call the version of getModRefBehavior that takes
both a function and a callsite.  To reduce the
chance of misuse it is now protected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44487 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01 07:51:45 +00:00
Owen Anderson
528b00adc4 Fixes for MachineLoopInfo, mostly from Evan. With these, it should be almost useable!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44480 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01 03:01:39 +00:00
Evan Cheng
e62f97c094 Allow some reloads to be folded in multi-use cases. Specifically testl r, r -> cmpl [mem], 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44479 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01 02:07:52 +00:00
Eric Christopher
790e11cdff Add target triple to include/llvm/Config/config.h.in. Regenerate all files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44478 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01 00:34:39 +00:00
Ted Kremenek
f64903b7d8 Fixed subtle bug in Deserializer::JumpTo when jumping when the block-nesting
information matching did not exactly match the underlying stream's scoping
information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44470 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 22:45:05 +00:00
Ted Kremenek
2a2a496aac Fixed potential bug where CurWord is not zeroed out in JumpToBit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44469 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 22:39:46 +00:00
Evan Cheng
cddbb83ea8 Do not fold reload into an instruction with multiple uses. It issues one extra load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44467 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 21:23:43 +00:00
Duncan Sands
757d243167 Add a convenience method for modifying parameter
attributes.  While there, I noticed that not all
attribute methods returned a pointer-to-constant,
so I fixed that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 18:19:18 +00:00
Devang Patel
962e0750a5 Provide a way to update DescGlobals cache directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44446 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 00:51:33 +00:00
Evan Cheng
1953d0cb7d Fix a major performance issue with splitting. If there is a def (not def/use)
in the middle of a split basic block, create a new live interval starting at
the def. This avoid artifically extending the live interval over a number of
cycles where it is dead. e.g.

bb1:
       = vr1204   (use / kill) <= new interval starts and ends here.
...
...
vr1204 =          (new def)   <= start a new interval here.
       = vr1204   (use)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44436 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 10:12:14 +00:00
Evan Cheng
c3fc7d9ec9 Replace the odd kill# hack with something less fragile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44434 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 09:49:23 +00:00
Chris Lattner
d7205e6ba1 Pass the whole StringMapEntry into StringMapEntryInitializer::Initialize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44432 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 06:14:41 +00:00
Chris Lattner
aec78708c2 provide an optional API to allow datatypes in a stringmap to be *gasp*
initialized with a value if they want, by specializing the 
StringMapEntryInitializer class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44430 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 06:04:41 +00:00
Evan Cheng
0cbb1164b3 Fixed various live interval splitting bugs / compile time issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44428 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 01:06:25 +00:00
Duncan Sands
afa3b6da11 Add some convenience methods for querying attributes, and
use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44403 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 17:07:01 +00:00
Duncan Sands
0a488b320c Add missing newlines at EOF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44399 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 10:13:38 +00:00
Evan Cheng
cada245d06 Recover compile time regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44386 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 01:28:46 +00:00
Owen Anderson
e4ad9c70e4 Add MachineLoopInfo. This is not yet tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44384 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 22:47:08 +00:00
Duncan Sands
dc024674ff Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 13:23:08 +00:00
Owen Anderson
d735ee85db Make LoopInfoBase more generic, in preparation for having MachineLoopInfo. This involves a small interface change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44348 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 03:43:35 +00:00
Owen Anderson
af9ac8f821 Add accessor for getting the underlying templated type. This is necessary for templated LoopInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44347 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 03:33:40 +00:00
Anton Korobeynikov
fd94dd58ff Remove another leak. Due to some reason AliasSetTracker didn't had any dtor...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44320 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 23:52:02 +00:00
Nick Lewycky
c54c561c9f Add new SCEV, SCEVSMax. This allows LLVM to analyze do-while loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44319 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 22:41:31 +00:00
Anton Korobeynikov
d91cbf352a Remove a leak. Destroy LoopInfoBase object. releaseMemory() is actually called in its dtor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44317 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 18:41:39 +00:00
Duncan Sands
827cde1c83 Fix PR1816. If a bitcast of a function only exists because of a
trivial difference in function attributes, allow calls to it to
be converted to direct calls.  Based on a patch by Török Edwin.
While there, move the various lists of mutually incompatible
parameters etc out of the verifier and into ParameterAttributes.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44315 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 14:10:56 +00:00
Chris Lattner
27a6c7380f Several changes:
1) Change the interface to TargetLowering::ExpandOperationResult to 
   take and return entire NODES that need a result expanded, not just
   the value.  This allows us to handle things like READCYCLECOUNTER,
   which returns two values.
2) Implement (extremely limited) support in LegalizeDAG::ExpandOp for MERGE_VALUES.
3) Reimplement custom lowering in LegalizeDAGTypes in terms of the new
   ExpandOperationResult.  This makes the result simpler and fully 
   general.
4) Implement (fully general) expand support for MERGE_VALUES in LegalizeDAGTypes.
5) Implement ExpandOperationResult support for ARM f64->i64 bitconvert and ARM
   i64 shifts, allowing them to work with LegalizeDAGTypes.
6) Implement ExpandOperationResult support for X86 READCYCLECOUNTER and FP_TO_SINT,
   allowing them to work with LegalizeDAGTypes.

LegalizeDAGTypes now passes several more X86 codegen tests when enabled and when
type legalization in LegalizeDAG is ifdef'd out.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 07:07:01 +00:00
Chris Lattner
9e513acd31 Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44296 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 22:42:31 +00:00
Chris Lattner
c2bfadb9df add some static icmpinst predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44283 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 23:43:29 +00:00
Duncan Sands
ed4a2f1688 Rename the 'const' parameter attribute to 'readnone',
and the 'pure' parameter attribute to 'readonly'.
Names suggested by DannyB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44273 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 20:23:04 +00:00
Dale Johannesen
526e39a02b File missing from previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44259 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20 23:25:17 +00:00
Dan Gohman
50cdabcfd5 Remove meaningless qualifiers from return types, avoiding compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44240 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 20:46:23 +00:00
Dan Gohman
ab2a754254 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 15:36:19 +00:00
Dan Gohman
adf3eab773 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 15:30:20 +00:00
Chris Lattner
2b1f1066ac Fix the Linker testcase regressions, by making MemoryBuffer::getFileOrSTDIN return
a valid but empty buffer if stdin is empty.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44219 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-18 18:52:28 +00:00
Ted Kremenek
247fdca789 Reverted patch 44199:
http://llvm.org/viewvc/llvm-project?rev=44199&view=rev

This patch completely broke serialization due to an invariant I assumed but
did not hold. The assumed invariant was that all pointer IDs emitted by a call
to BatchEmitOwnedPtrs would be consecutive. This is only the case if there has
been no forward references to an owned pointer (and hence already registered
with the Serializer object).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44203 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 03:34:33 +00:00
Ted Kremenek
07cad1c6ce Changed implementation of Serialize::EmitDiffPtrID and
Deserialize::ReadDiffPtrID to read and emit bools instead of unsigned
integers. This should result in a nice space optimization once we have
"auto-abbreviation" generation in place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44200 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 00:45:37 +00:00
Ted Kremenek
04ab82a806 Implemented optimization for BatchEmitOwnedPtrs that we only emit one complete
SerializedPtrID, followed by the *differences* in IDs. The big idea is that
most IDs will be just be 1 off from the previous (either that or NULL, which
we encode as a difference if 0), so this will greatly reduce the encoding
space for extra IDs to just 1 bit per pointer.

So far this optimization reduces serialization of Carbon.h by only 1%, but
we aren't using any abbreviations now in the Bitcode file to properly take
advantage of this optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44199 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 00:40:45 +00:00
Evan Cheng
81a0382181 Live interval splitting:
When a live interval is being spilled, rather than creating short, non-spillable
intervals for every def / use, split the interval at BB boundaries. That is, for
every BB where the live interval is defined or used, create a new interval that
covers all the defs and uses in the BB.

This is designed to eliminate one common problem: multiple reloads of the same
value in a single basic block. Note, it does *not* decrease the number of spills
since no copies are inserted so the split intervals are *connected* through
spill and reloads (or rematerialization). The newly created intervals can be
spilled again, in that case, since it does not span multiple basic blocks, it's
spilled in the usual manner. However, it can reuse the same stack slot as the
previously split interval.

This is currently controlled by -split-intervals-at-bb.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44198 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 00:40:40 +00:00
Evan Cheng
38b0be01de Shrinkfy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44197 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 00:31:16 +00:00
Anton Korobeynikov
917c2a6ff2 Implement necessary bits for flt_rounds gcc builtin.
Codegen bits and llvm-gcc support will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 23:25:33 +00:00
Anton Korobeynikov
4e1a0e386c Reverted r44163 per request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 18:33:16 +00:00
Daniel Berlin
07268172ff Fix bugs in iterator invalidation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 18:06:49 +00:00
Nick Lewycky
65e2da3b4d Fix handling of overflow in loop calculation by adding new UDiv SCEV. This SCEV
is disabled in the sense that it will refuse to create one from a UDiv
instruction, until the code is better tested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44163 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 06:30:50 +00:00
Chris Lattner
ab64806af2 Import the boost scoped_ptr class to LLVM. This patch was prepared by
Cédric Venet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44161 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 05:57:06 +00:00
Owen Anderson
44a95e06cc More templatization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 05:00:15 +00:00
Ted Kremenek
7c6ad0c06e Fixed serious bug in BatchReadOwnedPtrs where in a chain of calls to
deserialize objects if BatchReadOwnedPtrs was called more than once in the
same call chain then the second call would overwrite the SerializedPtrIDs
being used by the first call. Solved this problem by making the vector that
holds the pointer IDs local to a function call. Now BatchReadOwnedPtrs is
reentrant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 00:05:03 +00:00
Anton Korobeynikov
0adb7b41e7 Add pure/const attributes. Documentation will follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44109 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 09:52:30 +00:00
Anton Korobeynikov
9de1934099 Fix PIC jump table codegen on x86-32/linux. In fact, such thing should be applied
to all targets uses GOT-relative offsets for PIC (Alpha?)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 09:18:41 +00:00
Ted Kremenek
38afd9e3ac Added two new overloaded versions of BatchEmitOwnedPtrs and
BatchReadOwnedPtrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44105 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 08:05:03 +00:00
Evan Cheng
c498b0281f Clean up sub-register implementation by moving subReg information back to
MachineOperand auxInfo. Previous clunky implementation uses an external map
to track sub-register uses. That works because register allocator uses
a new virtual register for each spilled use. With interval splitting (coming
soon), we may have multiple uses of the same register some of which are
of using different sub-registers from others. It's too fragile to constantly
update the information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44104 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 07:59:08 +00:00
Owen Anderson
019b92a70c Start the process of making MachineLoopInfo possible by templating Loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44097 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 02:33:58 +00:00
Hartmut Kaiser
ffb15de60e Fixed a compilation error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44083 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 23:04:28 +00:00
Hartmut Kaiser
729bd28f62 Fixed a strange construct. Please review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44082 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 23:04:06 +00:00
Owen Anderson
660c5b9514 Wow. I definitely shouldn't write code when I'm tird.
Make my previous patch actually do what it was intended to do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44061 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 19:56:28 +00:00
Dale Johannesen
b97aec663b Add parameter to getDwarfRegNum to permit targets
to use different mappings for EH and debug info;
no functional change yet.
Fix warning in X86CodeEmitter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44056 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 19:13:01 +00:00
Bill Wendling
0f8d9c04d9 Unify CALLSEQ_{START,END}. They take 4 parameters: the chain, two stack
adjustment fields, and an optional flag. If there is a "dynamic_stackalloc" in
the code, make sure that it's bracketed by CALLSEQ_START and CALLSEQ_END. If
not, then there is the potential for the stack to be changed while the stack's
being used by another instruction (like a call).

This can only result in tears...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 00:44:25 +00:00
Ted Kremenek
3ba3a9b586 Renamed serialization method "Materialize" to "Create". This is an API change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 00:25:08 +00:00
Ted Kremenek
dd479dd3fe Fixed bug with inconsistent serialization/deserialization in matching
calls to BatchEmitOwnedPtrs and BatchReadOwnedPtrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44032 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 00:13:57 +00:00
Ted Kremenek
62724da930 Added versions of ReadPtr that takes an explicit SerializedPtrID. This allows
clients of the Deserializer to read the pointer ID before they are ready
to deserialize the object (which can mean registering a pointer reference
with the backpatcher).

Changed some methods that took an argument "SerializedPtrID" to "const SerializedPtrID&" (pass-by-reference).  This is to accommodate a future
revision of SerializedPtrID where it may be much fatter than an unsigned
integer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44021 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 19:11:15 +00:00
Duncan Sands
e923e21364 Compile fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44013 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 13:43:23 +00:00