aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR11422.Jakob Stoklund Olesen2011-11-232-3/+10
| | | | | | | | | | | | | This was a bug in keeping track of the available domains when merging domain values. The wrong domain mask caused ExecutionDepsFix to try to move VANDPSYrr to the integer domain which is only available in AVX2. Also add an assertion to catch future attempts at emitting AVX2 instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145096 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash in block placement due to an inner loop that happened to beChandler Carruth2011-11-231-1/+4
| | | | | | | | | | | reversed in the function's original ordering, and we happened to encounter it while handling an outer unnatural CFG structure. Thanks to the test case reduced from GCC's source by Benjamin Kramer. This may also fix a crasher in gzip that Duncan reduced for me, but I haven't yet gotten to testing that one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145094 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] do not instrument threadlocal globals, this is buggyKostya Serebryany2011-11-231-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145092 91177308-0d34-0410-b5e6-96231b3b80d8
* add basic PPC register-pressure feedback; adjust the vaarg test to match the ↵Hal Finkel2011-11-224-5/+28
| | | | | | new register-allocation pattern git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145065 91177308-0d34-0410-b5e6-96231b3b80d8
* More fixes to the X86InstComments for shuffle instructions. In particular ↵Craig Topper2011-11-223-44/+60
| | | | | | add AVX flavors of many instructions and fix the destination operand for some of the existing AVX entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145063 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a devilish miscompile exposed by block placement. TheChandler Carruth2011-11-221-2/+8
| | | | | | | | | | | | | | | | | | | | | updateTerminator code didn't correctly handle EH terminators in one very specific case. AnalyzeBranch would find no terminator instruction, and so the fallback in updateTerminator is to assume fallthrough. This is correct, but the destination of the fallthrough was assumed to be the first successor. This is *almost always* true, but in certain cases the loop transformations will cause the landing pad to be the first successor! Instead of this brittle logic, actually look through the successors for a non-landing-pad accessor, and to assert if more than one is found. This will hopefully fix some (if not all) of the self host miscompiles with block placement. Thanks to Benjamin Kramer for reporting, Nick Lewycky for an initial stab at a reduction, and Duncan for endless advice on EH (which I know nothing about) as well as reviewing the actual fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145062 91177308-0d34-0410-b5e6-96231b3b80d8
* Add configure checking for pread(2) and use it to save a syscall when ↵Benjamin Kramer2011-11-221-0/+7
| | | | | | reading files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145061 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an obvious omission in the SelectionDAGBuilder where we wereChandler Carruth2011-11-221-2/+2
| | | | | | | | | | | | | dropping weights on the floor for invokes. This was impeding my writing further test cases for invoke when interacting with probabilities and block placement. No test case as there doesn't appear to be a way to test this stuff. =/ Suggestions for a test case of course welcome. I hope to be able to add test cases that indirectly cover this eventually by adding probabilities to the exceptional edge and reordering blocks as a result. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145060 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn error recovery into an assert.Benjamin Kramer2011-11-221-6/+1
| | | | | | | This was put in because in a certain version of DragonFlyBSD stat(2) lied about the size of some files. This was fixed a long time ago so we can remove the workaround. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145059 91177308-0d34-0410-b5e6-96231b3b80d8
* If a register is both an early clobber and part of a tied use, handle the useRafael Espindola2011-11-221-7/+16
| | | | | | | | before the clobber so that we copy the value if needed. Fixes pr11415. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145056 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix shuffle decoding logic to handle UNPCKLPS/UNPCKLPD on 256-bit vectors ↵Craig Topper2011-11-224-21/+73
| | | | | | correctly. Add support for decoding UNPCKHPS/UNPCKHPD for AVX 128-bit and 256-bit forms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145055 91177308-0d34-0410-b5e6-96231b3b80d8
* Add methods for querying minimum SSE version along with AVX. Simplifies all ↵Craig Topper2011-11-222-43/+38
| | | | | | the places that had to check a version of SSE and AVX. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145053 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crasher in GVN due to my recent capture tracking changes.Nick Lewycky2011-11-212-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145047 91177308-0d34-0410-b5e6-96231b3b80d8
* Add virtual destructor. Whoops!Nick Lewycky2011-11-211-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145044 91177308-0d34-0410-b5e6-96231b3b80d8
* Lowering for v32i8 to VPUNPCKLBW/VPUNPCKHBW when AVX2 is enabled.Craig Topper2011-11-214-84/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145028 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for lowering 256-bit shuffles to VPUNPCKL/H for i16, i32, i64 if ↵Craig Topper2011-11-214-47/+115
| | | | | | AVX2 is enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145026 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing a commentJoe Abbey2011-11-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145025 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LowerSIGN_EXTEND_INREG split 256-bit vectors when AVX1 is enabled and ↵Craig Topper2011-11-211-8/+42
| | | | | | use AVX2 shifts when AVX2 is enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145022 91177308-0d34-0410-b5e6-96231b3b80d8
* Less template, more virtual! Refactoring suggested by Chris in code review.Nick Lewycky2011-11-202-4/+109
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145014 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code to use new attribute getters on CallSite for NoCapture and ByVal.Nick Lewycky2011-11-206-11/+8
| | | | | | | | | Suggested in code review by Eli. That code in InstCombine looks kinda suspicious. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145013 91177308-0d34-0410-b5e6-96231b3b80d8
* The logic for breaking the CFG in the presence of hot successors didn'tChandler Carruth2011-11-201-3/+29
| | | | | | | | | | | | | | | | properly account for the *global* probability of the edge being taken. This manifested as a very large number of unconditional branches to blocks being merged against the CFG even though they weren't particularly hot within the CFG. The fix is to check whether the edge being merged is both locally hot relative to other successors for the source block, and globally hot compared to other (unmerged) predecessors of the destination block. This introduces a new crasher on GCC single-source, but it's currently behind a flag, and Ben has offered to work on the reduction. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145010 91177308-0d34-0410-b5e6-96231b3b80d8
* SCEV: Actually set overflow flags on add expressions.Benjamin Kramer2011-11-201-2/+2
| | | | | | setFlags doesn't modify its arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145007 91177308-0d34-0410-b5e6-96231b3b80d8
* Add code for lowering v32i8 shifts by a splat to AVX2 immediate shift ↵Craig Topper2011-11-202-45/+45
| | | | | | instructions. Remove 256-bit splat handling from LowerShift as it was already handled by PerformShiftCombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145005 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 256-bit vcmpeqd for creating an all ones vector when AVX2 is enabled.Craig Topper2011-11-194-16/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145004 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some of the special classes that worked around an old tablegen ↵Craig Topper2011-11-191-100/+50
| | | | | | limitation of not being able to remove redundant bitconverts from patterns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145003 91177308-0d34-0410-b5e6-96231b3b80d8
* Custom lower AVX2 variable shift intrinsics to shl/srl/sra nodes and remove ↵Craig Topper2011-11-192-74/+42
| | | | | | the intrinsic patterns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144999 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the handling of unanalyzable branches out of the loop-driven chainChandler Carruth2011-11-191-25/+33
| | | | | | | | | | | | | | | | | | | | | | | | formation phase and into the initial walk of the basic blocks. We essentially pre-merge all blocks where unanalyzable fallthrough exists, as we won't be able to update the terminators effectively after any reorderings. This is quite a bit more principled as there may be CFGs where the second half of the unanalyzable pair has some analyzable predecessor that gets placed first. Then it may get placed next, implicitly breaking the unanalyzable branch even though we never even looked at the part that isn't analyzable. I've included a test case that triggers this (thanks Benjamin yet again!), and I'm hoping to synthesize some more general ones as I dig into related issues. Also, to make this new scheme work we have to be able to handle branches into the middle of a chain, so add this check. We always fallback on the incoming ordering. Finally, this starts to really underscore a known limitation of the current implementation -- we don't consider broken predecessors when merging successors. This can caused major missed opportunities, and is something I'm planning on looking at next (modulo more bug reports). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144994 91177308-0d34-0410-b5e6-96231b3b80d8
* Synthesize SSSE3/AVX 128-bit horizontal integer add/sub instructions from ↵Craig Topper2011-11-194-3/+62
| | | | | | add/sub of appropriate shuffle vectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144989 91177308-0d34-0410-b5e6-96231b3b80d8
* Collapse X86 PSIGNB/PSIGNW/PSIGND node types.Craig Topper2011-11-194-33/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144988 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend VPBLENDVB and VPSIGN lowering to work for AVX2.Craig Topper2011-11-193-111/+127
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144987 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused parameters from the AVX maskmov classes.Craig Topper2011-11-191-12/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144985 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a corner case in updating LoopInfo after fully unrolling an outer loop.Andrew Trick2011-11-181-11/+9
| | | | | | | | | | | | The loop tree's inclusive block lists are painful and expensive to update. (I have no idea why they're inclusive). The design was supposed to handle this case but the implementation missed it and my unit tests weren't thorough enough. Fixes PR11335: loop unroll update. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144970 91177308-0d34-0410-b5e6-96231b3b80d8
* Add AVX2 vpbroadcast supportNadav Rotem2011-11-182-28/+62
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144967 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] workaround for reg alloc bug 11395: don't instrument functions with ↵Kostya Serebryany2011-11-181-0/+13
| | | | | | large chunks of inline assembler git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144962 91177308-0d34-0410-b5e6-96231b3b80d8
* Guard call to getRegForValue with isTypeLegal check to avoid unnecessary ↵Chad Rosier2011-11-181-3/+5
| | | | | | work/dead code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144959 91177308-0d34-0410-b5e6-96231b3b80d8
* DISubrange supports unsigned lower/upper array bounds, so let's not fake it ↵Devang Patel2011-11-171-4/+4
| | | | | | in the end while emitting DWARF. If a FE needs to encode signed lower/upper array bounds then we need to extend DISubrange or ad DISignedSubrange. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144937 91177308-0d34-0410-b5e6-96231b3b80d8
* quick fix: remove GlobalVariable::GlobalVariable mistakenly commited at ↵Kostya Serebryany2011-11-171-3/+3
| | | | | | r144933. For some reason this compiles on linux git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144936 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an overly general check in SimplifyIndvar to handle useless phi cycles.Andrew Trick2011-11-171-2/+2
| | | | | | | | | | | | | | | The right way to check for a binary operation is cast<BinaryOperator>. The original check: cast<Instruction> && numOperands() == 2 would match phi "instructions", leading to an infinite loop in extreme corner case: a useless phi with operands [self, constant] that prior optimization passes failed to remove, being used in the loop by another useless phi, in turn being used by an lshr or udiv. Fixes PR11350: runaway iteration assertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144935 91177308-0d34-0410-b5e6-96231b3b80d8
* fall back to explicit list of allowed linkages when instrumenting globals in ↵Kostya Serebryany2011-11-171-2/+5
| | | | | | asan; add a test check that asan does not touch linkonce_odr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144933 91177308-0d34-0410-b5e6-96231b3b80d8
* Add TODO comment.Chad Rosier2011-11-171-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144920 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SSE/AVX integer comparison patterns to understand that all integer ↵Craig Topper2011-11-171-24/+42
| | | | | | vector loads are promoted to i64 vector loads so patterns need a bitconvert. Also slightly simplify the AVX2 variable shift patterns by using the predefined bitconvert pattern fragments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144896 91177308-0d34-0410-b5e6-96231b3b80d8
* Dead code.Chad Rosier2011-11-171-14/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144888 91177308-0d34-0410-b5e6-96231b3b80d8
* When fast iseling a GEP, accumulate the offset rather than emitting a series ofChad Rosier2011-11-171-11/+35
| | | | | | | | | | | | | | | ADDs. MaxOffs is used as a threshold to limit the size of the offset. Tradeoffs being: (1) If we can't materialize the large constant then we'll cause fast-isel to bail. (2) Too large of an offset can't be directly encoded in the ADD resulting in a MOV+ADD. Generally not a bad thing because otherwise we would have had ADD+ADD, but on Thumb this turns into a MOVS+MOVT+ADD. Working on a fix for that. (3) Conversely, too low of a threshold we'll miss opportunities to coalesce ADDs. rdar://10412592 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144886 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove seemingly unnecessary duplicate VROUND definitions.Craig Topper2011-11-171-80/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144885 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for custom names for library functions in TargetLibraryInfo. ↵Eli Friedman2011-11-173-13/+50
| | | | | | | | | | | | Add a custom name for fwrite and fputs on x86-32 OSX. Make SimplifyLibCalls honor the custom names for fwrite and fputs. Fixes <rdar://problem/9815881>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144876 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't unconditionally set the kill flag.Chad Rosier2011-11-171-1/+1
| | | | | | | rdar://10456186 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144872 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn on vzeroupper insertion on call boundaries for AVX; it works as far as ↵Eli Friedman2011-11-171-1/+1
| | | | | | I know, and I'd like to see wider testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144867 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to replace the chain properly when DAGCombining a ↵Eli Friedman2011-11-161-4/+17
| | | | | | LOAD+EXTRACT_VECTOR_ELT into a single LOAD. Fixes PR10747/PR11393. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144863 91177308-0d34-0410-b5e6-96231b3b80d8
* Object/COFF: Support common symbols.Michael J. Spencer2011-11-161-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144861 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the fixup info for ARM mode.Jim Grosbach2011-11-161-2/+2
| | | | | | | We don't (yet) have the granularity in the fixups to be specific about which bitranges are affected. That's a future cleanup, but we're not there yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144852 91177308-0d34-0410-b5e6-96231b3b80d8