Commit Graph

2583 Commits

Author SHA1 Message Date
Dan Gohman
149cfc3519 Make ConstantAggregateZero::get return a ConstantAggregateZero*,
as suggested in PR3182.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60691 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 07:10:54 +00:00
Dan Gohman
d71703deec Have PseudoSourceValue override Value::dump, so that it works
on PseudoSourceValue values. This also fixes a FIXME in
lib/VMCode/AsmWriter.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 21:37:21 +00:00
Chris Lattner
01c8e0233d Comment typeo fix, thanks Duncan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 18:33:11 +00:00
Chris Lattner
c7f7c1dc50 add a little helper function that does PHI translation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 07:16:45 +00:00
Chris Lattner
11240d0fdd The PreVerifier pass preserves everything. In practice, this
prevents the passmgr from adding yet-another domtree invocation
for Verifier if there is already one live.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60326 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 03:58:38 +00:00
Chris Lattner
e3a0884ddf improve const correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60168 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 08:39:18 +00:00
Chris Lattner
c5dd22a333 add a long-overdue AllocaInst::isStaticAlloca method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60080 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 02:54:17 +00:00
Devang Patel
59500c8f9a Silence unused variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 20:00:59 +00:00
Chris Lattner
824b958e6f reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 16:42:48 +00:00
Bill Wendling
dc770929cb Revert r59802. It was breaking the build of llvm-gcc:
g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS   -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic'
make[3]: *** [llvm-convert.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 09:09:41 +00:00
Sanjiv Gupta
219ab405e6 Make mem[cpy,move,set] intrinsics overloaded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59802 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 07:49:09 +00:00
Bill Wendling
2f45f9762d Use stripPointerCasts when checking for AllocaInsts for the stackprotector intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 09:17:16 +00:00
Bill Wendling
9173383e4e Use dyn_cast instead of cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 01:25:41 +00:00
Bill Wendling
bccdcca7d1 Match an element of the return type if it returns a structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59576 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 01:15:05 +00:00
Bill Wendling
c5b795e8ce Verify that the second parameter of the stacprotector intrinsic is an alloca
instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 23:09:31 +00:00
Nick Lewycky
70c44f0cce Correct this error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 17:50:47 +00:00
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