summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Query the parameter attributes directly instead of using the Attribute symbols.Bill Wendling2012-09-261-5/+5
| | | | llvm-svn: 164727
* Remove the `hasFnAttr' method from Function.Bill Wendling2012-09-2630-52/+52
| | | | | | | The hasFnAttr method has been replaced by querying the Attributes explicitly. No intended functionality change. llvm-svn: 164725
* X86_32: Large Symbol+Offset relocations.Jim Grosbach2012-09-261-8/+40
| | | | | | | | | | If the offset is more than 24-bits, it won't fit in a scattered relocation offset field, so we fall back to using a non-scattered relocation. rdar://12358909 llvm-svn: 164724
* Initial commit for the AttributesImpl class.Bill Wendling2012-09-264-1/+84
| | | | | | | | This opaque class will contain all of the attributes. All attribute queries will go through this object. This object will also be uniqued in the LLVMContext. Currently not used, so no implementation change. llvm-svn: 164722
* Add case clauses for returning dsp accumulator encoding values in functionAkira Hatanaka2012-09-261-2/+4
| | | | | | getMipsRegisterNumbering. llvm-svn: 164720
* Add DSP accumulator registers and register class. Remove hi/lo registers.Akira Hatanaka2012-09-261-33/+9
| | | | llvm-svn: 164719
* Delete member MipsFunctionInfo::OutArgFIRange and code that accesses it.Akira Hatanaka2012-09-263-31/+8
| | | | llvm-svn: 164718
* Add support for detecting some corei7-class Xeons.Benjamin Kramer2012-09-261-0/+2
| | | | llvm-svn: 164714
* Now that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)Duncan Sands2012-09-261-4/+5
| | | | | | | teach the callgraph logic to not create callgraph edges to intrinsics for invoke instructions; it already skips this for call instructions. Fixes PR13903. llvm-svn: 164707
* YAMLParser: Fix invalid reads when encountering incorrectly quoted scalar.Benjamin Kramer2012-09-261-0/+7
| | | | | | Fixes PR12632. llvm-svn: 164701
* APFloat::roundToIntegral: Special values don't keep the exponent value up to ↵Benjamin Kramer2012-09-261-1/+1
| | | | | | | | 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-261-9/+5
| | | | | | | | - 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-261-0/+6
| | | | | | | 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-261-32/+49
| | | | | | | | | | | | | 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
* Fix ordering of operands on lowering of atomicrmw min/max nodes on ARM.James Molloy2012-09-261-2/+2
| | | | llvm-svn: 164685
* SimplifyCFG: Make the switch-to-lookup table transformation store theHans Wennborg2012-09-261-12/+89
| | | | | | | | | | | | | | | | 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
* 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-262-0/+61
| | | | llvm-svn: 164675
* Add RORX code generation supportMichael Liao2012-09-262-0/+27
| | | | llvm-svn: 164674
* Add MULX code generation supportMichael Liao2012-09-262-27/+83
| | | | llvm-svn: 164673
* Teach the 'lint' sanity checking pass to detect simple buffer overflows.Duncan Sands2012-09-261-19/+39
| | | | llvm-svn: 164671
* Revert the business end of r164636 and try again. I'll come in again. ;]Chandler Carruth2012-09-261-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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-263-4/+4
| | | | | | 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
* Generate an error message instead of asserting or segfaulting when we have aBill Wendling2012-09-261-19/+29
| | | | | | | | 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-261-29/+41
| | | | | | | | 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-261-7/+115
| | | | | | | | and u/srem. Fixed issue with Release build. llvm-svn: 164654
* 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-251-2/+3
| | | | | | | | 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-251-0/+6
| | | | | | | | 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
* Move remaining methods inside the Attributes class. Merge the 'Attribute' ↵Bill Wendling2012-09-252-2/+2
| | | | | | namespaces. llvm-svn: 164631
* Move Attribute::typeIncompatible inside of the Attributes class.Bill Wendling2012-09-254-11/+12
| | | | llvm-svn: 164629
* TargetLowering interface to set/get minimum block entries for jump tables.Sebastian Pop2012-09-253-2/+6
| | | | | | | | | | | | | | 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-251-115/+7
| | | | llvm-svn: 164627
* Add missing i64 max/min/umax/umin on 32-bit targetMichael Liao2012-09-253-0/+90
| | | | | | - 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-251-1/+48
| | | | | | | | | | | 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-251-7/+115
| | | | | | 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-251-5/+10
| | | | | | | | 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-251-6/+18
| | | | | | | | | | | | | | | 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-252-1/+10
| | | | | | 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
* Fix a crash in SROA. This was reported independently by Takumi andChandler Carruth2012-09-251-12/+7
| | | | | | | | | | David (I think), but I would appreciate folks verifying that this fixes the big crasher. I'm still working on a reduced test case, but because this was causing problems I wanted to get the fix checked in quickly. llvm-svn: 164585
OpenPOWER on IntegriCloud