summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* Use the ability to pwrite to simplify the ELF writer.Rafael Espindola2015-04-142-45/+32
| | | | | | | | | | | | Now we don't have to do 2 synchronized passes to compute offsets and then write the file. This also includes a fix for the corner case of seeking in /dev/null. It is not an error, but on some systems (Linux) the returned offset is always 0. An error is signaled by returning -1. This is checked by the existing tests now that "clang -o /dev/null ..." seeks. llvm-svn: 234952
* Use raw_pwrite_stream in the object writer/streamer.Rafael Espindola2015-04-1461-120/+134
| | | | | | The ELF object writer will take advantage of that in the next commit. llvm-svn: 234950
* [WinEH] Avoid emitting xdata tables twice for cleanupsReid Kleckner2015-04-141-3/+5
| | | | | | | Since adding invokes of llvm.donothing to cleanups, we come here now, and trivial EH cleanup usage from clang fails to compile. llvm-svn: 234948
* Correct 'teh' and other typos / repeated words.Ed Maste2015-04-141-1/+1
| | | | | | | | Patch by Eitan Adler. Differential Revision: http://reviews.llvm.org/D8514 llvm-svn: 234939
* [Inliner] Don't inline functions with frameescape callsReid Kleckner2015-04-141-8/+19
| | | | | | | | | | | Inlining such intrinsics is very difficult, since you need to simultaneously transform many calls to llvm.framerecover and potentially duplicate the functions containing them. Normally this intrinsic isn't added until EH preparation, which is part of the backend pass pipeline after inlining. However, if it were to get fed through the inliner, this change will ensure that it doesn't break the code. llvm-svn: 234937
* IR: Set -preserve-bc-uselistorder=false by defaultDuncan P. N. Exon Smith2015-04-142-1/+6
| | | | | | | But keep it on by default in `llvm-as`, `opt`, `bugpoint`, `llvm-link`, `llvm-extract`, and `LTOCodeGenerator`. Part of PR5680. llvm-svn: 234921
* IR: Rename 'use-list-order' options to 'uselistorder'Duncan P. N. Exon Smith2015-04-141-2/+2
| | | | | | | Rename options to be consistent with the name of `verify-uselistorder`, and update `DEBUG_TYPE` (etc.) to be consistent. llvm-svn: 234919
* DebugInfo: Pubnames: Do not include variable declarations in pubnamesDavid Blaikie2015-04-141-1/+2
| | | | | | | This causes badness for GDB which expects to find a definition in any compile_unit that has an entry for the variable in its pubnames. llvm-svn: 234915
* [RuntimeDyld] Make SectionEntry's Name field a std::string.Lang Hames2015-04-141-1/+1
| | | | | | | StringRef is unsafe here, since SectionEntry instances can outlive the ObjectFile instances they are created from. llvm-svn: 234910
* Revert "The code that originally made me discover this is:"Rafael Espindola2015-04-141-8/+0
| | | | | | | This reverts commit r234898. CodeGen/ARM/2013-10-11-select-stalls.ll was faling. llvm-svn: 234903
* Improve RefreshCallGraph to remove invalid call graph edge.Chad Rosier2015-04-141-4/+7
| | | | | | | | | | | | | With commit r219944, InstCombine can now turn a sqrtl into a llvm.fabs.f64. The call graph edge originally representing the call to sqrtl becomes invalid. This patch modifies CGPassManager::RefreshCallGraph() to remove the invalid call graph edge, which can triggers an assert in CallGraphNode::addCalledFunction(). Phabricator Review: http://reviews.llvm.org/D7705 Patch by Lawrence Hu <lawrence@codeaurora.org>. llvm-svn: 234902
* Refactor: Simplify boolean expressions in ARM targetAlexander Kornienko2015-04-142-28/+25
| | | | | | | | | | Simplify boolean expressions using `true` and `false` with `clang-tidy` http://reviews.llvm.org/D8524 Patch by Richard Thomson! llvm-svn: 234901
* The code that originally made me discover this is:Daniel Jasper2015-04-141-0/+8
| | | | | | | | | | | | | | | | | | if ((a & 0x1) == 0x1) { .. } In this case we don't actually have any branch probability information and should not assume to have any. LLVM transforms this into: %and = and i32 %a, 1 %tobool = icmp eq i32 %and, 0 So, in this case, the result of a bitwise and is compared against 0, but nevertheless, we should not assume to have probability information. llvm-svn: 234898
* [AArch64] Allow non-standard INS/DUP encodingsBradley Smith2015-04-142-10/+10
| | | | | | | | | | The ARMv8 ARMARM states that for these instructions in A64 state: "Unspecified bits in "imm5" are ignored but should be set to zero by an assembler.", (imm4 for INS). Make the disassembler accept any encoding with these ignored bits set to 1. llvm-svn: 234896
* Add raw_pwrite_stream type.Rafael Espindola2015-04-141-2/+29
| | | | | | | This is a raw_ostream that also supports pwrite. I will be used in a sec. llvm-svn: 234895
* R600/SI: Fix verifier error caused by SIAnnotateControlFlowTom Stellard2015-04-141-6/+13
| | | | | | | | | | | | | | This pass will always try to insert llvm.SI.ifbreak intrinsics in the same block that its conditional value is computed in. This is a problem when conditions for breaks or continue are computed outside of the loop, because the llvm.SI.ifbreak intrinsic ends up being inserted outside of the loop. This patch fixes this problem by inserting the llvm.SI.ifbreak intrinsics in the loop header when the condition is computed outside the loop. llvm-svn: 234891
* Error out of ParseBitcodeInto(Module*) if we haven't read a ModuleFilipe Cabecinhas2015-04-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | Summary: Without this check the following case failed: Skip a SubBlock which is not a MODULE_BLOCK_ID nor a BLOCKINFO_BLOCK_ID Got to end of file TheModule would still be == nullptr, and we would subsequentially fail when materializing the Module (assert at the start of BitcodeReader::MaterializeModule). Bug found with AFL. Reviewers: dexonsmith, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9014 llvm-svn: 234887
* Re-enable target-specific relocation table sorting and use it for MipsPetar Jovanovic2015-04-143-31/+204
| | | | | | | | | | | | | | Some targets (ie. Mips) have additional rules for ordering the relocation table entries. Allow them to override generic sortRelocs(), which sorts entries by Offset. Then override this function for Mips, to emit HI16 and GOT16 relocations against the local symbol in pair with the corresponding LO16 relocation. Patch by Vladimir Stefanovic. Differential Revision: http://reviews.llvm.org/D7414 llvm-svn: 234883
* [MachineLICM] Use newer model of register pressure sets.Daniel Jasper2015-04-141-43/+32
| | | | | | | | | | | | | | | | TargetRegisterInfo::getRegPressureLimit has a note that it is an old model that relies on manually entered classes. Using the newer model of register pressure sets seems more appropriate. We might eventually even switch to lib/CodeGen/RegisterPressure.cpp, but we should probably do incremental changes here. Using the newer model also makes it easier to take regmasks into account which is necessary to fix llvm.org/PR23143. I am currently also preparing a patch for that, but would like to do this switch independently. Review: http://reviews.llvm.org/D8986 llvm-svn: 234880
* Fix crash in DebugInfoFinder when adding a module with forward declared ↵Anders Waldenborg2015-04-141-1/+1
| | | | | | | | | | | | | | | composite type The testcase that is included in the patch caused a crash when doing DebugInfoFinder::processModule on the module due to DCT->getElements() returning nullptr in DebugInfoFinder::processType. By doing "DCT->getElements()" instead of "DCT->getElements()->operands()" one gets a DIArray instead of a raw MDTuple. The former has code to handle null as a 0-element array and therefore avoids the crash. Differential Revision: http://reviews.llvm.org/D9008 llvm-svn: 234875
* Simplify n-ary adds by reassociationJingyue Wu2015-04-143-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This transformation reassociates a n-ary add so that the add can partially reuse existing instructions. For example, this pass can simplify void foo(int a, int b) { bar(a + b); bar((a + 2) + b); } to void foo(int a, int b) { int t = a + b; bar(t); bar(t + 2); } saving one add instruction. Fixes PR22357 (https://llvm.org/bugs/show_bug.cgi?id=22357). Test Plan: nary-add.ll Reviewers: broune, dberlin, hfinkel, meheff, sanjoy, atrick Reviewed By: sanjoy, atrick Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8950 llvm-svn: 234855
* DebugInfo: Update signature of DICompileUnit::replace*()Duncan P. N. Exon Smith2015-04-143-14/+2
| | | | | | | | Change `DICompileUnit::replaceSubprograms()` and `DICompileUnit::replaceGlobalVariables()` to match the `MDCompileUnit` equivalents that they're wrapping. llvm-svn: 234852
* DebugInfo: Gut DISubprogram and DILexicalBlock*Duncan P. N. Exon Smith2015-04-1420-95/+91
| | | | | | | Gut the `DIDescriptor` wrappers around `MDLocalScope` subclasses. Note that `DILexicalBlock` wraps `MDLexicalBlockBase`, not `MDLexicalBlock`. llvm-svn: 234850
* [LoopUnrollRuntime] Avoid high-cost trip count computation.Sanjoy Das2015-04-143-9/+23
| | | | | | | | | | | | | | | | | Summary: Runtime unrolling of loops needs to emit an expression to compute the loop's runtime trip-count. Avoid runtime unrolling if this computation will be expensive. Depends on D8993. Reviewers: atrick Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8994 llvm-svn: 234846
* [SCEV] Strengthen SCEVExpander::isHighCostExpansion.Sanjoy Das2015-04-141-6/+17
| | | | | | | | | | | | | | | | | | Summary: Teach `isHighCostExpansion` to consider divisions by power-of-two constants as cheap and add a test case. This change is needed for a new user of `isHighCostExpansion` that will be added in a subsequent change. Depends on D8995. Reviewers: atrick Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8993 llvm-svn: 234845
* [SCEV] Refactor out isHighCostExpansion. NFCI.Sanjoy Das2015-04-142-56/+62
| | | | | | | | | | | | | | Summary: Move isHighCostExpansion from IndVarSimplify to SCEVExpander. This exposed function will be used in a subsequent change. Reviewers: bogner, atrick Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8995 llvm-svn: 234844
* DebugInfo: Gut DINamespace and DITemplate*ParameterDuncan P. N. Exon Smith2015-04-142-26/+24
| | | | | | | Continue gutting `DIDescriptor` subclasses, turning them into as-bare-as-possible pointer wrappers. llvm-svn: 234843
* DebugInfo: Gut DIVariable and DIGlobalVariableDuncan P. N. Exon Smith2015-04-1412-56/+56
| | | | | | | | | | Gut all the non-pointer API from the variable wrappers, except an implicit conversion from `DIGlobalVariable` to `DIDescriptor`. Note that if you're updating out-of-tree code, `DIVariable` wraps `MDLocalVariable` (`MDVariable` is a common base class shared with `MDGlobalVariable`). llvm-svn: 234840
* [RuntimeDyldELF] Improve GOT supportKeno Fischer2015-04-145-114/+89
| | | | | | | | | | | | | | | | | | Summary: This is the first in a series of patches to eventually add support for TLS relocations to RuntimeDyld. This patch resolves an issue in the current GOT handling, where GOT entries would be reused between object files, which leads to the same situation that necessitates the GOT in the first place, i.e. that the 32-bit offset can not cover all of the address space. Thus this patch makes the GOT object-file-local. Unfortunately, this still isn't quite enough, because the MemoryManager does not yet guarantee that sections are allocated sufficiently close to each other, even if they belong to the same object file. To address this concern, this patch also adds a small API abstraction on top of the GOT allocation mechanism that will allow (temporarily, until the MemoryManager is improved) using the stub mechanism instead of allocating a different section. The actual switch from separate section to stub mechanism will be part of a follow-on commit, so that it can be easily reverted independently at the appropriate time. Test Plan: Includes a test case where the GOT of two object files is artificially forced to be apart by several GB. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8813 llvm-svn: 234839
* DebugInfo: Move DIVariable::printExtendedName() to its only callerDuncan P. N. Exon Smith2015-04-142-36/+37
| | | | | | Move the local function `printDebugLoc()` along with it. llvm-svn: 234838
* DebugInfo: Inline DIVariable::isBlockByrefVariable() into its callersDuncan P. N. Exon Smith2015-04-141-2/+4
| | | | | | | I don't think this API is helping much. Change the callers to call `MDType::isBlockByrefStruct()` directly. llvm-svn: 234837
* DebugInfo: Gut DIObjCProperty and DIImportedEntityDuncan P. N. Exon Smith2015-04-145-19/+16
| | | | | | | Gut a couple more classes in the DIDescriptor hierarchy. Leave behind an implicit conversion to `DIDescriptor`, the old base class. llvm-svn: 234836
* DebugInfo: Gut DILocationDuncan P. N. Exon Smith2015-04-145-17/+16
| | | | | | | | This is along the same lines as r234832, but for `DILocation`. Clean out all accessors from `DILocation`. Any callers should be using `MDLocation` directly (e.g., via `operator->()`). llvm-svn: 234835
* [LoopAccesses] Properly print whether memchecks are neededAdam Nemet2015-04-141-3/+3
| | | | | | | | | | | Fix oversight in -analyze output. PtrRtCheck contains the pointers that need to be checked against each other and not whether memchecks are necessary. For instance in the testcase PtrRtCheck has four elements but all no-alias so no checking is necessary. llvm-svn: 234833
* DebugInfo: Gut DIExpressionDuncan P. N. Exon Smith2015-04-146-28/+26
| | | | | | | | | | | | | | | | Completely gut `DIExpression`, turning it into a simple wrapper around `MDExpression *`. There are two bits of magic left: - It's constructed from `const MDExpression*` but convertible to `MDExpression*`. - It's default-constructed to `nullptr`. Otherwise, it should behave quite like a raw pointer. Once I've done the same to the rest of the `DIDescriptor` subclasses, I'll come back to delete them entirely (and update call sites as necessary to deal with the missing magic). llvm-svn: 234832
* [RewriteStatepointsForGC] Delete dead code [NFC]Philip Reames2015-04-141-26/+4
| | | | | | | | | Before we had real liveness, we needed to track every value that base pointer insertion code created because these now might be live. We now just rerun the data flow liveness algorithm (which is actually faster!) and no longer need the associated code. llvm-svn: 234827
* DebugInfo: Move DILocation::computeNewDiscriminators()Duncan P. N. Exon Smith2015-04-143-6/+24
| | | | | | | | | As documented in PR23200 (and the FIXMEs I've added to the code here), this logic is fairly broken: it modifies the `LLVMContext` in a way that affects other modules and cannot be serialized to assembly/bitcode. For now, move it over to `MDLocation::computeNewDiscriminators()` anyway. llvm-svn: 234825
* AddDiscriminators: Create new MDLocation directlyDuncan P. N. Exon Smith2015-04-142-10/+3
| | | | | | | | | | I don't see a reason to add the `copyWithNewScope()` API over to `MDLocation` -- it seems to be a holdover from when creating locations required knowing details of operand layout -- so change `AddDiscriminators` to call `MDLocation::get()` directly. Should be no functionality change here. llvm-svn: 234824
* DebugInfo: Remove DIObjCProperty attribute accessors, NFCDuncan P. N. Exon Smith2015-04-131-14/+1
| | | | | | | | | There's only one user of the various `DIObjCProperty::is*Property()` accessors -- `DwarfUnit::constructTypeDIE()` -- and it's just using the reverse logic to reconstruct the bitfield. Drop this API and simplify the only caller. llvm-svn: 234818
* Add new getModRefInfo API to determine whether an Instruction and a call ↵Daniel Berlin2015-04-131-0/+17
| | | | | | modify the same memory llvm-svn: 234814
* Common some code from MemoryDependenceAnalysis that will be used in MemorySSADaniel Berlin2015-04-131-17/+1
| | | | llvm-svn: 234813
* Make getModRefInfo with a default location not crash.Daniel Berlin2015-04-131-9/+12
| | | | | | | Add getModRefInfo that works without location. Add unit tests. llvm-svn: 234811
* [CodeGen] Combine concat_vectors of scalars into build_vector.Ahmed Bougacha2015-04-131-0/+60
| | | | | | | | | | | | | Combine something like: (v8i8 concat_vectors (v2i8 bitcast (i16)) x4) into: (v8i8 (bitcast (v4i16 BUILD_VECTOR (i16) x4))) If any of the scalars are floating point, use that throughout. Differential Revision: http://reviews.llvm.org/D8948 llvm-svn: 234809
* Allow printing functions with an optional annotationwriterDaniel Berlin2015-04-131-0/+7
| | | | llvm-svn: 234807
* SelectionDAG: Stop using DIVariable::isInlinedFnArgument()Duncan P. N. Exon Smith2015-04-132-11/+3
| | | | | | | | | | | | | | | | | | Instead of calling the somewhat confusingly-named `DIVariable::isInlinedFnArgument()`, do the check directly here. There's possibly a small functionality change here: instead of `dyn_cast<>`'ing `DV->getScope()` to `MDSubprogram`, I'm looking up the scope chain for the actual subprogram. I suspect that this is a no-op for function arguments so in practise there isn't a real difference. I've also added a `FIXME` to check the `inlinedAt:` chain instead, since I wonder if that would be more reliable than the `MDSubprogram::describes()` function. Since this was the only user of `DIVariable::isInlinedFnArgument()`, delete it. llvm-svn: 234799
* DebugInfo: Remove DIGlobalVariable::getGlobal()Duncan P. N. Exon Smith2015-04-132-8/+3
| | | | | | | | `DIGlobalVariable::getGlobal()` isn't really helpful, it just does a `dyn_cast_or_null<>`. Simplify its only user by doing the cast directly and delete the code. llvm-svn: 234796
* Expand ADDO/SUBO on HexagonKrzysztof Parzyszek2015-04-131-0/+8
| | | | llvm-svn: 234795
* StripSymbols: Use DIGlobalVariable::getConstant() instead of getGlobal()Duncan P. N. Exon Smith2015-04-131-1/+1
| | | | | | | | | | | | | The only difference between the two is a `dyn_cast<>` to `GlobalVariable`. If optimizations have left anything behind when a global gets replaced, then it doesn't seem like the debug info is dead. I can't seem to find an optimization that would leave behind a non-`GlobalVariable` without nulling the reference entirely, so I haven't added a testcase (but I'll be deleting `getGlobal()` in a future commit). llvm-svn: 234792
* GCC complains thusly: "attributes at the beginning of statement are ignored ↵Nick Lewycky2015-04-131-1/+1
| | | | | | [-Werror=attributes]". Very well then! NFC llvm-svn: 234788
* [RwriteStatepointsForGC] Minor indentation and naming [NFC]Philip Reames2015-04-131-39/+30
| | | | | | Use early-return style that's preferred in LLVM and updating the naming in places I touched with other changes in the last few days. Hopefully, NFC. llvm-svn: 234785
OpenPOWER on IntegriCloud