summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Grab the TargetRegisterInfo off of the subtarget from theEric Christopher2014-10-081-1/+1
| | | | | | | MachineFunction rather than a lookup on the TargetMachine to avoid unnecessary lookups. llvm-svn: 219291
* Update git-svnrevert to accept git and svn revisionsRenato Golin2014-10-081-9/+16
| | | | | | | | | | Interchangeable commit ids can now be used on this git-svnrevert, which will figure out what kind of commit that is (if you use format rNNNN for SVN commits) and make sure the right ids are used in the right places. It's a little bit more robust and user-friendly. llvm-svn: 219290
* Unix/Process: Don't use pthread_sigmask if we aren't built with threadsDavid Majnemer2014-10-081-1/+12
| | | | | | | | We won't link in pthreads if we weren't built with LLVM_ENABLE_THREADS which means we won't get access to pthread_sigmask. Use sigprocmask instead. llvm-svn: 219288
* Replace calls to get the subtarget and TargetFrameLowering withEric Christopher2014-10-082-32/+27
| | | | | | cached variables and a single call in the constructor. llvm-svn: 219287
* Format spacing and remove extra lines to comply with standards. NFC.Suyog Sarda2014-10-081-5/+6
| | | | | | | Differential Revision: http://reviews.llvm.org/D5649 llvm-svn: 219286
* Use cached subtarget rather than looking it up on theEric Christopher2014-10-081-6/+4
| | | | | | TargetMachine again. llvm-svn: 219285
* Cache TargetLowering on SelectionDAGISel and update previousEric Christopher2014-10-088-78/+57
| | | | | | calls to getTargetLowering() with the cached variable. llvm-svn: 219284
* GlobalOpt: Don't drop unused memberes of a ComdatDavid Majnemer2014-10-082-8/+39
| | | | | | | | | A linkonce_odr member of a COMDAT shouldn't be dropped if we need to keep the entire COMDAT group. This fixes PR21191. llvm-svn: 219283
* [InstCombine] re-commit r218721 with fix for pr21199Gerolf Hoflehner2014-10-086-9/+300
| | | | | | | | The icmp-select-icmp optimization targets select-icmp.eq only. This is now ensured by testing the branch predicate explictly. This commit also includes the test case for pr21199. llvm-svn: 219282
* COFF: Don't oversize COMMON symbols when targeting BFD ldDavid Majnemer2014-10-082-6/+12
| | | | | | | | | | | | | | COFF normally doesn't allow us to describe the alignment of COMMON symbols. It turns out that most linkers use the symbol size as a hint as to how aligned the symbol should be. However the BFD folks have added a .drectve command, which we now support as of r219229, that allows us to specify the alignment precisely. With this in mind, stop rounding sizes up. llvm-svn: 219281
* llvm-dwarfdump: Add support for some COFF relocationsDavid Majnemer2014-10-084-36/+87
| | | | | | | DWARF in COFF utilizes several relocations. Implement support for them in RelocVisitor to support llvm-dwarfdump. llvm-svn: 219280
* [AArch64] Generate vector signed/unsigned mul and mla/mls long.Chad Rosier2014-10-084-0/+580
| | | | | | | Phabricator Revision: http://reviews.llvm.org/D5589 Patch by Balaram Makam <bmakam@codeaurora.org>!! llvm-svn: 219276
* llvm-readobj: add test for r219228Rui Ueyama2014-10-082-0/+2
| | | | llvm-svn: 219274
* Cache SelectionDAGISel TargetInstrInfo lookups on the class andEric Christopher2014-10-082-13/+11
| | | | | | | propagate. Also use the TargetSubtargetInfo and the MachineFunction and move TargetRegisterInfo query closer to uses. llvm-svn: 219273
* Reset the target options and optimization level as the firstEric Christopher2014-10-081-8/+13
| | | | | | | | | thing we do inside selection dag. This code needs to be migrated to queries on the function rather than global data, but this organizes things before we start grabbing the subtarget. llvm-svn: 219271
* Have the selection dag grab TargetLowering off of the subtargetEric Christopher2014-10-083-5/+4
| | | | | | inside init rather than have it passed in as an argument. llvm-svn: 219270
* Revert r219175 - [InstCombine] re-commit r218721 icmp-select-icmp optimizationHans Wennborg2014-10-084-152/+9
| | | | | | This seems to have caused PR21199. llvm-svn: 219264
* Have SelectionDAG's subtarget TargetSelectionDAGInfo be setEric Christopher2014-10-081-2/+2
| | | | | | during init rather than construction time. llvm-svn: 219262
* [DebugInfo] Pass DWARFSection down to DWARFUnit constructor (NFC).Alexey Samsonov2014-10-084-25/+25
| | | | | | Keep the actual section contents and the relocation map together. llvm-svn: 219261
* [Support] Add MemoryBuffer::getFileSlice()Nick Kledzik2014-10-083-8/+69
| | | | | | | | | | mach-o supports "fat" files which are a header/table-of-contents followed by a concatenation of mach-o files built for different architectures. Currently, MemoryBuffer has no easy way to map a subrange (slice) of a file which lld will need to select a mach-o slice of a fat file. The new function provides an easy way to map a slice of a file into a MemoryBuffer. Test case included. llvm-svn: 219260
* [DebugInfo] Pass DWARFSection into DWARFUnitSection constructor (NFC).Alexey Samsonov2014-10-083-27/+25
| | | | llvm-svn: 219259
* [X86] Fix a bug with fetch_add(INT32_MIN)Robin Morisset2014-10-072-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fix pr21099 The pseudocode of what we were doing (spread through two functions) was: if (operand.doesNotFitIn32Bits()) Opc.initializeWithFoo(); if (operand < 0) operand = -operand; if (operand.doesFitIn8Bits()) Opc.initializeWithBar(); else if (operand.doesFitIn32Bits()) Opc.initializeWithBlah(); doStuff(Opc); So for operand == INT32_MIN, Opc was never initialized because the operand changes from fitting in 32 bits to not fitting, causing the various bugs/error messages noted by pr21099. This patch adds an extra test at the beginning for this case, and an llvm_unreachable to have better error message if the operand ends up not fitting in 32-bits at the end. Test Plan: new test + make check Reviewers: jfb Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5655 llvm-svn: 219257
* R600/SI: Refactor VOP3 instruction defsTom Stellard2014-10-072-61/+64
| | | | llvm-svn: 219256
* R600/SI: Refactor VOPC instruction defsTom Stellard2014-10-072-213/+217
| | | | llvm-svn: 219255
* R600/SI: Refactor VOP2 instruction defsTom Stellard2014-10-072-42/+46
| | | | llvm-svn: 219254
* R600/SI: Refactor VOP1 instruction defsTom Stellard2014-10-073-72/+96
| | | | llvm-svn: 219253
* [DebugInfo] Turn DWARFContext::Section into DWARFSection (NFC).Alexey Samsonov2014-10-072-25/+45
| | | | | | | | It would be more convenient to pass DWARFSection into DWARFUnitSection constructor, instead of passing its components (Data and RelocAddrMap) as a separate arguments. llvm-svn: 219252
* Add return value and negative checks to MapVector::erase from r219240.Kaelyn Takata2014-10-071-1/+4
| | | | llvm-svn: 219250
* DebugInfo+DFSan: Ensure that debug info references to llvm::Functions remain ↵David Blaikie2014-10-073-0/+48
| | | | | | | | | | | | | | | | | | | | | | pointing to the underlying function when wrappers are created This is somewhat the inverse of how similar bugs in DAE and ArgPromo manifested and were addressed. In those passes, individual call sites were visited explicitly, and then the old function was deleted. This left the debug info with a null llvm::Function* that needed to be updated to point to the new function. In the case of DFSan, it RAUWs the old function with the wrapper, which includes debug info. So now the debug info refers to the wrapper, which doesn't actually have any instructions with debug info in it, so it is ignored entirely - resulting in a DW_TAG_subprogram with no high/low pc, etc. Instead, fix up the debug info to refer to the original function after the RAUW messed it up. Reviewed/discussed with Peter Collingbourne on the llvm-dev mailing list. llvm-svn: 219249
* [Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing to closeLang Hames2014-10-071-9/+1
| | | | | | | | | | this, and in some circumstances (e.g. reducing particularly large test-cases) this was causing bugpoint to be killed for hitting open file-handle limits. No test case: I was only able to trigger this with test cases taking upwards of 10 mins to run. llvm-svn: 219244
* R600: Remove dead codeMatt Arsenault2014-10-072-18/+1
| | | | llvm-svn: 219242
* LoopUnroll: Create sub-loops in LoopInfoDuncan P. N. Exon Smith2014-10-072-1/+64
| | | | | | | | | | | | | `LoopUnrollPass` says that it preserves `LoopInfo` -- make it so. In particular, tell `LoopInfo` about copies of inner loops when unrolling the outer loop. Conservatively, also tell `ScalarEvolution` to forget about the original versions of these loops, since their inputs may have changed. Fixes PR20987. llvm-svn: 219241
* Add size_t MapVector::erase(KeyT) similar to the one in std::map.Kaelyn Takata2014-10-072-0/+16
| | | | llvm-svn: 219240
* LoopUnroll: Only check for ScalarEvolution analysis once, NFCDuncan P. N. Exon Smith2014-10-071-7/+4
| | | | | | | A follow-up commit will add use to a tight loop. We might as well just find it once anyway. llvm-svn: 219239
* R600: Remove some redundant initializations from AMDGPUMCAsmInfoTom Stellard2014-10-071-10/+0
| | | | llvm-svn: 219238
* R600: Use MCAsmInfoELF as AMDGPUMCAsmInfo base classTom Stellard2014-10-072-3/+8
| | | | | | | | | | | | | The main reason for this is that the MCAsmInfo class, which we were previously using as the base class, sets PrivateGlobalPrefix to "L", which causes all global functions that start with L to be treated as local symbols. MCAsmInfoELF sets PrivateGlobalPrefix to ".L", which is what we want, and it is probably a good idea to use this as the base class anyway, since we are emitting ELF binaries. llvm-svn: 219237
* R600/SI: Remove assertion in SIInstrInfo::areLoadsFromSameBasePtr()Tom Stellard2014-10-072-1/+22
| | | | | | | Added a FIXME coment instead, we need to handle the case where the two DS instructions being compared have different numbers of operands. llvm-svn: 219236
* Don't check for null after calling COFFObjectFile::toSec.Rafael Espindola2014-10-071-2/+0
| | | | | | | | | | | It can only return null if passed a corrupted reference with a null Ref.p. Checking for null is then an issue for asserts to check for internal consistency, not control flow to check for invalid input. I didn't add an assert(sec != nullptr) because toSec itself has a far more complete assert. llvm-svn: 219235
* Optimize COFFObjectFile::sectionContainsSymbol a bit.Rafael Espindola2014-10-071-7/+2
| | | | | | | | | There is no need to compute the coff_section of the symbol just to compare the pointer. Inspired by the ELF implementation. llvm-svn: 219233
* MC: add support for -aligncomm GNU extensionSaleem Abdulrasool2014-10-072-8/+68
| | | | | | | The GNU linker supports an -aligncomm directive that allows for power-of-2 alignment of common data. Add support to emit this directive. llvm-svn: 219229
* llvm-readobj: add support to dump (COFF) directivesSaleem Abdulrasool2014-10-073-0/+27
| | | | | | | | PE/COFF has a special section (.drectve) which can be used to pass options to the linker (similar to LC_LINKER_OPTION). Add support to llvm-readobj to print the contents of the section for tests. llvm-svn: 219228
* Remove the IsVolatileSize parameter of getOpenFileSlice.Rafael Espindola2014-10-072-7/+4
| | | | | | | getOpenFileSlice gets passed the map size, so it makes no sense to say that the size is volatile. The code will not even compute the size. llvm-svn: 219226
* Be consistent about using "const Twine &" for filenames.Rafael Espindola2014-10-072-28/+33
| | | | | | | | | | | | | | | On this file we had a mix of * Twine * const char * * StringRef The two that make sense are * const Twine & (caller convenience) * consc char * (that is what will eventually be passed to open. Given that sys::fs::openFileForRead takes a "const Twine &", I picked that. llvm-svn: 219224
* Two case switch to select optimizationMarcello Maggioni2014-10-074-3/+249
| | | | | | | | | | | | | | | | | | | | | This optimization tries to convert switch instructions that are used to select a value with only 2 unique cases + default block to a select or a couple of selects (depending if the default block is reachable or not). The typical case this optimization wants to be able to optimize is this one: Example: switch (a) { case 10: %0 = icmp eq i32 %a, 10 return 10; %1 = select i1 %0, i32 10, i32 4 case 20: ----> %2 = icmp eq i32 %a, 20 return 2; %3 = select i1 %2, i32 2, i32 %1 default: return 4; } It also sets the base for further optimizations that are planned and being reviewed. llvm-svn: 219223
* typosSanjay Patel2014-10-071-2/+2
| | | | llvm-svn: 219221
* typosSanjay Patel2014-10-071-1/+1
| | | | llvm-svn: 219220
* don't repeat function name in commentsSanjay Patel2014-10-071-31/+20
| | | | llvm-svn: 219218
* typosSanjay Patel2014-10-071-1/+1
| | | | llvm-svn: 219216
* DebugInfo: Ensure that all debug location scope chains from instructions ↵David Blaikie2014-10-072-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | within a function, lead to the function itself. Let me tell you a tale... Originally committed in r211723 after discovering a nasty case of weird scoping due to inlining, this was reverted in r211724 after it fired in ASan/compiler-rt. (minor diversion where I accidentally committed/reverted again in r211871/r211873) After further testing and fixing bugs in ArgumentPromotion (r211872) and Inlining (r212065) it was recommitted in r212085. Reverted in r212089 after the sanitizer buildbots still showed problems. Fixed another bug in ArgumentPromotion (r212128) found by this assertion. Recommitted in r212205, reverted in r212226 after it crashed some more on sanitizer buildbots. Fix clang some more in r212761. Recommitted in r212776, reverted in r212793. ASan failures. Recommitted in r213391, reverted in r213432, trying to reproduce flakey ASan build failure. Fixed bugs in r213805 (ArgPromo + DebugInfo), r213952 (LiveDebugVariables strips dbg_value intrinsics in functions not described by debug info). Recommitted in r214761, reverted in r214999, flakey failure on Windows buildbot. Fixed DeadArgElimination + DebugInfo bug in r219210. Recommitting and hoping that's the last of it. [That one burned down, fell over, then sank into the swamp.] llvm-svn: 219215
* DebugInfo+DeadArgElimination: Ensure llvm::Function*s from debug info are ↵David Blaikie2014-10-073-49/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | updated even when DAE removes both varargs and non-varargs arguments on the same function. After some stellar (& inspired) help from Reid Kleckner providing a test case for some rather unstable undefined behavior showing up as assertions produced by r214761, I was able to fix this issue in DAE involving the application of both varargs removal, followed by normal argument removal. Indeed I introduced this same bug into ArgumentPromotion (r212128) by copying the code from DAE, and when I fixed the bug in ArgPromo (r213805) and commented in that patch that I didn't need to address the same issue in DAE because it was a single pass. Turns out it's two pass, one for the varargs and one for the normal arguments, so the same fix is needed (at least during varargs removal). So here it is. (the observable/net effect of this bug, even when it didn't result in assertion failure, is that debug info would describe the DAE'd function in the abstract, but wouldn't provide high/low_pc, variable locations, line table, etc (it would appear as though the function had been entirely optimized away), see the original PR14016 for details of the general problem) I'm not recommitting the assertion just yet, as there's been another regression of it since I last tried. It might just be a few test cases weren't adequately updated after Adrian or Duncan's recent schema changes. llvm-svn: 219210
OpenPOWER on IntegriCloud