summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
...
* APFloat::roundToIntegral: Special values don't keep the exponent value up to ↵Benjamin Kramer2012-09-262-1/+18
| | | | | | | | date, don't rely on it. Add a couple of unit tests for special floats. Fixes 13929, found by MemorySanitizer. llvm-svn: 164698
* Address Duncan's comments on r164684:Hans Wennborg2012-09-263-11/+31
| | | | | | | | - Put statistics in alphabetical order - Don't use getZextValue when building TableInt, just use APInts - Introduce Create{Z,S}ExtOrTrunc in IRBuilder. llvm-svn: 164696
* Address Duncan's comments on r164682:Hans Wennborg2012-09-261-6/+4
| | | | | | | - Finish assert messages with exclamation mark - Move overflow checking into ShouldBuildLookupTable. llvm-svn: 164692
* Analogous fix to memset and memcpy rewriting. Don't have a test caseChandler Carruth2012-09-261-0/+16
| | | | | | | contrived for these yet, as I spotted them by inspection and the test cases are a bit more tricky to phrase. llvm-svn: 164691
* When rewriting the pointer operand to a load or store which hasChandler Carruth2012-09-262-0/+24
| | | | | | | alignment guarantees attached, re-compute the alignment so that we consider offsets which impact alignment. llvm-svn: 164690
* Teach all of the loads, stores, memsets and memcpys created by theChandler Carruth2012-09-263-47/+95
| | | | | | | | | | | | | rewriter in SROA to carry a proper alignment. This involves interrogating various sources of alignment, etc. This is a more complete and principled fix to PR13920 as well as related bugs pointed out by Eli in review and by inspection in the area. Also by inspection fix the integer and vector promotion paths to create aligned loads and stores. I still need to work up test cases for these... Sorry for the delay, they were found purely by inspection. llvm-svn: 164689
* Add some convenience methods to IRBuilder for constructing aligned loadsChandler Carruth2012-09-261-0/+25
| | | | | | | and stores. These will be used in subsequnet patches to SROA to more systematically manage the alignment on loads and stores. llvm-svn: 164688
* ARM/atomicrmw_minmax.ll: Fix RUN line.NAKAMURA Takumi2012-09-261-1/+1
| | | | llvm-svn: 164687
* Fix tests that didn't test anything.Benjamin Kramer2012-09-263-4/+3
| | | | llvm-svn: 164686
* Fix ordering of operands on lowering of atomicrmw min/max nodes on ARM.James Molloy2012-09-262-2/+23
| | | | llvm-svn: 164685
* SimplifyCFG: Make the switch-to-lookup table transformation store theHans Wennborg2012-09-262-26/+162
| | | | | | | | | | | | | | | | tables in bitmaps when they fit in a target-legal register. This saves some space, and it also allows for building tables that would otherwise be deemed too sparse. One interesting case that this hits is example 7 from http://blog.regehr.org/archives/320. We currently generate good code for this when lowering the switch to the selection DAG: we build a bitmask to decide whether to jump to one block or the other. My patch will result in the same bitmask, but it removes the need for the jump, as the return value can just be retrieved from the mask. llvm-svn: 164684
* SimplifyCFG: Refactor the switch-to-lookup table transformation byHans Wennborg2012-09-261-72/+115
| | | | | | breaking out the building of lookup tables into a separate class. llvm-svn: 164682
* llvm/test/CodeGen/X86/mulx*.ll: Fix copypasto.NAKAMURA Takumi2012-09-262-2/+2
| | | | llvm-svn: 164681
* The assumption that /proc/self/exe always exists is incorrect.Sylvestre Ledru2012-09-261-4/+13
| | | | | | | | | | | For example, under a Linux chroot, /proc/ might not be mounted. Therefor, we test if this file exist. If it is the case, use it (the current behavior). Otherwise, we fall back to the detection used by *BSD. The issue has been reported initially on the Debian bug tracker: http://bugs.debian.org/674588 llvm-svn: 164676
* Add SARX/SHRX/SHLX code generation supportMichael Liao2012-09-265-2/+241
| | | | llvm-svn: 164675
* Add RORX code generation supportMichael Liao2012-09-266-5/+86
| | | | llvm-svn: 164674
* Add MULX code generation supportMichael Liao2012-09-264-27/+127
| | | | llvm-svn: 164673
* Teach the 'lint' sanity checking pass to detect simple buffer overflows.Duncan Sands2012-09-262-19/+51
| | | | llvm-svn: 164671
* Revert r164663 due to buildbot failure.Craig Topper2012-09-261-12/+12
| | | | llvm-svn: 164670
* Revert the business end of r164636 and try again. I'll come in again. ;]Chandler Carruth2012-09-262-21/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should really, really fix PR13916. For real this time. The underlying bug is... a bit more subtle than I had imagined. The setup is a code pattern that leads to an @llvm.memcpy call with two equal pointers to an alloca in the source and dest. Now, not any pattern will do. The alloca needs to be formed just so, and both pointers should be wrapped in different bitcasts etc. When this precise pattern hits, a funny sequence of events transpires. First, we correctly detect the potential for overlap, and correctly optimize the memcpy. The first time. However, we do simplify the set of users of the alloca, and that causes us to run the alloca back through the SROA pass in case there are knock-on simplifications. At this point, a curious thing has happened. If we happen to have an i8 alloca, we have direct i8 pointer values. So we don't bother creating a cast, we rewrite the arguments to the memcpy to dircetly refer to the alloca. Now, in an unrelated area of the pass, we have clever logic which ensures that when visiting each User of a particular pointer derived from an alloca, we only visit that User once, and directly inspect all of its operands which refer to that particular pointer value. However, the mechanism used to detect memcpy's with the potential to overlap relied upon getting visited once per *Use*, not once per *User*. This is always true *unless* the same exact value is both source and dest. It turns out that almost nothing actually produces that pattern though. We can hand craft test cases that more directly test this behavior of course, and those are included. Also, note that there is a significant missed optimization here -- we prove in many cases that there is a non-volatile memcpy call with identical source and dest addresses. We shouldn't prevent splitting the alloca in that case, and in fact we should just remove such memcpy calls eagerly. I'll address that in a subsequent commit. llvm-svn: 164669
* Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches ↵Craig Topper2012-09-261-9/+14
| | | | | | other similar methods. llvm-svn: 164668
* Replace calls to getSizeInBits with getExtendedSizeInBits since its already ↵Craig Topper2012-09-261-7/+7
| | | | | | known its an extended type. llvm-svn: 164667
* Rename virtual table anchors from Anchor() to anchor() for consistency with ↵Craig Topper2012-09-266-8/+8
| | | | | | the rest of the tree. llvm-svn: 164666
* Remove hasNoAVX method. Can just invert hasAVX instead.Craig Topper2012-09-262-7/+6
| | | | llvm-svn: 164664
* Mark extended type querying methods as 'readonly' to reduce compile size.Craig Topper2012-09-261-12/+12
| | | | llvm-svn: 164663
* Generate an error message instead of asserting or segfaulting when we have aBill Wendling2012-09-262-19/+40
| | | | | | | | scalar-to-vector conversion that we cannot handle. For instance, when an invalid constraint is used in an inline asm statement. <rdar://problem/12284092> llvm-svn: 164662
* Add 'lock' prefix output support in assembly printerMichael Liao2012-09-263-33/+38
| | | | | | | | - Instead of embedding 'lock' into each mnemonic of atomic instructions except 'xchg', we teach X86 assembly printer to output 'lock' prefix similar to or consistent with code emitter. llvm-svn: 164659
* Generate an error message instead of asserting or segfaulting when we have aBill Wendling2012-09-262-29/+52
| | | | | | | | scalar-to-vector conversion that we cannot handle. For instance, when an invalid constraint is used in an inline asm statement. <rdar://problem/12284092> llvm-svn: 164657
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-263-7/+221
| | | | | | | | and u/srem. Fixed issue with Release build. llvm-svn: 164654
* Revert "Add --program-prefix support to build"Jordan Rose2012-09-266-21/+11
| | | | | | | | | | | | | The Apple buildbots are set up to pass --target to configure for both cross- and non-cross-compile builds, and the standard autoconf response to this is to set the program prefix to '<target>-'. Until we can figure out the proper way to handle this (don't pass --target? pass an explicit --program-prefix=""? don't auto-populate program_prefix with target_alias?) it's more important to keep the buildbots running. This reverts r164633 / ba48ceb1a3802e20e781ef04ea2573ffae2ac414. llvm-svn: 164651
* Initialize boolean variables in MipsSubtarget's constructor.Akira Hatanaka2012-09-251-1/+2
| | | | llvm-svn: 164642
* Don't drop the alignment on a memcpy intrinsic when producing a store. This isNick Lewycky2012-09-252-2/+19
| | | | | | | | only a missed optimization opportunity if the store is over-aligned, but a miscompile if the store's new type has a higher natural alignment than the memcpy did. Fixes PR13920! llvm-svn: 164641
* blank line for test commitReed Kotler2012-09-251-0/+1
| | | | llvm-svn: 164640
* Revert the business end of r164634, and replace it with a different fix. TheNick Lewycky2012-09-251-7/+4
| | | | | | | | | reason we were getting two of the same alloca is because of a memmove/memcpy which had the same alloca in both the src and dest. Now we detect that case directly. This has the same testcase as before, but fixes a clang test CodeGenObjC/exceptions.m which runs clang -O2. llvm-svn: 164636
* Don't try to promote the same alloca twice. Fixes PR13916!Nick Lewycky2012-09-252-0/+28
| | | | | | | | Chandler, it's not obvious that it's okay that this alloca gets into the list twice to begin with. Please review and see whether this is the fix you really want, but I wanted to get a fix checked in quickly. llvm-svn: 164634
* Add --program-prefix support to buildSebastian Pop2012-09-256-11/+21
| | | | llvm-svn: 164633
* Move remaining methods inside the Attributes class. Merge the 'Attribute' ↵Bill Wendling2012-09-253-87/+80
| | | | | | namespaces. llvm-svn: 164631
* docs: Sphinxify HowToSubmitABugSean Silva2012-09-253-346/+235
| | | | llvm-svn: 164630
* Move Attribute::typeIncompatible inside of the Attributes class.Bill Wendling2012-09-255-14/+15
| | | | llvm-svn: 164629
* TargetLowering interface to set/get minimum block entries for jump tables.Sebastian Pop2012-09-254-2/+21
| | | | | | | | | | | | | | Provide interface in TargetLowering to set or get the minimum number of basic blocks whereby jump tables are generated for switch statements rather than an if sequence. getMinimumJumpTableEntries() defaults to 4. setMinimumJumpTableEntries() allows target configuration. This patch changes the default for the Hexagon architecture to 5 as it improves performance on some benchmarks. llvm-svn: 164628
* Revert r164614 to appease the buildbots.Chad Rosier2012-09-253-222/+7
| | | | llvm-svn: 164627
* Make this test check the transforms it's actually doing. Also add a test that itNick Lewycky2012-09-251-3/+17
| | | | | | doesn't transform the trivially unsafe case. llvm-svn: 164617
* Add missing i64 max/min/umax/umin on 32-bit targetMichael Liao2012-09-255-1/+141
| | | | | | - Turn on atomic6432.ll and add specific test case as well llvm-svn: 164616
* ARM: Darwin BL/BLX relocations to out-of-range symbols.Jim Grosbach2012-09-252-1/+91
| | | | | | | | | | | When a BL/BLX references a symbol in the same translation unit that is out of range, use an external relocation. The linker will use this to generate a branch island rather than a direct reference, allowing the relocation to resolve correctly. rdar://12359919 llvm-svn: 164615
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-253-7/+222
| | | | | | and u/srem. llvm-svn: 164614
* Consistently specify the assembly variant to MatchInstructionImpl.Bob Wilson2012-09-251-4/+8
| | | | llvm-svn: 164611
* Fix a case where SROA did not correctly detect dead PHI or selects dueChandler Carruth2012-09-252-5/+55
| | | | | | | | to chains or cycles between PHIs and/or selects. Also add a couple of really nice test cases reduced from Kostya's reports in PR13905 and PR13906. Both are fixed by this patch. llvm-svn: 164596
* Change the way the lint sanity checking pass detects misaligned memory accesses.Duncan Sands2012-09-252-8/+24
| | | | | | | | | | | | | | | Previously it was only be able to detect problems if the pointer was a numerical value (eg inttoptr i32 1 to i32*), but not if it was an alloca or globa. The reason was the use of ComputeMaskedBits: imagine you have "alloca i8, align 2", and ask ComputeMaskedBits what it knows about the bits of the alloca pointer. It can tell you that the bottom bit is known zero (due to align 2) but it can't tell you that bit 1 is known one. That's because the address could be an even multiple of 2 rather than an odd multiple, eg it might be a multiple of 4. Thus trying to use KnownOne is ineffective in the case of an alloca as it will never have any bits set. Instead look explicitly for constant offsets from allocas and globals. llvm-svn: 164595
* Fix an illegal tailcall opt where the callee returns a double via xmm while ↵Evan Cheng2012-09-253-4/+36
| | | | | | caller returns x86_fp80 via st0. rdar://12229511 llvm-svn: 164588
* Fix a -Wparentheses warning in the mingw buildNico Weber2012-09-251-1/+1
| | | | llvm-svn: 164587
OpenPOWER on IntegriCloud