summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* s/the the/the/Rafael Espindola2012-02-211-1/+1
| | | | llvm-svn: 151079
* Use more idiomatic assert.Rafael Espindola2012-02-211-2/+2
| | | | llvm-svn: 151026
* Avoid warning on non assert builds.Rafael Espindola2012-02-211-2/+3
| | | | llvm-svn: 151025
* It turns out that with the current scev organization ReuseOrCreateCast cannotRafael Espindola2012-02-211-9/+9
| | | | | | | | | | | | | | know where users will be added. Because of this, it cannot use Builder.GetInsertPoint at all. This patch * removes the FIXME about adding the assert. * adds a comment explaining hy we don't have one. * removes a broken logic that only works for some callers and is not needed since r150884. * adds an assert to caller that would have caught the bug fixed by r150884. llvm-svn: 151015
* Make this a bit prettier and more obvious when a derived type isn'tEric Christopher2012-02-201-1/+3
| | | | | | derived from anything. llvm-svn: 150975
* If a derived type is also a composite type, print that informationEric Christopher2012-02-201-2/+7
| | | | | | too. llvm-svn: 150974
* Add support for runtime languages on our forward declarations.Eric Christopher2012-02-201-2/+5
| | | | llvm-svn: 150973
* fold comparisons of gep'd alloca points with null to false,Chris Lattner2012-02-201-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implementing PR12013. We now compile the testcase to: __Z4testv: ## @_Z4testv ## BB#0: ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit pushq %rbx subq $64, %rsp leaq 32(%rsp), %rbx movq %rbx, (%rsp) leaq 64(%rsp), %rax movq %rax, 16(%rsp) movl $1, 32(%rsp) leaq 36(%rsp), %rax movq %rax, 8(%rsp) leaq (%rsp), %rdi callq __Z1gRN4llvm11SmallVectorIiLj8EEE movq (%rsp), %rdi cmpq %rbx, %rdi je LBB0_2 ## BB#1: callq _free LBB0_2: ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit addq $64, %rsp popq %rbx ret instead of: __Z4testv: ## @_Z4testv ## BB#0: pushq %rbx subq $64, %rsp xorl %eax, %eax leaq (%rsp), %rbx addq $32, %rbx movq %rbx, (%rsp) movq %rbx, 8(%rsp) leaq 64(%rsp), %rcx movq %rcx, 16(%rsp) je LBB0_2 ## BB#1: movl $1, 32(%rsp) movq %rbx, %rax LBB0_2: ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit addq $4, %rax movq %rax, 8(%rsp) leaq (%rsp), %rdi callq __Z1gRN4llvm11SmallVectorIiLj8EEE movq (%rsp), %rdi cmpq %rbx, %rdi je LBB0_4 ## BB#3: callq _free LBB0_4: ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit addq $64, %rsp popq %rbx ret This doesn't shrink clang noticably though. llvm-svn: 150944
* Temporarily disable this assert. Looks like it found a similar issue whenRafael Espindola2012-02-181-1/+3
| | | | | | building bullet. llvm-svn: 150885
* Don't skip debug instructions when looking for the insertion point ofRafael Espindola2012-02-181-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the cast. If we do, we can end up with inst1 --------------- < Insertion point dbg inst new inst instead of the desired inst1 new inst --------------- < Insertion point dbg inst Another option would be for InsertNoopCastOfTo (or its callers) to move the insertion point and we would end up with inst1 dbg inst new inst --------------- < Insertion point but that complicates the callers. This fixes PR12018 (and firefox's build). llvm-svn: 150884
* Fix a rather nasty regression from r150690: LHS != RHS does not imply ↵Eli Friedman2012-02-181-1/+2
| | | | | | LHS->stripPointerCasts() != RHS->stripPointerCasts(). llvm-svn: 150863
* Remove a comment about an alternative approach that wouldn'tDan Gohman2012-02-171-4/+1
| | | | | | | | actually work, at least as described. LLVM Metadata is not intended to suppress LLVM IR rules, as it can be stripped at any time. llvm-svn: 150821
* Typo in variable name.Eric Christopher2012-02-171-2/+2
| | | | llvm-svn: 150796
* Revert "InstSimplify: Strip pointer casts early."Benjamin Kramer2012-02-161-6/+5
| | | | | | | Turns out this isn't safe, because the code below depends on LHS and RHS having the same type. llvm-svn: 150695
* InstSimplify: Strip pointer casts early.Benjamin Kramer2012-02-161-5/+6
| | | | llvm-svn: 150694
* InstSimplify: Ignore pointer casts when constant folding compares between ↵Benjamin Kramer2012-02-161-2/+5
| | | | | | pointers. llvm-svn: 150690
* Have AliasSet::aliasesUnknownInst use pointer TBAA info when availableHal Finkel2012-02-101-1/+3
| | | | llvm-svn: 150249
* Fix PR11948: the result type of an icmp may be a vector of boolean -Duncan Sands2012-02-101-0/+5
| | | | | | don't assume it is a boolean. llvm-svn: 150247
* Add support for a temporary forward decl type. We want this so weEric Christopher2012-02-081-0/+22
| | | | | | | | can rauw forward declarations if we decide to emit the full type. Part of rdar://10809898 llvm-svn: 150024
* Remove tabs.Devang Patel2012-02-082-19/+19
| | | | llvm-svn: 150022
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-073-12/+7
| | | | llvm-svn: 149967
* The patch resolves the conflict between AddressSanitizer and load widening ↵Kostya Serebryany2012-02-061-0/+8
| | | | | | | | | (GVN). The problem initially reported by Mozilla folks (http://code.google.com/p/address-sanitizer/issues/detail?id=20), but it also prevents us from enabling LLVM bootstrap with AddressSanitizer. llvm-svn: 149925
* Remove some dead code and tidy things up now that vectors use ConstantDataVectorChris Lattner2012-02-062-31/+16
| | | | | | instead of always using ConstantVector. llvm-svn: 149912
* [unwind removal] Remove all of the code for the dead 'unwind' instruction. ThereBill Wendling2012-02-061-1/+0
| | | | | | | were no 'unwind' instructions being generated before this, so this is in effect a no-op. llvm-svn: 149906
* [unwind removal] We no longer have 'unwind' instructions being generated, soBill Wendling2012-02-061-2/+2
| | | | | | remove the code that handles them. llvm-svn: 149901
* DebugInfo: Provide a new hook to encode relationship between a property and ↵Devang Patel2012-02-062-0/+31
| | | | | | an ivar. llvm-svn: 149874
* Persuade GCC that there is nothing worth warning about here (there isn't).Duncan Sands2012-02-051-2/+2
| | | | llvm-svn: 149834
* reapply the patches reverted in r149470 that reenable ConstantDataArray,Chris Lattner2012-02-052-139/+47
| | | | | | | | | but with a critical fix to the SelectionDAG code that optimizes copies from strings into immediate stores: the previous code was stopping reading string data at the first nul. Address this by adding a new argument to llvm::getConstantStringInfo, preserving the behavior before the patch. llvm-svn: 149800
* remove the blank line from previous ci.Qirun Zhang2012-02-041-1/+0
| | | | llvm-svn: 149758
* test commit.Qirun Zhang2012-02-041-0/+1
| | | | | | add a blank line. llvm-svn: 149757
* Introduce DIObjCProperty. This will be used to encode objective-c property.Devang Patel2012-02-042-0/+20
| | | | llvm-svn: 149732
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-012-3/+4
| | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. llvm-svn: 149481
* Revert Chris' commits up to r149348 that started causing VMCoreTests unit ↵Argyrios Kyrtzidis2012-02-012-45/+140
| | | | | | | | | | | | | | | | | | | test to fail. These are: r149348 r149351 r149352 r149354 r149356 r149357 r149361 r149362 r149364 r149365 llvm-svn: 149470
* remove the last vestiges of llvm::GetConstantStringInfo, in CodeGen.Chris Lattner2012-01-311-10/+0
| | | | llvm-svn: 149356
* Change ConstantArray::get to form a ConstantDataArray when possible,Chris Lattner2012-01-312-139/+54
| | | | | | | | | | | | | | | kicking in the big win of ConstantDataArray. As part of this, change the implementation of GetConstantStringInfo in ValueTracking to work with ConstantDataArray (and not ConstantArray) making it dramatically, amazingly, more efficient in the process and renaming it to getConstantStringInfo. This keeps around a GetConstantStringInfo entrypoint that (grossly) forwards to getConstantStringInfo and constructs the std::string required, but existing clients should move over to getConstantStringInfo instead. llvm-svn: 149351
* Add r149110 back with a fix for when the vector and the int have the sameRafael Espindola2012-01-271-0/+38
| | | | | | width. llvm-svn: 149151
* Revert r149110 and add a testcase that was crashing since that revision.Rafael Espindola2012-01-271-38/+0
| | | | | | | Unfortunately I also had to disable constant-pool-sharing.ll the code it tests has been updated to use the IL logic. llvm-svn: 149148
* enhance constant folding to be able to constant fold bitcast of Chris Lattner2012-01-271-0/+38
| | | | | | ConstantVector's to integer type. llvm-svn: 149110
* progress making the world safe to ConstantDataVector. WhileChris Lattner2012-01-262-55/+60
| | | | | | | | we're at it, allow PatternMatch's "neg" pattern to match integer vector negations, and enhance ComputeNumSigned bits to handle shl of vectors. llvm-svn: 149082
* Use precomputed BB size instead of BB->size().Nick Lewycky2012-01-251-1/+1
| | | | llvm-svn: 148964
* Support pointer comparisons against constants, when looking at the inline-costNick Lewycky2012-01-251-1/+55
| | | | | | | | | savings from a pointer argument becoming an alloca. Sometimes callees will even compare a pointer to null and then branch to an otherwise unreachable block! Detect these cases and compute the number of saved instructions, instead of bailing out and reporting no savings. llvm-svn: 148941
* use Constant::getAggregateElement to simplify a bunch of code.Chris Lattner2012-01-252-86/+30
| | | | llvm-svn: 148934
* Use the right method to get the # elements in a CDS.Chris Lattner2012-01-252-3/+3
| | | | llvm-svn: 148897
* teach valuetracking about ConstantDataSequentialChris Lattner2012-01-241-31/+47
| | | | llvm-svn: 148790
* switch SCEV to use the new ConstantFoldLoadThroughGEPIndices functionChris Lattner2012-01-241-35/+3
| | | | | | | | instead of its own hard coded thing, allowing it to handle ConstantDataSequential and fixing some obscure bugs (e.g. it would previously crash on a CAZ of vector type). llvm-svn: 148788
* Split the interesting bits of ConstantFoldLoadThroughGEPConstantExprChris Lattner2012-01-241-43/+56
| | | | | | | | | | out into a new ConstantFoldLoadThroughGEPIndices (more useful) function and rewrite it to be simpler, more efficient, and to handle the new ConstantDataSequential type. Enhance ConstantFoldLoadFromConstPtr to handle ConstantDataSequential. llvm-svn: 148786
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-207-32/+8
| | | | llvm-svn: 148578
* Remove obviously invalid early exit that prevented analyzing ↵Benjamin Kramer2012-01-201-1/+0
| | | | | | | | ConstantAggregateZeros. Found by the clang static analyzer. llvm-svn: 148540
* Fix CountCodeReductionForAlloca to more accurately represent what SROA can andNick Lewycky2012-01-201-16/+60
| | | | | | | | can't handle. Also don't produce non-zero results for things which won't be transformed by SROA at all just because we saw the loads/stores before we saw the use of the address. llvm-svn: 148536
* SCEVExpander fixes. Affects LSR and indvars.Andrew Trick2012-01-201-115/+114
| | | | | | | | | | | | | | | | LSR has gradually been improved to more aggressively reuse existing code, particularly existing phi cycles. This exposed problems with the SCEVExpander's sloppy treatment of its insertion point. I applied some rigor to the insertion point problem that will hopefully avoid an endless bug cycle in this area. Changes: - Always used properlyDominates to check safe code hoisting. - The insertion point provided to SCEV is now considered a lower bound. This is usually a block terminator or the use itself. Under no cirumstance may SCEVExpander insert below this point. - LSR is reponsible for finding a "canonical" insertion point across expansion of different expressions. - Robust logic to determine whether IV increments are in "expanded" form and/or can be safely hoisted above some insertion point. Fixes PR11783: SCEVExpander assert. llvm-svn: 148535
OpenPOWER on IntegriCloud