summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Support: Add a utility to remap std{in,out,err} to /dev/null if closedDavid Majnemer2014-10-063-0/+69
| | | | | | | | | | | | | | | It's possible to start a program with one (or all) of the standard file descriptors closed. Subsequent open system calls will give the program a low-numbered file descriptor. This is problematic because we may believe we are writing to standard out instead of a file. Introduce Process::FixupStandardFileDescriptors, a helper function to remap standard file descriptors to /dev/null if they were closed before the program started. llvm-svn: 219170
* Recognize aarch64_be as valid architecture.Joerg Sonnenberger2014-10-061-2/+2
| | | | llvm-svn: 219168
* range-for some loops in DAEDavid Blaikie2014-10-061-6/+3
| | | | llvm-svn: 219167
* LoopUnroll: Change code order of changes to new basic blocksDuncan P. N. Exon Smith2014-10-061-2/+2
| | | | | | | Add new basic blocks to `LoopInfo` earlier. No functionality change intended (simplifies upcoming bugfix patch). llvm-svn: 219150
* Sink comment, NFCDuncan P. N. Exon Smith2014-10-061-2/+2
| | | | llvm-svn: 219149
* [DAGCombine] Remove SIGN_EXTEND-related inf-loopHal Finkel2014-10-063-10/+36
| | | | | | | | | | | | | | | | | | | | | | The patch's author points out that, despite the function's documentation, getSetCCResultType is only used to get the SETCC result type (with one here-removed problematic exception). In one case, getSetCCResultType was being used to get the predicate type to use for a SELECT node, and then SIGN_EXTENDing (or truncating) to get the input predicate to match that type. Unfortunately, this was happening inside visitSIGN_EXTEND, and creating new SIGN_EXTEND nodes was causing an infinite loop. In addition, this behavior was wrong if a target was not using ZeroOrNegativeOneBooleanContent. Lastly, the extension/truncation seems unnecessary here: SELECT is defined as: Select(COND, TRUEVAL, FALSEVAL). If the type of the boolean COND is not i1 then the high bits must conform to getBooleanContents. So here we remove this use of getSetCCResultType and update getSetCCResultType's documentation to reflect its actual uses. Patch by deadal nix! llvm-svn: 219141
* Fast-math fold: x / (y * sqrt(z)) -> x * (rsqrt(z) / y)Sanjay Patel2014-10-062-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation is to recognize code such as this from /llvm/projects/test-suite/SingleSource/Benchmarks/BenchmarkGame/n-body.c: float distance = sqrt(dx * dx + dy * dy + dz * dz); float mag = dt / (distance * distance * distance); Without this patch, we don't match the sqrt as a reciprocal sqrt, so for PPC the new testcase in this patch produces: addis 3, 2, .LCPI4_2@toc@ha lfs 4, .LCPI4_2@toc@l(3) addis 3, 2, .LCPI4_1@toc@ha lfs 0, .LCPI4_1@toc@l(3) fcmpu 0, 1, 4 beq 0, .LBB4_2 # BB#1: frsqrtes 4, 1 addis 3, 2, .LCPI4_0@toc@ha lfs 5, .LCPI4_0@toc@l(3) fnmsubs 13, 1, 5, 1 fmuls 6, 4, 4 fmadds 1, 13, 6, 5 fmuls 1, 4, 1 fres 4, 1 <--- reciprocal of reciprocal square root fnmsubs 1, 1, 4, 0 fmadds 4, 4, 1, 4 .LBB4_2: fmuls 1, 4, 2 fres 2, 1 fnmsubs 0, 1, 2, 0 fmadds 0, 2, 0, 2 fmuls 1, 3, 0 blr After the patch, this simplifies to: frsqrtes 0, 1 addis 3, 2, .LCPI4_1@toc@ha fres 5, 2 lfs 4, .LCPI4_1@toc@l(3) addis 3, 2, .LCPI4_0@toc@ha lfs 7, .LCPI4_0@toc@l(3) fnmsubs 13, 1, 4, 1 fmuls 6, 0, 0 fnmsubs 2, 2, 5, 7 fmadds 1, 13, 6, 4 fmadds 2, 5, 2, 5 fmuls 0, 0, 1 fmuls 0, 0, 2 fmuls 1, 3, 0 blr Differential Revision: http://reviews.llvm.org/D5628 llvm-svn: 219139
* [BasicAA] Revert "Revert r218714 - Make better use of zext and sign ↵Hal Finkel2014-10-063-2/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information." This reverts r218944, which reverted r218714, plus a bug fix. Description of the bug in r218714 (by Nick) The original patch forgot to check if the Scale in VariableGEPIndex flipped the sign of the variable. The BasicAA pass iterates over the instructions in the order they appear in the function, and so BasicAliasAnalysis::aliasGEP is called with the variable it first comes across as parameter GEP1. Adding a %reorder label puts the definition of %a after %b so aliasGEP is called with %b as the first parameter and %a as the second. aliasGEP later calculates that %a == %b + 1 - %idxprom where %idxprom >= 0 (if %a was passed as the first parameter it would calculate %b == %a - 1 + %idxprom where %idxprom >= 0) - ignoring that %idxprom is scaled by -1 here lead the patch to incorrectly conclude that %a > %b. Revised patch by Nick White, thanks! Thanks to Lang to isolating the bug. Slightly modified by me to add an early exit from the loop and avoid unnecessary, but expensive, function calls. Original commit message: Two related things: 1. Fixes a bug when calculating the offset in GetLinearExpression. The code previously used zext to extend the offset, so negative offsets were converted to large positive ones. 2. Enhance aliasGEP to deduce that, if the difference between two GEP allocations is positive and all the variables that govern the offset are also positive (i.e. the offset is strictly after the higher base pointer), then locations that fit in the gap between the two base pointers are NoAlias. Patch by Nick White! llvm-svn: 219135
* Update documentation with link to Sea Islands documentationMatt Arsenault2014-10-061-0/+1
| | | | llvm-svn: 219134
* BFI: Improve assertion message, since it's actually firingDuncan P. N. Exon Smith2014-10-061-1/+2
| | | | | | | This assertion is firing because -loop-unroll is failing to preserve -loop-info (see PR20987). Improve it. llvm-svn: 219130
* ARM: silence unused variable warningTim Northover2014-10-061-2/+2
| | | | llvm-svn: 219128
* ARM: remove dead InstPrinting codeTim Northover2014-10-062-29/+1
| | | | | | | This instruction form is handled by different AsmOperands now, so the code is completely dead (and wrong anyway). llvm-svn: 219127
* MachObjectWriter: optimize the string table for common sufficesHans Wennborg2014-10-0628-302/+298
| | | | | | | | This is a follow-up to r207670 (ELF) and r218636 (COFF). Differential Revision: http://reviews.llvm.org/D5622 llvm-svn: 219126
* Fix dumping codeview line tables when there are multiple debug sectionsTimur Iskhodzhanov2014-10-063-29/+69
| | | | | | | | | | Codeview line tables for functions in different sections refer to a common STRING_TABLE_SUBSECTION for filenames. This happens when building with -Gy or with inline functions with MSVC. Original patch by Jeff Muizelaar! llvm-svn: 219125
* DbgValueHistoryCalculator: Store modified registers in a BitVector instead ↵Benjamin Kramer2014-10-061-23/+33
| | | | | | | | | of std::set. And iterate over the smaller map instead of the larger set first. Reduces the time spent in calculateDbgValueHistory by 30-40%. llvm-svn: 219123
* [CFL-AA] Update for handling of globals and more testsHal Finkel2014-10-067-3/+157
| | | | | | | | | | | | | | | | | | We used to return PartialAlias if *either* variable being queried interacted with arguments or globals. AFAICT, we can change this to only returning MayAlias iff *both* variables being queried interacted with arguments or globals. Also, adding some basic functionality tests: some basic IPA tests, checking that we give conservative responses with arguments/globals thrown in the mix, and ensuring that we trace values through stores and loads. Note that saying that 'x' interacted with arguments or globals means that the Attributes of the StratifiedSet that 'x' belongs to has any bits set. Patch by George Burgess IV, thanks! llvm-svn: 219122
* Make the MD5 result name consistent between functions, header and source.Yaron Keren2014-10-062-21/+21
| | | | llvm-svn: 219121
* Note that a gold bug has been fixed.Rafael Espindola2014-10-061-2/+3
| | | | | | We should be able to stop working around it at some point in the future. llvm-svn: 219115
* X86: Drop the isConvertibleTo3Addr bit from shufps/shufpd now that we don't ↵Benjamin Kramer2014-10-061-9/+8
| | | | | | convert them anymore. llvm-svn: 219112
* For biendian targets like ARM and AArch64, it is useful to have theEric Christopher2014-10-065-4/+43
| | | | | | | | | output of the llvm-dwarfdump and llvm-objdump report the endianness used when the object files were generated. Patch by Charlie Turner. llvm-svn: 219110
* Add support for ARM and AArch64 big endian objects toEric Christopher2014-10-063-4/+43
| | | | | | | | RelocVisitor. Patch by Charlie Turner. llvm-svn: 219109
* Refactor RelocVisitor to take an object. This removes someEric Christopher2014-10-063-98/+116
| | | | | | | | | string comparisons and makes it a bit easier to check individual targets. Patch by Charlie Turner. llvm-svn: 219108
* Add some tests for RelocVisitor.Eric Christopher2014-10-067-0/+113
| | | | | | Patch by Charlie Turner. llvm-svn: 219107
* Add subtarget caches to aarch64, arm, ppc, and x86.Eric Christopher2014-10-068-4/+148
| | | | | | | | | These will make it easier to test further changes to the code generation and optimization pipelines as those are moved to subtargets initialized with target feature and target cpu. llvm-svn: 219106
* Resolve ambiguity between llvm::make_unique and std::make_unique.Yaron Keren2014-10-061-2/+3
| | | | | | | Intorduced in r219098. llvm-svn: 219105
* DebugInfo: Sink constructImportedEntityDIE down into DwarfUnit from DwarfDebug.David Blaikie2014-10-064-36/+34
| | | | | | | | It was just calling a bunch of DwarfUnit functions anyway, as can be seen by the simplification of removing "TheCU" from all the function calls in the implementation. llvm-svn: 219103
* [dwarfdump] Print the name for referenced specification of abstract_origin DIEs.Frederic Riss2014-10-0617-53/+67
| | | | | | | | | | Reviewers: dblaikie, samsonov, echristo, aprantl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5466 llvm-svn: 219099
* Factor the Unit section parsing into the DWARFUnitSection class.Frederic Riss2014-10-063-62/+50
| | | | | | | | | | | | Summary: No functional change. Reviewers: dblaikie, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5522 llvm-svn: 219098
* [PM] Remove an unused and rather expensive mapping from an analysisChandler Carruth2014-10-062-10/+0
| | | | | | | | group's interface to all of the implementations of that analysis group. The groups themselves can and do manage this anyways, the pass registry needn't involve itself. llvm-svn: 219097
* [PM] Remove the (deeply misguided) 'unregister' functionality from theChandler Carruth2014-10-062-14/+0
| | | | | | | | | | | | pass registry. This style of registry is somewhat questionable, but it being non-monotonic is crazy. No one is (or should be) unloading DSOs with passes and unregistering them here. I've checked with a few folks and I don't know of anyone using this functionality or any important use case where it is necessary. llvm-svn: 219096
* [cleanup] Switch to using range-based for loops in two very obviousChandler Carruth2014-10-061-6/+4
| | | | | | places. llvm-svn: 219095
* [cleanup] Fix up trailing whitespace and formatting in the pass regitsryChandler Carruth2014-10-052-44/+44
| | | | | | code prior to hacking on it more significantly. llvm-svn: 219094
* Give the Reassociate pass a bit more flexibility and autonomy when ↵Owen Anderson2014-10-052-2/+27
| | | | | | | | | | optimizing expressions. Particularly, it addresses cases where Reassociate breaks Subtracts but then fails to optimize combinations like I1 + -I2 where I1 and I2 have the same rank and are identical. Patch by Dmitri Shtilman. llvm-svn: 219092
* [x86] Remove the 2-addr-to-3-addr "optimization" from shufps to pshufd.Chandler Carruth2014-10-057-54/+30
| | | | | | | | | | | | | | | This trades a (register-renamer-friendly) movaps for a floating point / integer domain cross. That is a very bad trade, even on architectures where domain crossing is relatively fast. On any chip where there is even a cycle stall, this is a Very Bad Idea. It doesn't even seem likely to cause a spill to be introduced because the reason for the copy is to destructively shuffle in place. Thanks to Ben Kramer for fixing a bug in this code that my new shuffle lowering exposed and highlighting that perhaps it should just go away. =] llvm-svn: 219090
* [x86, dag] Teach the DAG combiner to prune inputs toa vector_shuffleChandler Carruth2014-10-053-15/+164
| | | | | | | | | | | | | | | that are unused. This allows the combiner to delete math feeding shuffles where the math isn't actually necessary. This improves some of the vperm2x128 tests that regressed when the vector shuffle lowering started actually generating vperm instructions rather than forcibly decomposing them. Sadly, this isn't enough to get this *really* right because we still form a completely unnecessary permutation. To fix that, we also need to fold shuffles which just rearrange concatenated or inserted subvectors. llvm-svn: 219086
* Remove unused mapDavid Blaikie2014-10-052-6/+0
| | | | | | This became unnecessary/unused in r208636 llvm-svn: 219085
* X86: Don't drop half of the mask when converting 2-address shufps into ↵Benjamin Kramer2014-10-052-1/+12
| | | | | | | | | 3-address pshufd. It's debatable whether this transform is useful at all, but for now make sure we don't generate invalid asm. llvm-svn: 219084
* AVX-512-SKX: Added instruction VPMOVM2B/W/D/Q.Elena Demikhovsky2014-10-053-2/+79
| | | | | | This instruction allows to broadacst mask vector to data vector. llvm-svn: 219083
* Simplify code. No functionality change.Benjamin Kramer2014-10-051-4/+2
| | | | llvm-svn: 219082
* [x86] Fix PR21139, one of the last remaining regressions found in theChandler Carruth2014-10-053-16/+37
| | | | | | | | | | | | | new vector shuffle lowering. This is loosely based on a patch by Marius Wachtler to the PR (thanks!). I refactored it a bi to use std::count_if and a mutable array ref but the core idea was exactly right. I also added some direct testing of this case. I believe PR21137 is now the only remaining regression. llvm-svn: 219081
* [x86] Teach the new vector shuffle lowering how to lower 128-bitChandler Carruth2014-10-055-247/+218
| | | | | | | | | | | | | | | | | | | | | | shuffles using AVX and AVX2 instructions. This fixes PR21138, one of the few remaining regressions impacting benchmarks from the new vector shuffle lowering. You may note that it "regresses" many of the vperm2x128 test cases -- these were actually "improved" by the naive lowering that the new shuffle lowering previously did. This regression gave me fits. I had this patch ready-to-go about an hour after flipping the switch but wasn't sure how to have the best of both worlds here and thought the correct solution might be a completely different approach to lowering these vector shuffles. I'm now convinced this is the correct lowering and the missed optimizations shown in vperm2x128 are actually due to missing target-independent DAG combines. I've even written most of the needed DAG combine and will submit it shortly, but this part is ready and should help some real-world benchmarks out. llvm-svn: 219079
* HexagonMCCodeEmitter.cpp: Prune 2nd redundant \brief. [-Wdocumentation]NAKAMURA Takumi2014-10-051-1/+1
| | | | llvm-svn: 219073
* [CMake] HexagonTests: Update LINK_COMPONENTS.NAKAMURA Takumi2014-10-051-0/+4
| | | | llvm-svn: 219072
* HexagonDesc: Update LLVMBuild.txt.NAKAMURA Takumi2014-10-051-1/+1
| | | | llvm-svn: 219071
* [InstCombine] Simplify the logic from r219067 using ValueTrackingHal Finkel2014-10-051-12/+4
| | | | | | | | | | | | Joerg suggested on IRC that I look at generalizing the logic from r219067 to handle more general redundancies (like removing an assume(x > 3) dominated by an assume(x > 5)). The way to do this would be to ask ValueTracking to determine the value of the i1 argument. It turns out that ValueTracking is not very good at this right now (although it does get the trivial redundancy case) because it does not understand ICmps. Nevertheless, the resulting code in InstCombine is simpler than r219067, so we might as well do it now. llvm-svn: 219070
* [SystemZ] Make operator bool explicit. NFC.Benjamin Kramer2014-10-042-2/+2
| | | | llvm-svn: 219069
* Make AAMDNodes ctor and operator bool (!!!) explicit, mop up bugs and ↵Benjamin Kramer2014-10-048-31/+24
| | | | | | weirdness exposed by it. llvm-svn: 219068
* [InstCombine] Remove redundant @llvm.assume intrinsicsHal Finkel2014-10-042-0/+72
| | | | | | | | | For any @llvm.assume intrinsic, if there is another which dominates it and uses the same condition, then it is redundant and can be removed. While this does not alter the semantics of the @llvm.assume intrinsics, it makes subsequent handling more efficient (and the resulting IR easier to read). llvm-svn: 219067
* Solve Visual C++ warning C4805 on getAsInteger<bool>.Yaron Keren2014-10-041-1/+4
| | | | | | | | | | | Fix http://llvm.org/PR21158 by adding a cast to unsigned long long, so the comparison would be between two unsigned long longs instead of bool and unsigned long long. if (getAsUnsignedInteger(*this, Radix, ULLVal) || static_cast<unsigned long long>(static_cast<T>(ULLVal)) != ULLVal) llvm-svn: 219065
* Remove unnecessary copying or replace it with moves in a bunch of places.Benjamin Kramer2014-10-0415-72/+76
| | | | | | NFC. llvm-svn: 219061
OpenPOWER on IntegriCloud