Commit Graph

2112 Commits

Author SHA1 Message Date
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
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
d418239da7 fix some warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 01:51:22 +00:00
Chris Lattner
429c8221cc Fix a big problem in the recent dtor refactoring work, now it passes 2007-11-19-InlineAsm.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 01:48:29 +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
Duncan Sands
5d84afdc83 Commit 44487 broke bootstrap of llvm-gcc-4.2. It is
not yet clear why, but in the meantime work around the
problem by making less use of readnone/readonly info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 21:03:28 +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
Duncan Sands
6bb0ae4711 Small optimization of parameter attribute lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44458 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 18:20:58 +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
Duncan Sands
a8b974648f Check that there are not more attributes than
function parameters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44452 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 15:52:20 +00:00
Duncan Sands
fd8890dbee Small parameter attributes cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44433 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 08:30:15 +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
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
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
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
Duncan Sands
5e41f65699 In order for parameter attribute uniquing to make
any sense it is important that ParamAttr::None gets
treated the same as not supplying an attribute at
all.  Rather than stripping ParamAttr::None out of
the list of attributes, assert if ParamAttr::None
is seen.  Fix up the bitcode reader which liked to
insert ParamAttr::None all over the place.  Patch
based on one by Török Edwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44250 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20 14:09:29 +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
Chris Lattner
b28a6dce6d print a call to a fastcc function as:
call x86_fastcallcc void @func( i32* %X, i64 0 )
not:
	callx86_fastcallcc  void @func( i32* %X, i64 0 )

This fixes Codegen/X86/fast-cc-merge-stack-adj.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44217 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-18 18:32:16 +00:00
Nate Begeman
b348d18caf Add support for vectors to int <-> float casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44204 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 03:58:34 +00:00
Nate Begeman
5db1afb462 Basic non-power-of-2 vector support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44181 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 21:15:26 +00:00
Duncan Sands
c455ebeb0c I discover array_lengthof, thanks to gabor on #llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 21:58:02 +00:00
Duncan Sands
0a4f91ea18 Simplify the attribute verification code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44116 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 14:02:11 +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
Duncan Sands
d0561900f3 Don't barf on empty basic blocks. Do not rely on assert
doing something - this needs to work for release builds
too.  I chose to just abort rather than following the
fancy logic of abortIfBroken, because (1) it is a pain
to do otherwise, and (2) nothing is going to work if the
module is this broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43611 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 10:50:26 +00:00
Chris Lattner
b5c91641b5 remove verifier command line option: this should be part of the API, not
a command line optn.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43603 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 04:43:13 +00:00
Owen Anderson
765d64501c Now with less tabs!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43601 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 03:54:23 +00:00
Chris Lattner
e41dcdc964 Fix InstCombine/2007-10-31-StringCrash.ll by removing an obvious
(in hindsight) infinite recursion.  Simplify the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 02:30:35 +00:00
Dan Gohman
2cda9399de Fix a regression in test/CodeGen/X86/2007-04-24-VectorCrash.ll introduced
by r43510. Gracefully handle constants with vector type that aren't
ConstantVector or ConstantAggregateZero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43579 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 21:36:31 +00:00
Owen Anderson
c570e33a61 Add a preverifier pass to check that every basic block ends in a terminator, so that we don't segfault when verifying invalid code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43578 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 21:04:18 +00:00
Dan Gohman
d61de35564 Add support for folding binary operators with vector zero operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 19:00:49 +00:00
Chris Lattner
0569187653 I am not sure this is a good idea to be an option, but rename the option for
now.  It conflicts with clang's -pedantic flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43431 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 03:14:55 +00:00
Anton Korobeynikov
536c64b4d6 Add 'pedantic' mode to verifier rejecting syntactically valid, but 'bad' due to other reasons code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43424 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 22:50:32 +00:00
Owen Anderson
d20cc14dbf Make DomTree and PostDomTree thin wrappers around DomTreeBase, rather than inheriting from it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43259 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 20:58:37 +00:00
Dan Gohman
ac72058dd6 The #include <iterator> isn't needed in this header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43232 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 20:44:10 +00:00
Chris Lattner
b7daa84a35 this doesn't need dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43133 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:26:24 +00:00
Chris Lattner
fe3e3f4438 Reduce reliance on rtti info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43130 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:11:18 +00:00
Chris Lattner
53336cb47e fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43129 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:10:48 +00:00
Dan Gohman
3b7cf0aaba Define a helper function ConstantVector::getSplatValue for testing for
and working with broadcasted constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 17:51:30 +00:00
Owen Anderson
05d2318fbd Move splitBlock into DomTreeBase from DomTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43059 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:03:17 +00:00
Dale Johannesen
db44bf85d8 Disable attempts to constant fold PPC f128.
Remove the assumption that this will happen from
various places.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 23:38:29 +00:00
Owen Anderson
49b653aa6a Template DominatorTreeBase by node type. This is the next major step towards
having dominator information on MBB's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 19:59:25 +00:00
Duncan Sands
af47b11b95 Initial infrastructure for arbitrary precision integer
codegen support.  This should have no effect on codegen
for other types.  Debatable bits: (1) the use (abuse?)
of a set in SDNode::getValueTypeList; (2) the length of
getTypeToTransformTo, which maybe should be refactored
with a non-inline part for extended value types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43030 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 09:56:48 +00:00
Chris Lattner
3cab1c72b5 avoid an APFloat copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42979 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 05:34:10 +00:00
Dale Johannesen
5927d8e94d Disable some compile-time optimizations on PPC
long double.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42958 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 01:56:47 +00:00
Dale Johannesen
a471c2ecda Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet,
just format transformations.  Make readers and
writers work.  Split constants into 2 doubles in
Legalize.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 18:07:22 +00:00
Gordon Henriksen
2618a6c112 C and Objective Caml bindings for PHINode::addIncoming etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:14:39 +00:00
Evan Cheng
b428657504 Remove debugging printf to get build going on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:49:43 +00:00
Dan Gohman
cdf2b3b2f8 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:08:41 +00:00