summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Teach __builtin_unpredictable to work through implicit casts.Erich Keane2018-12-122-2/+12
| | | | | | | | | The __builtin_unpredictable implementation is confused by any implicit casts, which happen in C++. This patch strips those off so that if/switch statements now work with it in C++. Change-Id: I73c3bf4f1775cd906703880944f4fcdc29fffb0a llvm-svn: 348969
* [test] [filesystems] NetBSD can do symlink permissions tooMichal Gorny2018-12-121-1/+1
| | | | llvm-svn: 348968
* [test] [filesystems] Extend FreeBSD tv_sec==-1 workaround to NetBSDMichal Gorny2018-12-121-1/+1
| | | | | | | NetBSD also uses tv_sec==-1 as error status indicator, and does not support setting such a value. llvm-svn: 348967
* [X86] Added missing constant pool checks. NFCI.Simon Pilgrim2018-12-121-0/+2
| | | | | | So the extra checks in D55600 don't look like a regression. llvm-svn: 348966
* DebugInfo/DWARF: Pretty print subroutine typesDavid Blaikie2018-12-122-2/+64
| | | | | | | | Doesn't handle varargs and other fun things, but it's a start. (also doesn't print these strictly as valid C++ when it's a pointer to function, it'll print as "void(int)*" instead of "void (*)(int)") llvm-svn: 348965
* [AMDGPU] Emit MessagePack HSA Metadata for v3 code objectScott Linder2018-12-1231-154/+3658
| | | | | | | | | Continue to present HSA metadata as YAML in ASM and when output by tools (e.g. llvm-readobj), but encode it in Messagepack in the code object. Differential Revision: https://reviews.llvm.org/D48179 llvm-svn: 348963
* DebugInfo/DWARF: Improve dumping of pointers to members ('int foo::*' rather ↵David Blaikie2018-12-122-3/+22
| | | | | | than 'int*') llvm-svn: 348962
* DebugInfo/DWARF: Refactor type dumping to dump types, rather than DIEs that ↵David Blaikie2018-12-121-5/+3
| | | | | | | | | | | | reference types This lays the foundation for dumping types not referenced by DW_AT_type attributes (in the near-term, that'll be DW_AT_containing_type for a DW_TAG_ptr_to_member_type - in the future, potentially dumping the pretty printed name next to the DW_TAG for the type, rather than only when the type is referenced from elsewhere) llvm-svn: 348961
* DebugInfo/DWARF: Refactor getAttributeValueAsReferencedDie to accept a ↵David Blaikie2018-12-122-3/+12
| | | | | | | | | DWARFFormValue Save searching for the attribute again when you already have the DWARFFormValue at hand. llvm-svn: 348960
* [X86] Emit SBB instead of SETCC_CARRY from LowerSELECT. Break false ↵Craig Topper2018-12-127-119/+154
| | | | | | | | | | | | dependency on the SBB input. I'm hoping we can just replace SETCC_CARRY with SBB. This is another step towards that. I've explicitly used zero as the input to the setcc to avoid a false dependency that we've had with the SETCC_CARRY. I changed one of the patterns that used NEG to instead use an explicit compare with 0 on the LHS. We needed the zero anyway to avoid the false dependency. The negate would clobber its input register. By using a CMP we can avoid that which could be useful. Differential Revision: https://reviews.llvm.org/D55414 llvm-svn: 348959
* Fix Wdocumentation warning. NFCI.Simon Pilgrim2018-12-121-3/+3
| | | | llvm-svn: 348958
* [ConstantFold] Use getMinSignedBits for APInt in isIndexInRangeOfArrayType.Florian Hahn2018-12-122-2/+12
| | | | | | | | | | | | | | | | | Indices for getelementptr can be signed so we should use getMinSignedBits instead of getActiveBits here. The function later calls getSExtValue to get the int64_t value, which also checks getMinSignedBits. This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11647. Reviewers: mssimpso, efriedma, davide Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D55536 llvm-svn: 348957
* [X86] Added missing constant pool checks. NFCI.Simon Pilgrim2018-12-121-0/+4
| | | | | | So the extra checks in D55600 don't look like a regression. llvm-svn: 348956
* Update for an llvm-dwarfdump change in outputDavid Blaikie2018-12-121-2/+2
| | | | llvm-svn: 348955
* llvm-dwarfdump: Dump array dimensions in stringified type namesDavid Blaikie2018-12-122-2/+200
| | | | llvm-svn: 348954
* [SelectionDAG] Add a generic isSplatValue functionSimon Pilgrim2018-12-124-50/+126
| | | | | | | | | | | | | | This patch introduces a generic function to determine whether a given vector type is known to be a splat value for the specified demanded elements, recursing up the DAG looking for BUILD_VECTOR or VECTOR_SHUFFLE splat patterns. It also keeps track of the elements that are known to be UNDEF - it returns true if all the demanded elements are UNDEF (as this may be useful under some circumstances), so this needs to be handled by the caller. A wrapper variant is also provided that doesn't take the DemandedElts or UndefElts arguments for cases where we just want to know if the SDValue is a splat or not (with/without UNDEFS). I had hoped to completely remove the X86 local version of this function, but I'm seeing some regressions in shift/rotate codegen that will take a little longer to fix and I hope to get this in sooner so I can continue work on PR38243 which needs more capable splat detection. Differential Revision: https://reviews.llvm.org/D55426 llvm-svn: 348953
* [NVPTX] do not rely on cached subtarget info.Artem Belevich2018-12-123-13/+29
| | | | | | | | | | | | | | If a module has function references, but no functions themselves, we may end up never calling runOnMachineFunction and therefore would never initialize nvptxSubtarget field which would eventually cause a crash. Instead of relying on nvptxSubtarget being initialized by one of the methods, retrieve subtarget info directly. Differential Revision: https://reviews.llvm.org/D55580 llvm-svn: 348952
* NFC: fix compiler warning about code never being executed when compiling on ↵Greg Clayton2018-12-121-3/+4
| | | | | | non windows platform. llvm-svn: 348951
* Change CallGraph print to show the fully qualified nameErich Keane2018-12-122-6/+7
| | | | | | | | | | CallGraph previously would just show the normal name of a function, which gets really confusing when using it on large C++ projects. This patch switches the printName call to a printQualifiedName, so that the namespaces are included. Change-Id: Ie086d863f6b2251be92109ea1b0946825b28b49a llvm-svn: 348950
* [LV] Fix signed/unsigned comparison warning.Michael Kruse2018-12-121-1/+2
| | | | llvm-svn: 348949
* [gn build] Merge r348944Nico Weber2018-12-121-0/+1
| | | | llvm-svn: 348948
* [docs] Use correct ending quotes.Michael Kruse2018-12-121-1/+1
| | | | llvm-svn: 348947
* [x86] allow 8-bit adds to be promoted by convertToThreeAddress() to form LEASanjay Patel2018-12-1214-57/+70
| | | | | | | | | | This extends the code that handles 16-bit add promotion to form LEA to also allow 8-bit adds. That allows us to combine add ops with register moves and save some instructions. This is another step towards allowing add truncation in generic DAGCombiner (see D54640). Differential Revision: https://reviews.llvm.org/D55494 llvm-svn: 348946
* [gn build] Add all non-test build files for lldNico Weber2018-12-1214-2/+338
| | | | | | | | | | | | Version.inc.in processing has a potentially interesting part which I've punted on for now (LLD_REVISION and LLD_REPOSITORY are set to empty strings for now). lld now builds in the gn build. But no symlinks to it are created yet, so it can't be meaningfully run yet. Differential Revision: https://reviews.llvm.org/D55593 llvm-svn: 348945
* [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes.Michael Kruse2018-12-1258-121/+2472
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When multiple loop transformation are defined in a loop's metadata, their order of execution is defined by the order of their respective passes in the pass pipeline. For instance, e.g. #pragma clang loop unroll_and_jam(enable) #pragma clang loop distribute(enable) is the same as #pragma clang loop distribute(enable) #pragma clang loop unroll_and_jam(enable) and will try to loop-distribute before Unroll-And-Jam because the LoopDistribute pass is scheduled after UnrollAndJam pass. UnrollAndJamPass only supports one inner loop, i.e. it will necessarily fail after loop distribution. It is not possible to specify another execution order. Also,t the order of passes in the pipeline is subject to change between versions of LLVM, optimization options and which pass manager is used. This patch adds 'followup' attributes to various loop transformation passes. These attributes define which attributes the resulting loop of a transformation should have. For instance, !0 = !{!0, !1, !2} !1 = !{!"llvm.loop.unroll_and_jam.enable"} !2 = !{!"llvm.loop.unroll_and_jam.followup_inner", !3} !3 = !{!"llvm.loop.distribute.enable"} defines a loop ID (!0) to be unrolled-and-jammed (!1) and then the attribute !3 to be added to the jammed inner loop, which contains the instruction to distribute the inner loop. Currently, in both pass managers, pass execution is in a fixed order and UnrollAndJamPass will not execute again after LoopDistribute. We hope to fix this in the future by allowing pass managers to run passes until a fixpoint is reached, use Polly to perform these transformations, or add a loop transformation pass which takes the order issue into account. For mandatory/forced transformations (e.g. by having been declared by #pragma omp simd), the user must be notified when a transformation could not be performed. It is not possible that the responsible pass emits such a warning because the transformation might be 'hidden' in a followup attribute when it is executed, or it is not present in the pipeline at all. For this reason, this patche introduces a WarnMissedTransformations pass, to warn about orphaned transformations. Since this changes the user-visible diagnostic message when a transformation is applied, two test cases in the clang repository need to be updated. To ensure that no other transformation is executed before the intended one, the attribute `llvm.loop.disable_nonforced` can be added which should disable transformation heuristics before the intended transformation is applied. E.g. it would be surprising if a loop is distributed before a #pragma unroll_and_jam is applied. With more supported code transformations (loop fusion, interchange, stripmining, offloading, etc.), transformations can be used as building blocks for more complex transformations (e.g. stripmining+stripmining+interchange -> tiling). Reviewed By: hfinkel, dmgreen Differential Revision: https://reviews.llvm.org/D49281 Differential Revision: https://reviews.llvm.org/D55288 llvm-svn: 348944
* [Driver] Add support for -fembed-bitcode for assembly fileSteven Wu2018-12-124-1/+41
| | | | | | | | | | | | | | | | | | Summary: Handle -fembed-bitcode for assembly inputs. When the input file is assembly, write a marker as "__LLVM,__asm" section. Fix llvm.org/pr39659 Reviewers: compnerd, dexonsmith Reviewed By: compnerd Subscribers: rjmccall, dblaikie, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D55525 llvm-svn: 348943
* Make clang::CallGraph look into template instantiationsErich Keane2018-12-122-1/+21
| | | | | | | | | Clang's CallGraph analysis doesn't use the RecursiveASTVisitor's setting togo into template instantiations. The result is that anything wanting to do call graph analysis ends up missing any template function calls. Change-Id: Ib4af44ed59f15d43f37af91622a203146a3c3189 llvm-svn: 348942
* [ast] CreateParameterDeclaration should use an appropriate DeclContext.Zachary Turner2018-12-125-9/+12
| | | | | | | | | | | | | | | | | | Previously CreateParameterDeclaration was always using the translation unit DeclContext. We would later go and add parameters to the FunctionDecl, but internally clang makes a copy when you do this, and we'd end up with ParmVarDecl's at the global scope as well as in the function scope. This fixes the issue. It's hard to say whether this will introduce a behavioral change in name lookup, but I know there have been several hacks introduced in previous years to deal with collisions between various types of variables, so there's a chance that this patch could obviate one of those hacks. Differential Revision: https://reviews.llvm.org/D55571 llvm-svn: 348941
* [SampleFDO] Extend profile-sample-accurate option to cover ↵Wei Mi2018-12-122-1/+37
| | | | | | | | | | | | | | isFunctionColdInCallGraph For SampleFDO, when a callsite doesn't appear in the profile, it will not be marked as cold callsite unless the option -profile-sample-accurate is specified. But profile-sample-accurate doesn't cover function isFunctionColdInCallGraph which is used to decide whether a function should be put into text.unlikely section, so even if the user knows the profile is accurate and specifies profile-sample-accurate, those functions not appearing in the sample profile are still not be put into text.unlikely section right now. The patch fixes that. Differential Revision: https://reviews.llvm.org/D55567 llvm-svn: 348940
* Basic: make `int_least64_t` and `int_fast64_t` match on DarwinSaleem Abdulrasool2018-12-122-12/+21
| | | | | | | | | The Darwin targets use `int64_t` and `uint64_t` to define the `int_least64_t` and `int_fast64_t` types. The underlying type is actually a `long long`. Match the types to allow the printf specifiers to work properly and have the compiler vended macros match the implementation on the target. llvm-svn: 348939
* [ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element ↵Hubert Tong2018-12-123-34/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | types Summary: `memchr` and `memcmp` operate upon the character units of the object representation; that is, the `size_t` parameter expresses the number of character units. The constant folding implementation is updated in this patch to account for multibyte element types in the arrays passed to `memchr`/`memcmp` and, in the case of `memcmp`, to account for the possibility that the arrays may have differing element types (even when they are byte-sized). Actual inspection of the object representation is not implemented. Comparisons are done only between elements with the same object size; that is, `memchr` will fail when inspecting at least one character unit of a multibyte element. The integer types are assumed to have two's complement representation with 0 for `false`, 1 for `true`, and no padding bits. `memcmp` on multibyte elements will only be able to fold in cases where enough elements are equal for the answer to be 0. Various tests are added to guard against incorrect folding for cases that miscompile on some system or other prior to this patch. At the same time, the unsigned 32-bit `wchar_t` testing in `test/SemaCXX/constexpr-string.cpp` is restored. Reviewers: rsmith, aaron.ballman, hfinkel Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55510 llvm-svn: 348938
* [AMDGPU] Extend the SI Load/Store optimizer to combine more things.Neil Henning2018-12-1213-268/+769
| | | | | | | | | | I've extended the load/store optimizer to be able to produce dwordx3 loads and stores, This change allows many more load/stores to be combined, and results in much more optimal code for our hardware. Differential Revision: https://reviews.llvm.org/D54042 llvm-svn: 348937
* ELF: Clean up section type computationPavel Labath2018-12-126-160/+82
| | | | | | | | | | | | | Move code into a separate function, and replace the if-else chain with llvm::StringSwitch. A slight behavioral change is that now I use the section flags (SHF_TLS) instead of the section name to set the thread-specific property. There is no explanation in the original commit introducing this (r153537) as to why that was done this way, but the new behavior should be more correct. llvm-svn: 348936
* [mips] Enable using of integrated assembler in all cases.Simon Atanasyan2018-12-121-10/+1
| | | | llvm-svn: 348935
* [mips] Enable using of integrated assembler in all cases.Simon Atanasyan2018-12-121-21/+1
| | | | llvm-svn: 348934
* [AggressiveInstCombine] add tests for rotates with branch; NFCSanjay Patel2018-12-121-0/+191
| | | | llvm-svn: 348933
* Remove TODO leftover from my devleopment branchErich Keane2018-12-121-1/+0
| | | | | | | Accidentially checked in a TODO line from r348899. This removes it. Change-Id: I74b59c0ecfe147af8a08dd7fd10893a4ca351d6d llvm-svn: 348932
* Revert "[OpenCL] Add generic AS to 'this' pointer"Mikael Nilsson2018-12-1240-390/+143
| | | | | | Reverting because the patch broke lldb. llvm-svn: 348931
* [CUDA][OPENMP][NVPTX]Improve logic of the debug info support.Alexey Bataev2018-12-126-46/+104
| | | | | | | | | | | | | | | | | | | | | | Summary: Added support for the -gline-directives-only option + fixed logic of the debug info for CUDA devices. If optimization level is O0, then options --[no-]cuda-noopt-device-debug do not affect the debug info level. If the optimization level is >O0, debug info options are used + --no-cuda-noopt-device-debug is used or no --cuda-noopt-device-debug is used, the optimization level for the device code is kept and the emission of the debug directives is used. If the opt level is > O0, debug info is requested + --cuda-noopt-device-debug option is used, the optimization is disabled for the device code + required debug info is emitted. Reviewers: tra, echristo Subscribers: aprantl, guansong, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D51554 llvm-svn: 348930
* [clang-fuzzer] Add explicit dependency on clangSerialization for ↵Alex Bradbury2018-12-121-0/+1
| | | | | | | | | | | clangHandleCXX after rC348907 This library was breaking my -DBUILD_SHARED_LIBS=1 build. rC348915 seemed to miss this case. As this seems an "obvious" fix, I am committing without pre-commit review as per the LLVM developer policy. llvm-svn: 348929
* ELF: Simplify program header iterationPavel Labath2018-12-124-98/+59
| | | | | | | | | | | | | Instead of GetProgramHeaderCount+GetProgramHeaderByIndex, expose an ArrayRef of all program headers, to enable range-based iteration. Instead of GetSegmentDataByIndex, expose GetSegmentData, taking a program header (reference). This makes the code simpler by enabling range-based loops and also allowed to remove some null checks, as it became locally obvious that some pointers can never be null. llvm-svn: 348928
* [OpenCL] Add generic AS to 'this' pointerMikael Nilsson2018-12-1240-143/+390
| | | | | | | | | | Address spaces are cast into generic before invoking the constructor. Added support for a trailing Qualifiers object in FunctionProtoType. Differential Revision: https://reviews.llvm.org/D54862 llvm-svn: 348927
* [TargetLowering] Add ISD::AND handling to SimplifyDemandedVectorEltsSimon Pilgrim2018-12-127-46/+57
| | | | | | | | If either of the operand elements are zero then we know the result element is going to be zero (even if the other element is undef). Differential Revision: https://reviews.llvm.org/D55558 llvm-svn: 348926
* Regenerate knownbits test. NFCI.Simon Pilgrim2018-12-121-13/+27
| | | | | | A future SimplifyDemandedBits patch will affect this code and I want to ensure the codegen diff is obvious. llvm-svn: 348925
* lldb-test: Add ability to dump subsectionsPavel Labath2018-12-122-20/+138
| | | | | | | | Previously, lldb-test would only print top-level sections. However, in lldb, sections can contain other sections. This teaches lldb-test to print nested sections too. llvm-svn: 348924
* [ASTImporter] Remove import of definition from GetAlreadyImportedOrNullGabor Marton2018-12-122-11/+9
| | | | | | | | | | | | Summary: a_sidorin Reviewers: a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53755 llvm-svn: 348923
* [AMDGPU] Set metadata access for explicit sectionPiotr Sobczak2018-12-123-0/+68
| | | | | | | | | | | | | | | | | | | Summary: This patch provides a means to set Metadata section kind for a global variable, if its explicit section name is prefixed with ".AMDGPU.metadata." This could be useful to make the global variable go to an ELF section without any section flags set. Reviewers: dstuttard, tpr, kzhuravl, nhaehnle, t-tye Reviewed By: dstuttard, kzhuravl Subscribers: llvm-commits, arsenm, jvesely, wdng, yaxunl, t-tye Differential Revision: https://reviews.llvm.org/D55267 llvm-svn: 348922
* [lit]Add llvm-readelf to tool substitutionsJames Henderson2018-12-121-5/+5
| | | | | | | | Reviewed by: rnk, alexsahp Differential Revision: https://reviews.llvm.org/D55564 llvm-svn: 348921
* [ARM GlobalISel] Select load/store for Thumb2Diana Picus2018-12-125-30/+171
| | | | | | | | | | | | Unfortunately we can't use TableGen for this because it doesn't yet support predicates on the source pattern root. Therefore, add a bit of handwritten code to the instruction selector to handle the most basic cases. Also mark them as legal and extract their legalizer test cases to a new test file. llvm-svn: 348920
* [OpenCL] Fix for TBAA information of pointer after addresspacecastAndrew Savonichev2018-12-122-2/+23
| | | | | | | | | | | | | | Summary: When addresspacecast is generated resulting pointer should preserve TBAA information from original value. Reviewers: rjmccall, yaxunl, Anastasia Reviewed By: rjmccall Subscribers: asavonic, kosarev, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D55262 llvm-svn: 348919
OpenPOWER on IntegriCloud