aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* switch the constantexpr, target folder, and IRBuilder interfacesChris Lattner2011-02-105-202/+145
| | | | | | | | for NSW/NUW binops to follow the pattern of exact binops. This allows someone to use Builder.CreateAdd(x, y, "tmp", MaybeNUW); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125270 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance a bunch of transformations in instcombine to start generatingChris Lattner2011-02-1012-160/+196
| | | | | | | | | | | | | exact/nsw/nuw shifts and have instcombine infer them when it can prove that the relevant properties are true for a given shift without them. Also, a variety of refactoring to use the new patternmatch logic thrown in for good luck. I believe that this takes care of a bunch of related code quality issues attached to PR8862. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125267 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance the "compare with shift" and "compare with div" Chris Lattner2011-02-103-74/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimizations to be much more aggressive in the face of exact/nsw/nuw div and shifts. For example, these (which are the same except the first is 'exact' sdiv: define i1 @sdiv_icmp4_exact(i64 %X) nounwind { %A = sdiv exact i64 %X, -5 ; X/-5 == 0 --> x == 0 %B = icmp eq i64 %A, 0 ret i1 %B } define i1 @sdiv_icmp4(i64 %X) nounwind { %A = sdiv i64 %X, -5 ; X/-5 == 0 --> x == 0 %B = icmp eq i64 %A, 0 ret i1 %B } compile down to: define i1 @sdiv_icmp4_exact(i64 %X) nounwind { %1 = icmp eq i64 %X, 0 ret i1 %1 } define i1 @sdiv_icmp4(i64 %X) nounwind { %X.off = add i64 %X, 4 %1 = icmp ult i64 %X.off, 9 ret i1 %1 } This happens when you do something like: (ptr1-ptr2) == 42 where the pointers are pointers to non-unit types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125266 91177308-0d34-0410-b5e6-96231b3b80d8
* more cleanups, notably bitcast isn't used for "signed to unsigned type Chris Lattner2011-02-102-46/+28
| | | | | | | conversions". :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125265 91177308-0d34-0410-b5e6-96231b3b80d8
* A bunch of cleanups and simplifications using the new PatternMatch predicatesChris Lattner2011-02-101-176/+132
| | | | | | | | | | | | and generally tidying things up. Only very trivial functionality changes like now doing (-1 - A) -> (~A) for vectors too. InstCombineAddSub.cpp | 296 +++++++++++++++++++++----------------------------- 1 file changed, 126 insertions(+), 170 deletions(-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125264 91177308-0d34-0410-b5e6-96231b3b80d8
* teach SimplifyDemandedBits that exact shifts demand the bits they Chris Lattner2011-02-101-3/+23
| | | | | | | | are shifting out since they do require them to be zeros. Similarly for NUW/NSW bits of shl git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125263 91177308-0d34-0410-b5e6-96231b3b80d8
* After 3-addressifying a two-address instruction, update the register maps; ↵Evan Cheng2011-02-102-14/+31
| | | | | | add a missing check when considering whether it's profitable to commute. rdar://8977508. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125259 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert this in an attempt to bring the builders back.Eric Christopher2011-02-101-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125257 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't return before calling the post-processing function(s).Bill Wendling2011-02-101-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125256 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn this pass ordering:Cameron Zwarich2011-02-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Natural Loop Information Loop Pass Manager Canonicalize natural loops Scalar Evolution Analysis Loop Pass Manager Induction Variable Users Canonicalize natural loops Induction Variable Users Loop Strength Reduction into this: Scalar Evolution Analysis Loop Pass Manager Canonicalize natural loops Induction Variable Users Loop Strength Reduction This fixes <rdar://problem/8869639>. I also filed PR9184 on doing this sort of thing automatically, but it seems easier to just change the ordering of the passes if this is the only case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125254 91177308-0d34-0410-b5e6-96231b3b80d8
* Do AsmMatcher operand classification per-opcode.Jim Grosbach2011-02-102-89/+29
| | | | | | | | | | | | When matching operands for a candidate opcode match in the auto-generated AsmMatcher, check each operand against the expected operand match class. Previously, operands were classified independently of the opcode being handled, which led to difficulties when operand match classes were more complicated than simple subclass relationships. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125245 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete unused code for analyzing and splitting around loops.Jakob Stoklund Olesen2011-02-092-389/+2
| | | | | | | Loop splitting is better handled by the more generic global region splitting based on the edge bundle graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125243 91177308-0d34-0410-b5e6-96231b3b80d8
* Rip out realpath() support. It's expensive, and often a bad idea, andDouglas Gregor2011-02-092-39/+0
| | | | | | | I have another way to achieve the same goal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125239 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify using the new leaveIntvBefore()Jakob Stoklund Olesen2011-02-091-13/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125238 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the LiveBLocks array for SplitEditor::splitSingleBlocks() as well.Jakob Stoklund Olesen2011-02-092-44/+47
| | | | | | | This fixes a bug where splitSingleBlocks() could split a live range after a terminator instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125237 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix the build after r125228.Cameron Zwarich2011-02-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125236 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Mikhail Glushenkov2011-02-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125232 91177308-0d34-0410-b5e6-96231b3b80d8
* Move calcLiveBlockInfo() and the BlockInfo struct into SplitAnalysis.Jakob Stoklund Olesen2011-02-095-145/+143
| | | | | | No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125231 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::sys::path::canonical(), which provides the canonicalizedDouglas Gregor2011-02-092-0/+39
| | | | | | | | | | | name of a path, after resolving symbolic links and eliminating excess path elements such as "foo/../" and "./". This routine still needs a Windows implementation, but I don't have a Windows machine available. Help? Please? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125228 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore <undef> uses when analyzing and rewriting.Jakob Stoklund Olesen2011-02-091-2/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125226 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert on bad jump tables.Jakob Stoklund Olesen2011-02-091-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125225 91177308-0d34-0410-b5e6-96231b3b80d8
* Add tags to live interval unions to avoid using stale queries.Jakob Stoklund Olesen2011-02-092-2/+15
| | | | | | | The tag is updated whenever the live interval union is changed, and it is tested before using cached information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125224 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comparator used for looking up previously instantiated EDDisassemblers.Shantonu Sen2011-02-091-2/+4
| | | | | | | | | | | Now, Syntax is only used as a tie-breaker if the Arch matches. Previously, a request for x86_64 disassembler followed by the i386 disassembler in a single process would return the cached x86_64 disassembler. Fixes <rdar://problem/8958982> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125215 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize po_iterator: don't do redundant lookups.Dan Gohman2011-02-091-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125211 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't run ocamldoc if it's not installedErick Tryzelaar2011-02-091-1/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125203 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compiling the ocaml kaleidoscope tutorialsErick Tryzelaar2011-02-093-2/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125202 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting and comment tweaks.Duncan Sands2011-02-091-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125200 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach instsimplify some tricks about exact/nuw/nsw shifts.Chris Lattner2011-02-094-47/+126
| | | | | | | | improve interfaces to instsimplify to take this info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125196 91177308-0d34-0410-b5e6-96231b3b80d8
* merge two tests.Chris Lattner2011-02-092-8/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125195 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/ExactChris Lattner2011-02-095-427/+287
| | | | | | | | | | | | | | | | | | | | versions of creation functions. Eventually, the "insertion point" versions of these should just be removed, we do have IRBuilder afterall. Do a massive rewrite of much of pattern match. It is now shorter and less redundant and has several other widgets I will be using in other patches. Among other changes, m_Div is renamed to m_IDiv (since it only matches integer divides) and m_Shift is gone (it used to match all binops!!) and we now have m_LogicalShift for the one client to use. Enhance IRBuilder to have "isExact" arguments to things like CreateUDiv and reduce redundancy within IRbuilder by having these methods chain to each other more instead of duplicating code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125194 91177308-0d34-0410-b5e6-96231b3b80d8
* emit a specific error when the input file is empty. This fixes Chris Lattner2011-02-091-0/+5
| | | | | | | | | | an annoyance of mine when working on tests: if the input .ll file is broken, opt outputs an error and generates an empty file. FileCheck then emits its "ooh I couldn't find the first CHECK line, scanning from ..." which obfuscates the actual problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125193 91177308-0d34-0410-b5e6-96231b3b80d8
* fix typoChris Lattner2011-02-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125192 91177308-0d34-0410-b5e6-96231b3b80d8
* enrich folder interfaces around exactness.Chris Lattner2011-02-092-28/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125191 91177308-0d34-0410-b5e6-96231b3b80d8
* refactor ConstantExpr interfaces a bit around "exactness".Chris Lattner2011-02-092-37/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125190 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a small scattering of basically pointless tests. These areChris Lattner2011-02-0919-260/+0
| | | | | | | | all covered by llvm-test, which is what they were reduced from back in 2003. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125189 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a broken test, this is matching nounwind on intrinsics, not the old ↵Chris Lattner2011-02-091-10/+0
| | | | | | unwind instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125188 91177308-0d34-0410-b5e6-96231b3b80d8
* [AVX] Implement 256-bit vector lowering for INSERT_VECTOR_ELT.David Greene2011-02-091-6/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125187 91177308-0d34-0410-b5e6-96231b3b80d8
* Add intrinsic for setc instruction on the XCore.Richard Osborne2011-02-093-1/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125186 91177308-0d34-0410-b5e6-96231b3b80d8
* When removing a function from the function set and adding it to deferred, weNick Lewycky2011-02-092-2/+295
| | | | | | | | | | | | | | could end up removing a different function than we intended because it was functionally equivalent, then end up with a comparison of a function against itself in the next round of comparisons (the one in the function set and the one on the deferred list). To fix this, I introduce a choice in the form of comparison for ComparableFunctions, either normal or "pointer only" used to find exact Function*'s in lookups. Also add some debugging statements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125180 91177308-0d34-0410-b5e6-96231b3b80d8
* Add testing stuff to CMake documents.NAKAMURA Takumi2011-02-092-2/+18
| | | | | | | | - Note "GnuWin32". - Note LLVM_LIT_TOOLS_DIR - Now we can run tests on VS w/e all tests might pass or not! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125177 91177308-0d34-0410-b5e6-96231b3b80d8
* test/lit.cfg: Seek sane tools(and bash) in directories and set to $PATH.NAKAMURA Takumi2011-02-091-1/+13
| | | | | | LitConfig.getBashPath() will not seek in $PATH after LitConfig.getToolsPath() was executed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125176 91177308-0d34-0410-b5e6-96231b3b80d8
* lit/LitConfig.py: Add the new method getToolsPath(dir,paths,tools).NAKAMURA Takumi2011-02-091-0/+16
| | | | | | | | It seeks tools(eg. [cmp, grep, sed]) in same directory, to be sane. It seeks "bash" only in the directory found at last time. Or bash would be insane (against other tools). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125175 91177308-0d34-0410-b5e6-96231b3b80d8
* lit/Util.py: Add two functions, checkToolsPath(dir,tools) and ↵NAKAMURA Takumi2011-02-091-0/+12
| | | | | | | | | | | | | whichTools(tools,paths). checkToolsPath(dir,tools): return True if "dir" contains all "tools". whichTools(tools,paths): return a directory that contains all "tools" in "paths". Or return None when all "tools" were not met. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125174 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Add the new option LLVM_LIT_TOOLS_DIR. It can specify "Path to ↵NAKAMURA Takumi2011-02-092-0/+3
| | | | | | GnuWin32 tools". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125173 91177308-0d34-0410-b5e6-96231b3b80d8
* lib/Support/Errno.cpp: Check strerror_s() with HAVE_DECL_STRERROR_S in ↵NAKAMURA Takumi2011-02-096-11/+102
| | | | | | | | | | | config.h.*. AC_CHECK_FUNCS seeks a symbol only in libs. We should check the declaration in string.h. FIXME: I have never seen mingw(s) have strerror_s() (not _strerror_s()). FIXME: Autoconf/CMake may seek strerror_s() with the definition MINGW_HAS_SECURE_API in future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125172 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows/Windows.h: Redefine _WIN32_WINNT here. mingw-w64 tends to define it ↵NAKAMURA Takumi2011-02-091-0/+3
| | | | | | as 0x0502 in its headers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125171 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows/Program.inc: Eliminate the declaration of SetInformationJobObject(). ↵NAKAMURA Takumi2011-02-091-9/+0
| | | | | | It should be provided with _WIN32_WINNT>=0x0500. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125170 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows/DynamicLibrary.inc: ELM_Callback fix for mingw-w64.NAKAMURA Takumi2011-02-091-1/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125169 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-lit may be available with CMake.NAKAMURA Takumi2011-02-091-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125168 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-lit may be able to invoke clang tests.NAKAMURA Takumi2011-02-091-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125167 91177308-0d34-0410-b5e6-96231b3b80d8