summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Change WriteTypeSymbolic to not put a space out before types, also, removeChris Lattner2009-02-281-4/+7
| | | | | | the old std::ostream version. llvm-svn: 65720
* If compile unit's language is not set then don't crash while dump'ing ↵Devang Patel2009-02-241-1/+2
| | | | | | compile unit. llvm-svn: 65402
* Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,Dan Gohman2009-02-242-77/+100
| | | | | | | | | to more accurately describe what it does. Expand its doxygen comment to describe what the backedge-taken count is and how it differs from the actual iteration count of the loop. Adjust names and comments in associated code accordingly. llvm-svn: 65382
* Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simpleDan Gohman2009-02-241-1/+1
| | | | | | | ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. llvm-svn: 65364
* Use a sign-extend instead of a zero-extend when promoting aDan Gohman2009-02-181-0/+15
| | | | | | | | | | | | trip count value when the original loop iteration condition is signed and the canonical induction variable won't undergo signed overflow. This isn't required for correctness; it just preserves more information about original loop iteration values. Add a getTruncateOrSignExtend method to ScalarEvolution, following getTruncateOrZeroExtend. llvm-svn: 64918
* The debugger sometimes lookup dynamically in the runtime to find ivar info ↵Devang Patel2009-02-171-4/+8
| | | | | | | | of any Objective-C classes. It would be very helpful to debugger if the compiler encodes runtime version number in DWARF. Add support for two additional DWARF attributes to encode Objective-C runtime version number. llvm-svn: 64834
* Emit debug info for bitfields.Devang Patel2009-02-171-3/+12
| | | | llvm-svn: 64815
* Add a method to ScalarEvolution for telling it when a loop has beenDan Gohman2009-02-172-3/+16
| | | | | | | | | | | modified in a way that may effect the trip count calculation. Change IndVars to use this method when it rewrites pointer or floating-point induction variables instead of using a doInitialization method to sneak these changes in before ScalarEvolution has a chance to see the loop. This eliminates the need for LoopPass to depend on ScalarEvolution. llvm-svn: 64810
* Move dumpPassStructure out of line.Dan Gohman2009-02-171-0/+10
| | | | llvm-svn: 64796
* Strengthen the "non-constant stride must dominate loop preheader" check.Evan Cheng2009-02-171-0/+40
| | | | llvm-svn: 64703
* Generalize some alias analysis logic from atomicDuncan Sands2009-02-142-52/+6
| | | | | | intrinsics to any IntrWriteArgMem intrinsics. llvm-svn: 64551
* If a function only reads memory, then we know that...Duncan Sands2009-02-131-7/+11
| | | | | | | | it only reads memory! The other change has no functional effect, it just seems more logical to go in order of decreasing knowledge. llvm-svn: 64463
* Reapply r64300:Nick Lewycky2009-02-131-2/+12
| | | | | | | | | Make sure the SCC pass manager initializes any contained function pass managers. Without this, simplify-libcalls would add nocapture attributes when run on its own, but not when run as part of -std-compile-opts or similar. llvm-svn: 64443
* BasicAA was making the assumption that a local allocation which hadn't escapedNick Lewycky2009-02-131-3/+3
| | | | | | | | couldn't ever be the return of call instruction. However, it's quite possible that said local allocation is itself the return of a function call. That's what malloc and calloc are for, actually. llvm-svn: 64442
* Teach IndVarSimplify to optimize code using the C "int" type forDan Gohman2009-02-121-27/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | loop induction on LP64 targets. When the induction variable is used in addressing, IndVars now is usually able to inserst a 64-bit induction variable and eliminates the sign-extending cast. This is also useful for code using C "short" types for induction variables on targets with 32-bit addressing. Inserting a wider induction variable is easy; the tricky part is determining when trunc(sext(i)) expressions are no-ops. This requires range analysis of the loop trip count. A common case is when the original loop iteration starts at 0 and exits when the induction variable is signed-less-than a fixed value; this case is now handled. This replaces IndVarSimplify's OptimizeCanonicalIVType. It was doing the same optimization, but it was limited to loops with constant trip counts, because it was running after the loop rewrite, and the information about the original induction variable is lost by that point. Rename ScalarEvolution's executesAtLeastOnce to isLoopGuardedByCond, generalize it to be able to test for ICMP_NE conditions, and move it to be a public function so that IndVars can use it. llvm-svn: 64407
* Revert r64300 and r64301. These were causing the following errors respectively:Bill Wendling2009-02-111-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During llvm-gcc bootstrap: Undefined symbols: "llvm::FPPassManager::doFinalization(llvm::Module&)", referenced from: (anonymous namespace)::CGPassManager::doFinalization(llvm::CallGraph&, llvm::Module&) in libLLVMipa.a(CallGraphSCCPass.o) "llvm::FPPassManager::doInitialization(llvm::Module&)", referenced from: (anonymous namespace)::CGPassManager::doInitialization(llvm::CallGraph&, llvm::Module&) in libLLVMipa.a(CallGraphSCCPass.o) ld: symbol(s) not found collect2: ld returned 1 exit status make[3]: *** [/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/obj-llvm/Release/bin/opt] Error 1 During an LLVM release build: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-register-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenRegisterInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td instruction names with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-enums -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrNames.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td instruction information with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td assembly writer with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-asm-writer -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenAsmWriter.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Compiling InstructionCombining.cpp for Release build if /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~dst/Developer/usr/bin/llvm-g++-4.2 -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -Woverloaded-virtual -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -fstrict-aliasing -Wstrict-aliasing -c -MMD -MP -MF "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.lo" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d" /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar/InstructionCombining.cpp -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o ; \ then /bin/mv -f "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Trans llvm-svn: 64311
* Make sure the SCC pass manager initializes any containedDuncan Sands2009-02-111-8/+18
| | | | | | | | function pass managers. Without this, simplify-libcalls would add nocapture attributes when run on its own, but not when run as part of -std-compile-opts or similar. llvm-svn: 64300
* Fix a crasher: we need to check that the function is non-null before using it!Owen Anderson2009-02-061-1/+1
| | | | llvm-svn: 63902
* Refactor my previous change to maintain the distinction between ↵Owen Anderson2009-02-054-88/+84
| | | | | | | | AliasAnalysis and BasicAliasAnalysis. This involves some wider changes because it folds away some never-used methods. llvm-svn: 63900
* Finish making AliasAnalysis aware of the fact that most atomic intrinsics ↵Owen Anderson2009-02-042-0/+37
| | | | | | | | only dereference their arguments, and enhance BasicAA to make use of this fact when computing ModRef info. llvm-svn: 63718
* Teach AliasAnalysis that a bunch of the atomic intrinsics only dereference ↵Owen Anderson2009-02-031-0/+22
| | | | | | their arguments. llvm-svn: 63616
* Move isIdentifiedObject and isNoAliasCall into AliasAnalysis.cpp sinceDan Gohman2009-02-032-24/+24
| | | | | | | | they are useful to analyses other than BasicAliasAnalysis.cpp. Include the full comment for isIdentifiedObject in the header file. Thanks to Chris for suggeseting this. llvm-svn: 63589
* Each input file is encoded as a separate compile unit in LLVM debuggingDevang Patel2009-01-301-38/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | information output. However, many target specific tool chains prefer to encode only one compile unit in an object file. In this situation, the LLVM code generator will include debugging information entities in the compile unit that is marked as main compile unit. The code generator accepts maximum one main compile unit per module. If a module does not contain any main compile unit then the code generator will emit multiple compile units in the output object file. [Part 1] Update DebugInfo APIs to accept optional boolean value while creating DICompileUnit to mark the unit as "main" unit. By defaults all units are considered non-main. Update SourceLevelDebugging.html to document "main" compile unit. Update DebugInfo APIs to not accept and encode separate source file/directory entries while creating various llvm.dbg.* entities. There was a recent, yet to be documented, change to include this additional information so no documentation changes are required here. Update DwarfDebug to handle "main" compile unit. If "main" compile unit is seen then all DIEs are inserted into "main" compile unit. All other compile units are used to find source location for llvm.dbg.* values. If there is not any "main" compile unit then create unique compile unit DIEs for each llvm.dbg.compile_unit. [Part 2] Create separate llvm.dbg.compile_unit for each input file. Mark compile unit create for main_input_filename as "main" compile unit. Use appropriate compile unit, based on source location information collected from the tree node, while creating llvm.dbg.* values using DebugInfo APIs. --- This is Part 1. llvm-svn: 63400
* Fix a post-RA scheduling dependency bug.Dan Gohman2009-01-301-1/+1
| | | | | | | | | | | | | | | If a MachineInstr doesn't have a memoperand but has an opcode that is known to load or store, assume its memory reference may alias *anything*, including stack slots which the compiler completely controls. To partially compensate for this, teach the ScheduleDAG building code to do basic getUnderlyingValue analysis. This greatly reduces the number of instructions that require restrictive dependencies. This code will need to be revisited when we start doing real alias analysis, but it should suffice for now. llvm-svn: 63370
* Add dump() routines to help debug debug info :)Devang Patel2009-01-301-0/+101
| | | | llvm-svn: 63353
* Fix PR3415 (infinite loop in EscapeAnalysis) byDuncan Sands2009-01-282-159/+0
| | | | | | deleting the escape analysis pass. llvm-svn: 63197
* Start generating arbitrary precision integer SCEVs. This removes the temporaryNick Lewycky2009-01-251-11/+1
| | | | | | code that rounded up and capped the size. llvm-svn: 62958
* Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, ↵Devang Patel2009-01-231-2/+6
| | | | | | | | | | | | DW_AT_APPLE_flags. DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way. DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by a project, irrespective of whether the project used makefile, Xcode or something else. llvm-gcc patch is next. llvm-svn: 62888
* fix two more cases where we could let the NLPDI cache get unsorted.Chris Lattner2009-01-231-5/+14
| | | | | | With this, sqlite3 now passes. llvm-svn: 62839
* Unconditionally reset 'cache' to zero, even if we don't need to resort it.Chris Lattner2009-01-231-5/+4
| | | | | | | | | This avoids using a dangling pointer. Reset NumSortedEntries after restoring Cache to avoid extraneous sorts. This fixes the reduced sqlite3 testcase, but apparently not the whole app. llvm-svn: 62838
* a minor tweak to my previous patch, handle the invalidation caseChris Lattner2009-01-231-3/+4
| | | | | | when there are multiple iterations of the loop. This fixes PR3375. llvm-svn: 62822
* introduce a useful abstraction to find out if a Use is in the call position ↵Gabor Greif2009-01-221-1/+2
| | | | | | of an instruction llvm-svn: 62788
* Fix PR3358, a really nasty bug where recursive phi translated Chris Lattner2009-01-221-3/+36
| | | | | | | | analyses could be run without the caches properly sorted. This can fix all sorts of weirdness. Many thanks to Bill for coming up with the 'issorted' verification idea. llvm-svn: 62757
* Need only one set of debug info versions enum.Devang Patel2009-01-201-2/+2
| | | | llvm-svn: 62602
* Eliminate use of uint32_t to improve compatibility with cygwinChris Lattner2009-01-201-6/+6
| | | | llvm-svn: 62590
* Verify debug info.Devang Patel2009-01-191-0/+94
| | | | llvm-svn: 62545
* CMake: Add lib/Analysis/CaptureTracking.cppOscar Fuentes2009-01-181-0/+1
| | | | llvm-svn: 62462
* BasicAliasAnalysis and FunctionAttrs were bothDuncan Sands2009-01-182-52/+113
| | | | | | | | | doing very similar pointer capture analysis. Factor out the common logic. The new version is from FunctionAttrs since it does a better job than the version in BasicAliasAnalysis llvm-svn: 62461
* add a commentGabor Greif2009-01-181-0/+1
| | | | llvm-svn: 62436
* switch over some other methods from indices to iteratorsGabor Greif2009-01-171-8/+8
| | | | llvm-svn: 62430
* speed up iterative loop by using iterators. changes direction, but ↵Gabor Greif2009-01-171-4/+4
| | | | | | | | functionally equivalent if this works out, I'll change the others next. llvm-svn: 62385
* Reinstate r60509 from Dale:Nick Lewycky2009-01-161-0/+1
| | | | | | Make the debugging dump be a full line. llvm-svn: 62325
* Add the private linkage.Rafael Espindola2009-01-153-5/+5
| | | | llvm-svn: 62279
* minor simplificationGabor Greif2009-01-141-2/+2
| | | | llvm-svn: 62232
* Wind SCEV back in time, to Nov 18th. This 'fixes' PR3275, PR3294, PR3295,Nick Lewycky2009-01-132-211/+41
| | | | | | PR3296 and PR3302. llvm-svn: 62160
* Add classof() methods to support isa<> and other related facilities.Devang Patel2009-01-121-8/+2
| | | | llvm-svn: 62104
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-123-3/+3
| | | | | | suggested by Chris. llvm-svn: 62099
* make tblgen autogenerate the nocapture intrinsics for Chris Lattner2009-01-121-4/+0
| | | | | | | llvm.memcpy/memset/memmove. This allows removal of some hackish code from basicaa. llvm-svn: 62071
* Removed trailing whitespace from Makefiles.Misha Brukman2009-01-092-4/+4
| | | | llvm-svn: 61991
* ValueTracker can't assume that an alloca with no specified alignment Chris Lattner2009-01-081-1/+1
| | | | | | | | will get its preferred alignment. It has to be careful and cautiously assume it will just get the ABI alignment. This prevents instcombine from rounding up the alignment of a load/store without adjusting the alignment of the alloca. llvm-svn: 61934
OpenPOWER on IntegriCloud