summaryrefslogtreecommitdiff
path: root/unittests/IR
Commit message (Collapse)AuthorAge
* Merge CallGraph and BasicCallGraph.Rafael Espindola2013-10-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193734 91177308-0d34-0410-b5e6-96231b3b80d8
* Add calls to doInitialization() and doFinalization() in verifyFunction()Rafael Espindola2013-10-30
| | | | | | | | | | | | | | | | | | | | | | The function verifyFunction() in lib/IR/Verifier.cpp misses some calls. It creates a temporary FunctionPassManager that will run a single Verifier pass. Unfortunately, FunctionPassManager is no PassManager and does not call doInitialization() and doFinalization() by itself. Verifier does important tasks in doInitialization() such as collecting type information used to check DebugInfo metadata and doFinalization() does some additional checks. Therefore these checks were missed and debug info couldn't be verified at all, it just crashed if the function had some. verifyFunction() is currently not used in llvm unless -debug option is enabled, and in unittests/IR/VerifierTest.cpp VerifierTest had to be changed to create the function in a module from which the type debug info can be collected. Patch by Michael Kruse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193719 91177308-0d34-0410-b5e6-96231b3b80d8
* Silencing an MSVC warning.Aaron Ballman2013-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192042 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix getOrInsertGlobal dropping the address space.Matt Arsenault2013-09-30
| | | | | | | | Currently it will insert an illegal bitcast. Arguably, the address space argument should be added for the creation case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191702 91177308-0d34-0410-b5e6-96231b3b80d8
* IRBuilder: Add RAII objects to reset insertion points or fast math flags.Benjamin Kramer2013-09-30
| | | | | | | | Inspired by the object from the SLPVectorizer. This found a minor bug in the debug loc restoration in the vectorizer where the location of a following instruction was attached instead of the location from the original instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191673 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert patches to add case-range support for PR1255.Bob Wilson2013-09-09
| | | | | | | | | | | | | | | | | The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190328 91177308-0d34-0410-b5e6-96231b3b80d8
* Make one of the AttributeSet ctors maintain the invariant that thePeter Collingbourne2013-08-02
| | | | | | | | attribute list is ordered by index. Differential Revision: http://llvm-reviews.chandlerc.com/D1265 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187682 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ptr vector inconsistency in CreatePointerCastMatt Arsenault2013-07-31
| | | | | | | | One form would accept a vector of pointers, and the other did not. Make both accept vectors of pointers, and add an assertion for the number of elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187464 91177308-0d34-0410-b5e6-96231b3b80d8
* Respect address space sizes in isEliminableCastPair.Matt Arsenault2013-07-30
| | | | | | | This avoids constant folding bitcast/ptrtoint/inttoptr combinations that have illegal bitcasts between differently sized address spaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187455 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Remove isCastable since nothing uses it now"Matt Arsenault2013-07-30
| | | | | | Apparently dragonegg uses it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187454 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove isCastable since nothing uses it nowMatt Arsenault2013-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187448 91177308-0d34-0410-b5e6-96231b3b80d8
* Change behavior of calling bitcasted alias functions.Matt Arsenault2013-07-30
| | | | | | | | It will now only convert the arguments / return value and call the underlying function if the types are able to be bitcasted. This avoids using fp<->int conversions that would occur before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187444 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix copypaste error in test.Matt Arsenault2013-06-28
| | | | | | Thename says it's an i32*, but it was actually creating another i8* git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185239 91177308-0d34-0410-b5e6-96231b3b80d8
* Add unit test to test a trivial verifier check.Bill Wendling2013-06-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184338 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing PatternMatch.cpp to CMakeLists.txtArnold Schwaighofer2013-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181147 91177308-0d34-0410-b5e6-96231b3b80d8
* PatternMatch: Matcher for (un)ordered floating point min/maxArnold Schwaighofer2013-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for matching 'ordered' and 'unordered' floating point min/max constructs. In LLVM we can express min/max functions as a combination of compare and select. We have support for matching such constructs for integers but not for floating point. In floating point math there is no total order because of the presence of 'NaN'. Therefore, we have to be careful to preserve the original fcmp semantics when interpreting floating point compare select combinations as a minimum or maximum function. The resulting 'ordered/unordered' floating point maximum function has to select the same value as the select/fcmp combination it is based on. ordered_max(x,y) = max(x,y) iff x and y are not NaN, y otherwise unordered_max(x,y) = max(x,y) iff x and y are not NaN, x otherwise ordered_min(x,y) = min(x,y) iff x and y are not NaN, y otherwise unordered_min(x,y) = min(x,y) iff x and y are not NaN, x otherwise This matches the behavior of the underlying select(fcmp(olt/ult/.., L, R), L, R) construct. Any code using this predicate has to preserve this semantics. A follow-up patch will use this to implement floating point min/max reductions in the vectorizer. radar://13723044 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181143 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a disconcerting bug in Value::isUsedInBasicBlock, which gave wrong ↵Benjamin Kramer2013-04-12
| | | | | | | | answers for blocks larger than 3 instrs. Also add a unit test. PR15727. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179370 91177308-0d34-0410-b5e6-96231b3b80d8
* Change GetPointerBaseWithConstantOffset's DataLayout argument from aDan Gohman2013-01-31
| | | | | | | | reference to a pointer, so that it can handle the case where DataLayout is not available and behave conservatively. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174024 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test to not use the AttributeSet's AttributeWithIndex creation method.Bill Wendling2013-01-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173608 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/unittests: Use OwningPtr to fix --vg-leak.NAKAMURA Takumi2013-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173240 91177308-0d34-0410-b5e6-96231b3b80d8
* IRTests/WaymarkTest.cpp: Fix in --vg-leak.NAKAMURA Takumi2013-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173239 91177308-0d34-0410-b5e6-96231b3b80d8
* IRTests/IRBuilderTest.cpp: GetIntTy: Delete DL at yourself since it is not ↵NAKAMURA Takumi2013-01-23
| | | | | | linked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173238 91177308-0d34-0410-b5e6-96231b3b80d8
* IRTests/IRBuilderTest.cpp: Let GV added to the module.NAKAMURA Takumi2013-01-23
| | | | | | It fixes --vg-leak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173237 91177308-0d34-0410-b5e6-96231b3b80d8
* IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction ↵NAKAMURA Takumi2013-01-23
| | | | | | immediately if it is not linked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173236 91177308-0d34-0410-b5e6-96231b3b80d8
* Untabify.NAKAMURA Takumi2013-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173235 91177308-0d34-0410-b5e6-96231b3b80d8
* DominatorTreeTest.cpp: Add the file header.NAKAMURA Takumi2013-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173233 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow vectors in CreatePointerCast of constants.Evgeniy Stepanov2013-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172615 91177308-0d34-0410-b5e6-96231b3b80d8
* A test for r172535.Evgeniy Stepanov2013-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172614 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve r172464: const_cast is not needed if the variable is not constDmitri Gribenko2013-01-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172474 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix CastsDavid Greene2013-01-14
| | | | | | Use const_cast<> to avoid cast-away-const errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172464 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unit test to verifies that attribute uniquing works so it doesn't ↵Benjamin Kramer2013-01-12
| | | | | | | | break again. The folding set details can be subtle and broke twice in the last couple of weeks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172313 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the VMCore unittest tree to IR. Somehow was missed when doing theChandler Carruth2013-01-07
library rename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171747 91177308-0d34-0410-b5e6-96231b3b80d8