Commit Graph

2567 Commits

Author SHA1 Message Date
Bill Wendling
cdcc3e6e12 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 09:08:33 +00:00
Bill Wendling
a6ce05f82a Refactor the code that does the type checking for intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 07:11:27 +00:00
Bill Wendling
e9e6bdf27f Implement stack protectors as function attributes: "ssp" and "sspreq".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:02:14 +00:00
Mon P Wang
aeb06d2462 Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:46:22 +00:00
Chris Lattner
c6a1346d7c Use utohex_buffer instead of utohexstr to avoid creating a temporary
string in the .ll and .s printers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58962 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:30:26 +00:00
Dan Gohman
e187726208 Fix a use of an invalid iterator when -debug-pass=Details is used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58816 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 21:57:17 +00:00
Bill Wendling
b4b130f0b1 Add comments to function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 23:42:27 +00:00
Devang Patel
8c3b47f623 Silence unused variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58743 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 01:37:40 +00:00
Nuno Lopes
641397f2ef fix memory leak in pass manager when adding an analysis pass that already existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list
tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 23:03:58 +00:00
Bill Wendling
b7c2c1246f - Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
"getOrInsertFunction" in that it either adds a new declaration of the global
  and returns it, or returns the current one -- optionally casting it to the
  correct type.
- Use the new getOrInsertGlobal in the stack protector code.
- Use "splitBasicBlock" in the stack protector code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 22:51:24 +00:00
Dan Gohman
9a99325141 Duncan pointed out that the Extended case in getTypeForMVT could
be considerably simplified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 16:19:44 +00:00
Dan Gohman
1f5d212ca7 Add a return statement to suppress warnings in NDEBUG builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58702 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 16:08:57 +00:00
Dan Gohman
38bb2f8d09 Add some asserts to verify MVT invariant assumptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58701 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 16:03:56 +00:00
Devang Patel
b6dc9352b0 Fix unused variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58653 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 23:20:04 +00:00
Dan Gohman
b593117b44 Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58650 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 22:55:43 +00:00
Dan Gohman
3a5797d946 Change how extended types are represented in MVTs. Instead of fiddling
bits, use a union of a SimpleValueType enum and a regular Type*.

This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.

This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.

This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 17:56:27 +00:00
Sanjiv Gupta
de5b06b3e1 Reverting back 58505. Will commit it once I have the bc reader/writer/docs
ready.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-01 10:57:12 +00:00
Sanjiv Gupta
d2840fd37f For some targets pointer and int are 16-bits. Allow 16-bits as a valid index
in such cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 10:26:20 +00:00
Daniel Dunbar
e9da133ae0 Reuse PrintEscapedString for printing names in .ll
- One functionality change, '\\' in a name is now printed as a hex
   escape instead of "\\\\". This is consistent with other users of
   PrintEscapedString.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58343 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 19:33:02 +00:00
Nick Lewycky
41fe88b26d Fix an obvious copy/pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58231 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 07:28:44 +00:00
Bill Wendling
9a20afd700 Fix type-o in ExprMapKeyType::operator ==(). The "&&" was missing.
Patch by Frits van Bommel!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58175 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-26 00:19:56 +00:00
Gordon Henriksen
a2cbe6c5b5 Related to PR2911, reject as invalid non-pointer GC roots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 16:28:35 +00:00
Daniel Dunbar
3b0da26e20 Move Print*Pass to use raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22 03:25:22 +00:00
Oscar Fuentes
5c5b6dfd0e CMake: Turned some libraries into partially linked objects. Corrected
names of LLVMCore and ARMCodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22 02:51:53 +00:00
Oscar Fuentes
305c7077f5 CMake: updated lib/VMCore/CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21 23:52:03 +00:00
Daniel Dunbar
f4db3a51c7 Privatize PrintModulePass and PrintFunctionPass and add
createPrintModulePass and createPrintFunctionPass.
 - So clients who compile w/o RTTI can use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57933 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21 23:33:38 +00:00
Chris Lattner
6bdcda3d3e Keep track of *which* input constraint matches an output
constraint.  Reject asms where an output has multiple
input constraints tied to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 16:47:46 +00:00
Gabor Greif
023f84ecaf Introduce a typing refinenement on tagged data
using the 'volatile' qualifier. This should not have any operational consequences
on code, because tags should always be stripped off (giving a non-volatile pointer)
before dereferencing. The new qualification is there to catch some attempts to use
tagged pointers in a context where an untagged pointer is appropriate.

Notably this approach does not catch dereferencing of tagged pointers, but helps
in separating the two concepts a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57641 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 15:33:02 +00:00
Chris Lattner
d3745476de Verify prefetch arguments, PR2576.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 06:00:36 +00:00
Chris Lattner
868510328f apply Eli's patch for PR2165 and provide a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 05:26:51 +00:00
Dan Gohman
9a8af451a3 Fix Instruction::isIdenticalTo and isSameOperationAs to recognize
additional information in Loads, Stores, Calls, Invokes,
InsertValueInsts, and ExtractValueInsts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 01:24:45 +00:00
Dan Gohman
95c2cc51eb Correct the name of isTrapping in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 22:56:21 +00:00
Dan Gohman
2b6c3d9ff1 Fix a missing space after the return type in invoke statements.
This fixes PR2894.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57589 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 18:02:08 +00:00
Daniel Dunbar
76dea9547d Prevent assert when using '"' in names (via hexadecimal).
Update LangRef to mention \xx quoting in names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 23:51:43 +00:00
Daniel Dunbar
cad3580e99 Change getLLVMName to use raw_ostream & PrintLLVMName.
- Avoids duplicated quotification code.
 - Remove QuoteNameIfNeeded.
 - No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 23:28:09 +00:00
Daniel Dunbar
ce91ec285d Unbreak DbgStopPointInst::getFileName().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-11 06:40:56 +00:00
Dale Johannesen
23a98551ab Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-09 23:00:39 +00:00
Dale Johannesen
7111b02c73 Rename APFloat::convertToAPInt to bitcastToAPInt to
make it clearer what the function does.  No functional
change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57325 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-09 18:53:47 +00:00
Duncan Sands
4520dd2b7b Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 07:23:46 +00:00
Devang Patel
617fddf51c Remove interfaces implemented by dead pass from the list of available passes.
Patch By Matthijs Kooijman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 20:36:36 +00:00
Chris Lattner
834eb40f44 fix an incorrect and extremely confusing error message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57123 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05 18:24:03 +00:00
Devang Patel
3afba0ae41 Fix function attribute verification check.
Thanks Duncan!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57029 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-03 21:11:02 +00:00
Devang Patel
6d1b8a5911 Verify function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57020 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-03 17:50:00 +00:00
Devang Patel
8cedb8a975 Remove redundant check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 18:38:23 +00:00
Devang Patel
7c31085b1c Attributes noinline alwaysinline are incompatible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56939 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 23:41:25 +00:00
Chris Lattner
795daece23 add a new form of Type::dump that takes a module for type names,
patch provided by Tomas Lindquist Olsen!




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56929 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 20:16:19 +00:00
Dan Gohman
aeaf245db3 Make some implicit conversions explicit, to avoid compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56927 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 19:58:59 +00:00
Duncan Sands
5d0392c6b3 Factorize code: remove variants of "strip off
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject.  The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 15:25:41 +00:00
Dan Gohman
10b49489bf Don't prepend a space character for constants in Value::print.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 15:09:37 +00:00
Devang Patel
652203f3f3 Support inreg, zext and sext as return value attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 20:49:50 +00:00