summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
* Reimplement the old and horrible bison parser for .ll files with a niceChris Lattner2009-01-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and clean recursive descent parser. This change has a couple of ramifications: 1. The parser code is about 400 lines shorter (in what we maintain, not including what is autogenerated). 2. The code should be significantly faster than the old code because we don't have to work around bison's poor handling of datatypes with ctors/dtors. This also makes the code much more resistant to memory leaks. 3. We now get caret diagnostics from the .ll parser, woo. 4. The actual diagnostics emited from the parser are completely different so a bunch of testcases had to be updated. 5. I now disallow "%ty = type opaque %ty = type i32". There was no good reason to support this, it was just an accident of the old implementation. I have no reason to think that anyone is actually using this. 6. The syntax for sticking a global variable has changed to make it unambiguous. I don't think anyone is depending on this since only clang supports this and it is not solid yet, so I'm not worried about anything breaking. 7. This gets rid of the last use of bison, and along with it the .cvs files. I'll prune this from the makefiles as a subsequent commit. There are a few minor cleanups that can be done after this commit (suggestions welcome!) but this passes dejagnu testing and is ready for its time in the limelight. llvm-svn: 61558
* Don't analyze arguments already marked 'nocapture'.Duncan Sands2008-12-311-0/+7
| | | | llvm-svn: 61532
* Make stripPointerCasts and getUnderlyingObjectDuncan Sands2008-12-291-26/+39
| | | | | | non-recursive. llvm-svn: 61479
* select constant exprs should have the same constraints as select instructions,Chris Lattner2008-12-291-3/+1
| | | | | | notably, they should support vectors and aggregates. llvm-svn: 61462
* move select validation logic into a shared place where the select ctor,Chris Lattner2008-12-292-17/+31
| | | | | | verifier, asm parser, etc can share it. llvm-svn: 61461
* The fields for the stoppoint debug intrinsic have not changed, so update theJohn Criswell2008-12-191-2/+2
| | | | | | version number assertions. llvm-svn: 61257
* C bindings for dyn_cast_or_null.Gordon Henriksen2008-12-191-0/+12
| | | | | | This operation can be used to build dyn_cast, isa, and cast. llvm-svn: 61252
* Commit missed files from nocapture change.Nick Lewycky2008-12-191-2/+5
| | | | llvm-svn: 61240
* Added support for vector widening.Mon P Wang2008-12-181-0/+6
| | | | llvm-svn: 61209
* This adds some missing functions to the C binding:Chris Lattner2008-12-171-0/+24
| | | | | | | | | | - ability to insert previously created instructions using a builder - creation of aliases - creation of inline asm constants Patch by Zoltan Varga! llvm-svn: 61153
* Temporarily revert r61019, r61030, and r61040. These were breaking LLVM ReleaseBill Wendling2008-12-161-5/+2
| | | | | | builds. llvm-svn: 61094
* It turns out that "align 1" and unaligned are different. Add a bias to theNick Lewycky2008-12-151-1/+1
| | | | | | | | | | alignment attribute such that 0 means unaligned. This will probably require a rebuild of llvm-gcc because of the change to Attributes.h. If you see many test failures on "make check", please rebuild your llvm-gcc. llvm-svn: 61030
* Introducing nocapture, a parameter attribute for pointers to indicate that theNick Lewycky2008-12-151-2/+5
| | | | | | | | | | | | | | | | | | | | | | | callee will not introduce any new aliases of that pointer. The attributes had all bits allocated already, so I decided to collapse alignment. Alignment was previously stored as a 16-bit integer from bits 16 to 32 of the attribute, but it was required to be a power of 2. Now it's stored in log2 encoded form in five bits from 16 to 21. That gives us 11 more bits of space. You may have already noticed that you only need four bits to encode a 16-bit power of two, so why five bits? Because the AsmParser accepted 32-bit alignments, even though we couldn't store them (they were silently discarded). Now we can store them in memory, but not in the bitcode. The bitcode format was already storing these as 64-bit VBR integers. So, the bitcode format stays the same, keeping the alignment values stored as 16 bit raw values. There's some hideous code in the reader and writer that deals with this, waiting to be ripped out the moment we run out of bits again and have to replace the parameter attributes table encoding. llvm-svn: 61019
* These messages should always be emitted when NDEBUG is unset, not whenChris Lattner2008-12-131-2/+2
| | | | | | NDEBUG is unset and -debug is passed. llvm-svn: 60986
* fix grammar, thanks Duncan!Torok Edwin2008-12-111-4/+4
| | | | llvm-svn: 60875
* introduce BasicBlock::getUniquePredecessor()Torok Edwin2008-12-111-0/+19
| | | | llvm-svn: 60872
* Make ConstantAggregateZero::get return a ConstantAggregateZero*,Dan Gohman2008-12-081-1/+1
| | | | | | as suggested in PR3182. llvm-svn: 60691
* Have PseudoSourceValue override Value::dump, so that it worksDan Gohman2008-12-031-2/+1
| | | | | | | on PseudoSourceValue values. This also fixes a FIXME in lib/VMCode/AsmWriter.cpp. llvm-svn: 60507
* Comment typeo fix, thanks Duncan!Chris Lattner2008-12-021-1/+1
| | | | llvm-svn: 60429
* add a little helper function that does PHI translation.Chris Lattner2008-12-021-0/+13
| | | | llvm-svn: 60405
* The PreVerifier pass preserves everything. In practice, thisChris Lattner2008-12-011-0/+4
| | | | | | | prevents the passmgr from adding yet-another domtree invocation for Verifier if there is already one live. llvm-svn: 60326
* improve const correctness.Chris Lattner2008-11-271-2/+2
| | | | llvm-svn: 60168
* add a long-overdue AllocaInst::isStaticAlloca method.Chris Lattner2008-11-261-0/+12
| | | | llvm-svn: 60080
* Silence unused variable warnings.Devang Patel2008-11-211-0/+1
| | | | llvm-svn: 59841
* reapply Sanjiv's patch to genericize memcpy/memset/memmove to take anChris Lattner2008-11-211-6/+3
| | | | | | arbitrary integer width for the count. llvm-svn: 59823
* Revert r59802. It was breaking the build of llvm-gcc:Bill Wendling2008-11-211-3/+6
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 59809
* Make mem[cpy,move,set] intrinsics overloaded.Sanjiv Gupta2008-11-211-6/+3
| | | | llvm-svn: 59802
* Use stripPointerCasts when checking for AllocaInsts for the stackprotector ↵Bill Wendling2008-11-191-1/+1
| | | | | | intrinsic. llvm-svn: 59614
* Use dyn_cast instead of cast.Bill Wendling2008-11-191-1/+1
| | | | llvm-svn: 59577
* Match an element of the return type if it returns a structure.Bill Wendling2008-11-191-2/+12
| | | | llvm-svn: 59576
* Verify that the second parameter of the stacprotector intrinsic is an allocaBill Wendling2008-11-181-0/+5
| | | | | | instruction. llvm-svn: 59563
* Correct this error message.Nick Lewycky2008-11-151-1/+1
| | | | llvm-svn: 59370
* Modify the intrinsics pattern to separate out the "return" types from theBill Wendling2008-11-131-12/+27
| | | | | | | | | | "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>]>; llvm-svn: 59237
* Refactor the code that does the type checking for intrinsics.Bill Wendling2008-11-131-115/+132
| | | | llvm-svn: 59228
* Implement stack protectors as function attributes: "ssp" and "sspreq".Bill Wendling2008-11-131-0/+4
| | | | llvm-svn: 59202
* Added support for the following definition of shufflevector Mon P Wang2008-11-103-25/+26
| | | | | | <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> llvm-svn: 58964
* Use utohex_buffer instead of utohexstr to avoid creating a temporaryChris Lattner2008-11-101-1/+2
| | | | | | string in the .ll and .s printers. llvm-svn: 58962
* Fix a use of an invalid iterator when -debug-pass=Details is used.Dan Gohman2008-11-061-1/+1
| | | | llvm-svn: 58816
* Add comments to function.Bill Wendling2008-11-051-0/+6
| | | | llvm-svn: 58781
* Silence unused variable warnings.Devang Patel2008-11-051-1/+3
| | | | llvm-svn: 58743
* fix memory leak in pass manager when adding an analysis pass that already ↵Nuno Lopes2008-11-041-1/+3
| | | | | | | | 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 llvm-svn: 58730
* - Add a "getOrInsertGlobal" method to the Module class. This acts similarly toBill Wendling2008-11-041-0/+22
| | | | | | | | | | "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. llvm-svn: 58727
* Duncan pointed out that the Extended case in getTypeForMVT couldDan Gohman2008-11-041-7/+2
| | | | | | be considerably simplified. llvm-svn: 58703
* Add a return statement to suppress warnings in NDEBUG builds.Dan Gohman2008-11-041-0/+1
| | | | llvm-svn: 58702
* Add some asserts to verify MVT invariant assumptions.Dan Gohman2008-11-041-0/+2
| | | | llvm-svn: 58701
* Fix unused variable warnings.Devang Patel2008-11-032-0/+13
| | | | llvm-svn: 58653
* Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!Dan Gohman2008-11-031-0/+26
| | | | llvm-svn: 58650
* Change how extended types are represented in MVTs. Instead of fiddlingDan Gohman2008-11-031-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 58623
* Reverting back 58505. Will commit it once I have the bc reader/writer/docsSanjiv Gupta2008-11-011-2/+1
| | | | | | ready. llvm-svn: 58547
* For some targets pointer and int are 16-bits. Allow 16-bits as a valid indexSanjiv Gupta2008-10-311-1/+2
| | | | | | in such cases. llvm-svn: 58505
OpenPOWER on IntegriCloud