summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Oops...I committed too much.Bill Wendling2009-03-133-142/+101
| | | | llvm-svn: 66867
* Temporarily XFAIL this test.Bill Wendling2009-03-133-101/+142
| | | | llvm-svn: 66866
* Debug intriniscs should be skipped when lookingDale Johannesen2009-03-111-1/+1
| | | | | | for a dependency, not terminate the search. llvm-svn: 66709
* Make Print callable from a pass's print method: add const qualifier. NoTorok Edwin2009-03-111-1/+1
| | | | | | functionality change. llvm-svn: 66700
* Global variables don't have a corresponding llvm.dbg.declare, yet it is possibleTorok Edwin2009-03-102-6/+75
| | | | | | | | to obtain debug info about them. Introduce helpers to access debug info for global variables. Also introduce a helper that works for both local and global variables. llvm-svn: 66541
* Ignore debug intrinsics when computing dependences.Owen Anderson2009-03-091-0/+6
| | | | llvm-svn: 66399
* reimplement AliasSetTracker in terms of DenseMap instead of hash_map,Chris Lattner2009-03-091-36/+52
| | | | | | hopefully no functionality change. llvm-svn: 66398
* Pass in a std::string when getting the names of debugging things. This cuts downBill Wendling2009-03-092-18/+41
| | | | | | on the number of times a std::string is created and copied. llvm-svn: 66396
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. llvm-svn: 66339
* Sprinkle some PrettyStackEntry magic into the passmanager. With this, we nowChris Lattner2009-03-061-5/+7
| | | | | | | | | | | | | | | | get nice and happy stack traces when we crash in an optimizer or codegen. For example, an abort put in UnswitchLoops now looks like this: Stack dump: 0. Program arguments: clang pr3399.c -S -O3 1. <eof> parser at end of file 2. per-module optimization passes 3. Running pass 'CallGraph Pass Manager' on module 'pr3399.c'. 4. Running pass 'Loop Pass Manager' on function '@foo' 5. Running pass 'Unswitch loops' on basic block '%for.inc' Abort llvm-svn: 66260
* Remove this as dbginfo intrinsics has been defined asZhou Sheng2009-03-061-5/+0
| | | | | | IntrNoMem. llvm-svn: 66256
* Ignore the debug info intrinsics when looking for dependency through basic ↵Zhou Sheng2009-03-051-0/+5
| | | | | | block. llvm-svn: 66119
* Ignore the debug info intrinsics when adding instructions into alias sets.Zhou Sheng2009-03-031-0/+3
| | | | llvm-svn: 65934
* 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
OpenPOWER on IntegriCloud