summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
...
* constify some methods and add a new Constant::getAggregateElementChris Lattner2012-01-251-8/+41
| | | | | | | helper method for the common operation of extracting an element out of a constant aggregate. llvm-svn: 148931
* use ConstantVector::getSplat in a few places.Chris Lattner2012-01-251-23/+4
| | | | llvm-svn: 148929
* reapply r148901 with a crucial fix.Chris Lattner2012-01-251-31/+59
| | | | | | | "Introduce a new ConstantVector::getSplat constructor function to simplify a really common case." llvm-svn: 148924
* Fix assert("msg"). Fix unused-variable warnings complaining about VT used onlyNick Lewycky2012-01-251-5/+8
| | | | | | in asserts. llvm-svn: 148910
* Revert r148901 because it crashes llvm tests.Argyrios Kyrtzidis2012-01-251-55/+28
| | | | | | | | Original log: Introduce a new ConstantVector::getSplat constructor function to simplify a really common case. llvm-svn: 148906
* Introduce a new ConstantVector::getSplat constructor function to Chris Lattner2012-01-251-28/+55
| | | | | | simplify a really common case. llvm-svn: 148901
* Remove the Type::getNumElements() method, which is only called in 4 places,Chris Lattner2012-01-253-15/+19
| | | | | | | did something extremely surprising, and shadowed actually useful implementations that had completely different behavior. llvm-svn: 148898
* C++, CBE, and TLOF support for ConstantDataSequentialChris Lattner2012-01-241-1/+2
| | | | llvm-svn: 148805
* Rearrange argument order of ::get methods so that LLVMContext comes first,Chris Lattner2012-01-241-14/+28
| | | | | | | | add a ConstantDataArray::getString method that corresponds to the (to be removed) StringRef version of ConstantArray::get, but is dramatically more efficient. llvm-svn: 148804
* add more support for ConstantDataSequentialChris Lattner2012-01-241-3/+8
| | | | llvm-svn: 148802
* Add AsmPrinter (aka MCLowering) support for ConstantDataSequential, Chris Lattner2012-01-241-12/+6
| | | | | | | | and clean up some other misc stuff. Unlike ConstantArray, we will prefer to emit .fill directives for "String" arrays that all have the same value, since they are denser than emitting a .ascii llvm-svn: 148793
* Add various "string" methods to ConstantDataSequential, which have theChris Lattner2012-01-241-0/+27
| | | | | | | | same semantics as ConstantArray's but much more efficient because they don't have to return std::string's. The ConstantArray methods will eventually be removed. llvm-svn: 148792
* teach valuetracking about ConstantDataSequentialChris Lattner2012-01-241-0/+18
| | | | llvm-svn: 148790
* Add some accessor methods to CAZ and UndefValue that help simplify clients.Chris Lattner2012-01-241-6/+60
| | | | | | Make some CDS methods public. llvm-svn: 148785
* implement the ConstantDataSequential accessor methods.Chris Lattner2012-01-241-3/+93
| | | | | | No need for 'getOperand' :) llvm-svn: 148778
* start the implementation of a new ConstantDataVector and ConstantDataArrayChris Lattner2012-01-233-0/+156
| | | | | | | classes, per PR1324. Not all of their helper functions are implemented, nothing creates them, and the rest of the compiler doesn't handle them yet. llvm-svn: 148741
* convert CAZ, UndefValue, and CPN to use DenseMap's again, this time withoutChris Lattner2012-01-234-61/+30
| | | | | | | | using OwningPtr. OwningPtr would barf when the densemap had to reallocate, which doesn't appear to happen on the regression test suite, but obviously happens in real life :) llvm-svn: 148700
* revert r148691 and 148693Chris Lattner2012-01-234-67/+61
| | | | llvm-svn: 148698
* switch UndefValue and ConstantPointerNull over to DenseMap's for uniquing.Chris Lattner2012-01-234-40/+44
| | | | llvm-svn: 148693
* Replace a use of ConstantUniqueMap for CAZ constants with a simple DenseMap.Chris Lattner2012-01-234-21/+23
| | | | | | | Now that the type system rewrite has landed, there is no need for its complexity and std::map'ness. llvm-svn: 148691
* Make Value::isDereferenceablePointer() handle unreachable code blocks. (ThisNick Lewycky2012-01-231-7/+17
| | | | | | | | returns false in the event the computation feeding into the pointer is unreachable, which maybe ought to be true -- but this is at least consistent with undef->isDereferenceablePointer().) Fixes PR11825! llvm-svn: 148671
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-207-18/+7
| | | | llvm-svn: 148578
* Extend Attributes to 64 bitsKostya Serebryany2012-01-203-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: LLVM needs more function attributes than currently available (32 bits). One such proposed attribute is "address_safety", which shows that a function is being checked for address safety (by AddressSanitizer, SAFECode, etc). Solution: - extend the Attributes from 32 bits to 64-bits - wrap the object into a class so that unsigned is never erroneously used instead - change "unsigned" to "Attributes" throughout the code, including one place in clang. - the class has no "operator uint64 ()", but it has "uint64_t Raw() " to support packing/unpacking. - the class has "safe operator bool()" to support the common idiom: if (Attributes attr = getAttrs()) useAttrs(attr); - The CTOR from uint64_t is marked explicit, so I had to add a few explicit CTOR calls - Add the new attribute "address_safety". Doing it in the same commit to check that attributes beyond first 32 bits actually work. - Some of the functions from the Attribute namespace are worth moving inside the class, but I'd prefer to have it as a separate commit. Tested: "make check" on Linux (32-bit and 64-bit) and Mac (10.6) built/run spec CPU 2006 on Linux with clang -O2. This change will break clang build in lib/CodeGen/CGCall.cpp. The following patch will fix it. llvm-svn: 148553
* Provide better messages in llvm_unreachable.David Blaikie2012-01-171-1/+1
| | | | llvm-svn: 148293
* Remove unreachable code. (replace with llvm_unreachable to help GCC where ↵David Blaikie2012-01-173-5/+1
| | | | | | necessary) llvm-svn: 148284
* Removing unused default switch cases in switches over enums that already ↵David Blaikie2012-01-161-2/+1
| | | | | | | | account for all enumeration values explicitly. (This time I believe I've checked all the -Wreturn-type warnings from GCC & added the couple of llvm_unreachables necessary to silence them. If I've missed any, I'll happily fix them as soon as I know about them) llvm-svn: 148262
* Added MVT::v2f16Pete Cooper2012-01-121-0/+2
| | | | llvm-svn: 148067
* Don't try to create a GEP when the pointee type is unsized (such GEPsDuncan Sands2012-01-111-1/+2
| | | | | | | are invalid). Fixes a crash on array1.C from the GCC testsuite when compiled with dragonegg. llvm-svn: 147946
* Add 'llvm_unreachable' to passify GCC's understanding of the constraintsChandler Carruth2012-01-101-0/+1
| | | | | | | | of several newly un-defaulted switches. This also helps optimizers (including LLVM's) recognize that every case is covered, and we should assume as much. llvm-svn: 147861
* Remove unnecessary default cases in switches that cover all enum values.David Blaikie2012-01-103-7/+0
| | | | llvm-svn: 147855
* generalize LLVMContext::emitError to take a twine instead of a StringRef.Chris Lattner2012-01-031-3/+3
| | | | llvm-svn: 147501
* Type: replaced usage of ID with getTypeID().Stepan Dyatkovskiy2012-01-031-11/+12
| | | | llvm-svn: 147446
* VMCore: add assert for miscompileDylan Noblesmith2011-12-311-0/+5
| | | | | | | | | | | See PR11652. Trying to add this assert to setSubclassData() itself actually prevented the miscompile entirely, so it has to be here. This makes the source of the bug more obvious than the other asserts triggering later on did. llvm-svn: 147390
* Using Inst->setMetadata(..., NULL) should be safe to remove metadata even whenNick Lewycky2011-12-271-2/+4
| | | | | | | | there is non of that type to remove. This fixes a crasher in the particular case where the instruction has metadata but no metadata storage in the context (this is only possible if the instruction has !dbg but no other metadata info). llvm-svn: 147285
* Give string constants generated by IRBuilder private linkage.Benjamin Kramer2011-12-221-1/+1
| | | | | | Fixes PR11640. llvm-svn: 147144
* Add support to add named metadata operand.Devang Patel2011-12-201-0/+11
| | | | | | Patch by Andrew Wilkins! llvm-svn: 146984
* Unweaken vtables as per ↵David Blaikie2011-12-206-1/+49
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* Add basic generic CodeGen support for half.Dan Gohman2011-12-201-0/+3
| | | | llvm-svn: 146927
* The powers that be have decided that LLVM IR should now support 16-bitDan Gohman2011-12-177-27/+67
| | | | | | | | "half precision" floating-point with a first-class type. This patch adds basic IR support (but not codegen support). llvm-svn: 146786
* Make constant folding for GEPs a bit more aggressive.Eli Friedman2011-12-151-1/+1
| | | | llvm-svn: 146639
* Move Instruction::isSafeToSpeculativelyExecute out of VMCore andDan Gohman2011-12-141-53/+0
| | | | | | | | | into Analysis as a standalone function, since there's no need for it to be in VMCore. Also, update it to use isKnownNonZero and other goodies available in Analysis, making it more precise, enabling more aggressive optimization. llvm-svn: 146610
* Fix unused value warning for value used only in assert.Nick Lewycky2011-12-121-5/+2
| | | | llvm-svn: 146440
* LLVMBuild: Remove trailing newline, which irked me.Daniel Dunbar2011-12-121-1/+0
| | | | llvm-svn: 146409
* Don't rely in there being one argument before we've actually identifiedChandler Carruth2011-12-121-3/+4
| | | | | | | a function to upgrade. Also, simplify the code a bit at the expense of one line. llvm-svn: 146368
* Teach the verifier to reject all non-constant arguments to the secondChandler Carruth2011-12-121-0/+6
| | | | | | argument of the cttz and ctlz intrinsics. llvm-svn: 146360
* Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter whichChandler Carruth2011-12-121-6/+33
| | | | | | | | | | | | | | | | | | | | indicates whether the intrinsic has a defined result for a first argument equal to zero. This will eventually allow these intrinsics to accurately model the semantics of GCC's __builtin_ctz and __builtin_clz and the X86 instructions (prior to AVX) which implement them. This patch merely sets the stage by extending the signature of these intrinsics and establishing auto-upgrade logic so that the old spelling still works both in IR and in bitcode. The upgrade logic preserves the existing (inefficient) semantics. This patch should not change any behavior. CodeGen isn't updated because it can use the existing semantics regardless of the flag's value. Note that this will be followed by API updates to Clang and DragonEgg. Reviewed by Nick Lewycky! llvm-svn: 146357
* Add dump method for debugging.Bill Wendling2011-12-091-0/+3
| | | | llvm-svn: 146293
* Push StringRefs through the metadata interface.Benjamin Kramer2011-12-061-2/+2
| | | | llvm-svn: 145934
* Add a little heuristic to Value::isUsedInBasicBlock to speed it up for small ↵Benjamin Kramer2011-12-051-0/+13
| | | | | | | | | | basic blocks. - Calling getUser in a loop is much more expensive than iterating over a few instructions. - Use it instead of the open-coded loop in AddrModeMatcher. - 5% speedup on ARMDisassembler.cpp Release builds. llvm-svn: 145810
* Add support for vectors of pointers.Nadav Rotem2011-12-054-20/+112
| | | | llvm-svn: 145801
OpenPOWER on IntegriCloud