Skip to content
  1. Jun 12, 2020
    • Florian Hahn's avatar
      [BreakCritEdges] Add option to opt-out of perserving loop-simplify. · 4495a6b1
      Florian Hahn authored
      This patch adds a new option to CriticalEdgeSplittingOptions to control
      whether loop-simplify form must be preserved. It is them used by GVN to
      indicate that loop-simplify form does not have to be preserved.
      
      This fixes a crash exposed by 189efe29.
      
      If the critical edge we are splitting goes from a block inside a loop to
      a block outside the loop, splitting the edge will create a new exit
      block. As a result, the new block will branch to the original exit
      block, which will add a non-loop predecessor, breaking loop-simplify
      form. To preserve loop-simplify form, the predecessor blocks of the
      original exit are split, but that does not work for blocks with
      indirectbr terminators. If preserving loop-simplify form is requested,
      bail out , before making any changes.
      
      Reviewers: reames, hfinkel, davide, efriedma
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D81582
      4495a6b1
    • Kirstóf Umann's avatar
      [analyzer][NFC] Change checker dependency unit tests to check for the registration order · d61b1f85
      Kirstóf Umann authored
      Exactly what it says on the tin! "Strong" dependencies are mentioned in contrast
      to a new kind of dependency introduced in a followup patch.
      
      Differential Revision: https://reviews.llvm.org/D80901
      d61b1f85
    • Xing GUO's avatar
      [ObjectYAML][test] Use a single test file to test the empty 'DWARF' entry. · 7e0827e8
      Xing GUO authored
      This patch addresses comments in [D81450](https://reviews.llvm.org/D81450#inline-748745)
      
      Reviewed By: jhenderson
      
      Differential Revision: https://reviews.llvm.org/D81529
      7e0827e8
    • Alex Bradbury's avatar
      [CodeGen] Increase applicability of ffine-grained-bitfield-accesses for... · 3dcfd482
      Alex Bradbury authored
      [CodeGen] Increase applicability of ffine-grained-bitfield-accesses for targets with limited native integer widths
      
      As pointed out in PR45708, -ffine-grained-bitfield-accesses doesn't
      trigger in all cases you think it might for RISC-V. The logic in
      CGRecordLowering::accumulateBitFields checks OffsetInRecord is a legal
      integer according to the datalayout. RISC targets will typically only
      have the native width as a legal integer type so this check will fail
      for OffsetInRecord of 8 or 16 when you would expect the transformation
      is still worthwhile.
      
      This patch changes the logic to check for an OffsetInRecord of a at
      least 1 byte, that fits in a legal integer, and is a power of 2. We
      would prefer to query whether native load/store operations are
      available, but I don't believe that is possible.
      
      Differential Revision: https://reviews.llvm.org/D79155
      3dcfd482
    • Raphael Isemann's avatar
      Add missing IRBuilder include to IndirectThunks.h · f257c213
      Raphael Isemann authored
      This file didn't build with enabled modules.
      f257c213
    • Florian Hahn's avatar
      [VPlan] Reject loops without computable backedge taken counts · 3a846d4d
      Florian Hahn authored
      getOrCreateTripCount is used to generate code for the outer loop, but it
      requires a computable backedge taken counts. Check that in the VPlan
      native path.
      
      Reviewers: Ayal, gilr, rengolin, sguggill
      
      Reviewed By: sguggill
      
      Differential Revision: https://reviews.llvm.org/D81088
      3a846d4d
    • Sebastian Neubauer's avatar
      [AMDGPU] Add G16 support to image instructions · 29a6ad94
      Sebastian Neubauer authored
      Add G16 feature for GFX10 and support A16 and G16 in GlobalISel.
      
      Differential Revision: https://reviews.llvm.org/D76836
      29a6ad94
    • Georgii Rymar's avatar
      [yaml2obj][MachO] - Fix PubName/PubType handling. · d95f8e7a
      Georgii Rymar authored
      `PubName` and `PubType` are optional fields since D80722.
      
      They are defined as:
        Optional<PubSection> PubNames;
        Optional<PubSection> PubTypes;
      
      And initialized in the following way:
        IO.mapOptional("debug_pubnames", DWARF.PubNames);
        IO.mapOptional("debug_pubtypes", DWARF.PubTypes);
      
      But problem is that because of the issue in `YAMLTraits.cpp`,
      when there are no `debug_pubnames`/`debug_pubtypes` keys in a YAML description,
      they are not initialized to `Optional::None` as the code expects, but they
      are initialized to default `PubSection()` instances.
      
      Because of this, the `if` condition in the following code is always true:
      
      if (Obj.DWARF.PubNames)
        Err = DWARFYAML::emitPubSection(OS, *Obj.DWARF.PubNames,
                                        Obj.IsLittleEndian);
      
      What means `emitPubSection` is always called and it writes few values.
      
      This patch fixes the issue. I've reduced `sizeofcmds` by size of data
      previously written because of this bug.
      
      Differential revision: https://reviews.llvm.org/D81686
      d95f8e7a
    • Raphael Isemann's avatar
      [lldb] Don't print IRForTarget errors directly to the console · 91728b91
      Raphael Isemann authored
      Summary:
      
      When we get an error back from IRForTarget we directly print that error to the
      debugger output stream instead of putting it in the result object. The result
      object only gets a vague "The expression could not be prepared to run in the
      target" error message that doesn't actually tell the user what went wrong.
      
      This patch just puts the IRForTarget errors into the status object that is
      returned to the caller instead of directly printing it to the debugger. Also
      updates one test that now can actually check for the error message it is
      supposed to check for (instead of the default error which is all we had before).
      
      Reviewers: JDevlieghere
      
      Reviewed By: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D81654
      91728b91
    • Chen Zheng's avatar
      [PowerPC] refactor convertToImmediateForm - NFC · 9b6e86a1
      Chen Zheng authored
      This is a NFC patch to make convertToImmediateForm a light wrapper
      for converting xform and imm form instructions on PowerPC.
      
      Reviewed By: Steven.zhang
      
      Differential Revision: https://reviews.llvm.org/D80907
      9b6e86a1
    • Rainer Orth's avatar
      [cmake] Don't pass -z discard-unused to Illumos ld · 2feb72bc
      Rainer Orth authored
      I'm currently working to port `libc++` to Solaris.  There exists a slightly
      bitrotten port already, which was done on Illumos, an OpenSolaris
      derivative.  In order not to break that port with my work, I need to test
      the result on both Solaris and Illumos.  While doing so, it turned out that
      Illumos `ld` doesn't support the `-z discard-sections=unused` option
      currently used on SunOS unconditionally.
      
      While there exists a patch
      <https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/developer/clang-90/patches/02-cmake_modules_AddLLVM.cmake.patch>
      for LLVM 9.0 in the OpenIndiana repository, it apparently hasn't been
      submitted upstream and is completely wrong: it replaces
      `-z discard-sections=unused` with `-z ignore`.  In terms of the equivalent
      `gld` options, this means replacing `--gc-sections` with `--as-needed`.
      
      This patch instead tests if the linker actually supports the option before
      using it.
      
      Tested on `amd64-pc-solaris2.11` (all of Solaris 11.4, 11.3 and OpenIndiana
      2020.04).
      
      Differential Revision: https://reviews.llvm.org/D81545
      2feb72bc
    • Martin Boehme's avatar
      [clang] Rename Decl::isHidden() to isUnconditionallyVisible(). · 2e92b397
      Martin Boehme authored
      Also invert the sense of the return value.
      
      As pointed out by the FIXME that this change resolves, isHidden() wasn't
      a very accurate name for this function.
      
      I haven't yet changed any of the strings that are output in
      ASTDumper.cpp / JSONNodeDumper.cpp / TextNodeDumper.cpp in response to
      whether isHidden() is set because
      
      a) I'm not sure whether it's actually desired to change these strings
         (would appreciate feedback on this), and
      
      b) In any case, I'd like to get this pure rename out of the way first,
         without any changes to tests. Changing the strings that are output in
         the various ...Dumper.cpp files will require changes to quite a few
         tests, and I'd like to make those in a separate change.
      
      Differential Revision: https://reviews.llvm.org/D81392
      
      Reviewed By: rsmith
      2e92b397
    • EgorBo's avatar
      [InstCombine] "X - (X / C) * C == 0" to "X & C-1 == 0" · 012909dc
      EgorBo authored
      Summary:
      "X % C == 0" is optimized to "X & C-1 == 0" (where C is a power-of-two)
      However, "X % Y" can also be represented as "X - (X / Y) * Y" so if I rewrite the initial expression:
      "X - (X / C) * C == 0" it's not currently optimized to "X & C-1 == 0", see godbolt: https://godbolt.org/z/KzuXUj
      
      This is my first contribution to LLVM so I hope I didn't mess things up
      
      Reviewers: lebedev.ri, spatel
      
      Reviewed By: lebedev.ri
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79369
      012909dc
    • EgorBo's avatar
    • Jonas Devlieghere's avatar
      [llvm/Object] Reimplment basic_symbol_iterator in TapiFile · 425c6f07
      Jonas Devlieghere authored
      Use indices into the Symbols vector instead of casting the objects in
      the vector and dereferencing std::vector::end().
      
      This change is NFC modulo the Windows failure reported by
      llvm-clang-x86_64-expensive-checks-win.
      
      Differential revision: https://reviews.llvm.org/D81717
      425c6f07
    • Kristof Beyls's avatar
      [AArch64] Extend AArch64SLSHardeningPass to harden BLR instructions. · c35ed40f
      Kristof Beyls authored
      To make sure that no barrier gets placed on the architectural execution
      path, each
        BLR x<N>
      instruction gets transformed to a
        BL __llvm_slsblr_thunk_x<N>
      instruction, with __llvm_slsblr_thunk_x<N> a thunk that contains
      __llvm_slsblr_thunk_x<N>:
        BR x<N>
        <speculation barrier>
      
      Therefore, the BLR instruction gets split into 2; one BL and one BR.
      This transformation results in not inserting a speculation barrier on
      the architectural execution path.
      
      The mitigation is off by default and can be enabled by the
      harden-sls-blr subtarget feature.
      
      As a linker is allowed to clobber X16 and X17 on function calls, the
      above code transformation would not be correct in case a linker does so
      when N=16 or N=17. Therefore, when the mitigation is enabled, generation
      of BLR x16 or BLR x17 is avoided.
      
      As BLRA* indirect calls are not produced by LLVM currently, this does
      not aim to implement support for those.
      
      Differential Revision:  https://reviews.llvm.org/D81402
      c35ed40f
    • Mehdi Amini's avatar
      Revert "[mlir][spirv] Enhance structure type member decoration handling" · 6f0ce468
      Mehdi Amini authored
      This reverts commit 5d74df5b.
      
      This broke the MSVC build:  <bits/stdint-uintn.h> isn't available on Windows
      6f0ce468
    • Yevgeny Rouban's avatar
      [JumpThreading] Handle zero !prof branch_weights · 707836ed
      Yevgeny Rouban authored
      Avoid division by zero in updatePredecessorProfileMetadata().
      
      Reviewers: yamauchi
      Tags: #llvm
      Differential Revision: https://reviews.llvm.org/D81499
      707836ed
    • Craig Topper's avatar
      [X86] Add a helper lambda to getIntelProcessorTypeAndSubtype to select feature... · 0ce9bf6e
      Craig Topper authored
      [X86] Add a helper lambda to getIntelProcessorTypeAndSubtype to select feature bits from the correct 32-bit feature variable.
      
      We have three 32 bit variables containing feature bits. But our
      enum is a flat 96 bit space. So we need to pick which of the
      variables to use based on the bit value. We used to do this
      manually by mentioning the correct variable and subtracting an
      offset from the enum. But this is error prone.
      0ce9bf6e
    • Vitaly Buka's avatar
      [StackSafety] Fix byval handling · 99930732
      Vitaly Buka authored
      We don't need process paramenters which marked as
      byval as we are not going to pass interested allocas
      without copying.
      
      If we pass value into byval argument, we just handle that
      as Load of corresponding type and stop that branch of analysis.
      99930732
    • Alexander Shaposhnikov's avatar
      [llvm-objcopy][MachO] Fix cmdsize of LC_RPATH · c966ed8d
      Alexander Shaposhnikov authored
      Fix the calculation of the field cmdsize (in the function buildRPathLoadCommand)
      to account for the null byte terminator.
      
      Patch by Sameer Arora!
      
      Test plan: make check-all
      
      Differential revision: https://reviews.llvm.org/D81575
      c966ed8d
    • Jonas Devlieghere's avatar
      [lldb/Test] Fix ASan/TSan workaround for Xcode Python 3 · 526e0c8d
      Jonas Devlieghere authored
      The Python 3 interpreter in Xcode has a relative RPATH and dyld fails to
      load it when we copy it into the build directory.
      
      This patch adds an additional check that the copied binary can be
      executed. If it doesn't, we assume we're dealing with the Xcode python
      interpreter and return the path to the real executable. That is
      sufficient for the sanitizers because only system binaries need to be
      copied to work around SIP.
      
      This patch also moves all that logic out of LLDBTest and into the lit
      configuration so that it's executed only once per test run, instead of
      once for every test. Although I didn't benchmark the difference this
      should result in a mild speedup.
      
      Differential revision: https://reviews.llvm.org/D81696
      526e0c8d
    • Yonghong Song's avatar
      [BPF] fix incorrect type in BPFISelDAGToDAG readonly load optimization · 4db18781
      Yonghong Song authored
      In BPF Instruction Selection DAGToDAG transformation phase,
      BPF backend had an optimization to turn load from readonly data
      section to direct load of the values. This phase is implemented
      before libbpf has readonly section support and before alu32
      is supported.
      
      This phase however may generate incorrect type when alu32 is
      enabled. The following is an example,
        -bash-4.4$ cat ~/tmp2/t.c
        struct t {
          unsigned char a;
          unsigned char b;
          unsigned char c;
        };
        extern void foo(void *);
        int test() {
          struct t v = {
            .b = 2,
          };
          foo(&v);
          return 0;
        }
      
      The compiler will turn local variable "v" into a readonly section.
      During instruction selection phase, the compiler generates two
      loads from readonly section, one 2 byte load or 1 byte load, e.g., for 2 loads,
        t8: i32,ch = load<(dereferenceable load 2 from `i8* getelementptr inbounds
             (%struct.t, %struct.t* @__const.test.v, i64 0, i32 0)`, align 1),
             anyext from i16> t3, GlobalAddress:i64<%struct.t* @__const.test.v> 0, undef:i64
        t9: ch = store<(store 2 into %ir.v1.sub1), trunc to i16> t3, t8,
          FrameIndex:i64<0>, undef:i64
      
      BPF backend changed t8 to i64 = Constant<2> and eventually the generated machine IR:
        t10: i64 = MOV_ri TargetConstant:i64<2>
        t40: i32 = SLL_ri_32 t10, TargetConstant:i32<8>
        t41: i32 = OR_ri_32 t40, TargetConstant:i64<0>
        t9: ch = STH32<Mem:(store 2 into %ir.v1.sub1)> t41, TargetFrameIndex:i64<0>,
            TargetConstant:i64<0>, t3
      
      Note that t10 in the above is not correct. The type should be i32 and instruction
      should be MOV_ri_32. The reason for incorrect insn selection is BPF insn selection
      generated an i64 constant instead of an i32 constant as specified in the original
      load instruction. Such incorrect insn sequence eventually caused the following
      fatal error when a COPY insn tries to copy a 64bit register to a 32bit subregister.
        Impossible reg-to-reg copy
        UNREACHABLE executed at ../lib/Target/BPF/BPFInstrInfo.cpp:42!
      
      This patch fixed the issue by using the load result type instead of always i64
      when doing readonly load optimization.
      
      Differential Revision: https://reviews.llvm.org/D81630
      4db18781
    • Esme-Yi's avatar
      Revert "[PowerPC][NFC] Testing ROTL of v1i128." · af9f8c24
      Esme-Yi authored
      This reverts commit 174192af.
      af9f8c24
    • Cyndy Ishida's avatar
      [llvm][llvm-nm] add TextAPI/MachO support · 28fefcc8
      Cyndy Ishida authored
      Summary:
      This completes the needed glueing to support reading tbd files from nm.
      This includes specifying which slice filtering with `--arch` and a new
      option specifically for tbd files `--add-inlinedinfo` which will show
      the reexported libraries that are appended in the tbd file.
      
      Reviewers: ributzka, steven_wu, JDevlieghere, jhenderson
      
      Reviewed By: JDevlieghere
      
      Subscribers: hiraditya, MaskRay, dexonsmith, rupprecht, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D81614
      28fefcc8
    • Alina Sbirlea's avatar
      Verify MemorySSA after all updates. · 519b019a
      Alina Sbirlea authored
      Verify after completing all updates.
      Resolves PR46275.
      519b019a
    • Stella Laurenzo's avatar
      Install the MLIRTableGen static library. · 10bd67c1
      Stella Laurenzo authored
      Summary: * This library is special because of its dependencies so seems to have been inadvertently left out of installs.
      
      Reviewers: antiagainst
      
      Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes
      
      Tags: #mlir
      
      Differential Revision: https://reviews.llvm.org/D81693
      10bd67c1
    • Mehdi Amini's avatar
      Enable FileCheck -enable-var-scope by default in MLIR test · 95371ce9
      Mehdi Amini authored
      This option avoids to accidentally reuse variable across -LABEL match,
      it can be explicitly opted-in by prefixing the variable name with $
      
      Differential Revision: https://reviews.llvm.org/D81531
      95371ce9
    • Wen-Heng (Jack) Chung's avatar
      Use python3 in generate-test-checks.py. · 7bfcb912
      Wen-Heng (Jack) Chung authored
      Summary: Upgrade to python3 in generate-test-checks.py .
      
      Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes
      
      Tags: #mlir
      
      Differential Revision: https://reviews.llvm.org/D81701
      7bfcb912
    • HazemAbdelhafez's avatar
      [mlir][spirv] Enhance structure type member decoration handling · 5d74df5b
      HazemAbdelhafez authored
      Modify structure type in SPIR-V dialect to support:
      1) Multiple decorations per structure member
      2) Key-value based decorations (e.g., MatrixStride)
      
      This commit kept the Offset decoration separate from members'
      decorations container for easier implementation and logical clarity.
      As such, all references to Structure layoutinfo are now offsetinfo,
      and any member layout defining decoration (e.g., RowMajor for Matrix)
      will be add to the members' decorations container along with its
      value if any.
      
      Differential Revision: https://reviews.llvm.org/D81426
      5d74df5b
    • Eric Christopher's avatar
      Tidy up unsigned -> Register fixups. · 3ff8f619
      Eric Christopher authored
      3ff8f619
    • Jacques Pienaar's avatar
      [mlir] Add additional header · 8472ae17
      Jacques Pienaar authored
      Fix gcc10 build and closes: https://bugs.llvm.org/show_bug.cgi?id=45680
      8472ae17
    • Eric Christopher's avatar
      Add a diagnostic string to an assert. · cb21b168
      Eric Christopher authored
      cb21b168
    • Matt Arsenault's avatar
    • Sanjay Patel's avatar
      039ff29e
    • Vitaly Buka's avatar
      [StackSafety,NFC] Fix use of CallBase API · a10fc165
      Vitaly Buka authored
      Code does not need iterate arguments and can get ArgNo from
      CallBase::getArgOperandNo.
      a10fc165
    • Matt Arsenault's avatar
    • Akira Hatanaka's avatar
      [CodeGen] Simplify the way lifetime of block captures is extended · c9a52de0
      Akira Hatanaka authored
      Rather than pushing inactive cleanups for the block captures at the
      entry of a full expression and activating them during the creation of
      the block literal, just call pushLifetimeExtendedDestroy to ensure the
      cleanups are popped at the end of the scope enclosing the block
      expression.
      
      rdar://problem/63996471
      
      Differential Revision: https://reviews.llvm.org/D81624
      c9a52de0
    • Jonas Devlieghere's avatar
      [lldb/Test] Unify DYLD_INSERT_LIBRARIES solution for ASan and TSan · 8d8ec550
      Jonas Devlieghere authored
      Add the same fix for loading the sanitizer runtime for TSan as we
      currently have for ASan and unify the code with a helper function.
      8d8ec550
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Set insert point when emitting control flow pseudos · 2247072b
      Matt Arsenault authored
      This was implicitly assuming the branch instruction was the next after
      the pseudo. It's possible for another non-terminator instruction to be
      inserted between the intrinsic and the branch, so adjust the insertion
      point. Fixes a non-terminator after terminator verifier error (which
      without the verifier, manifested itself as an infinite loop in
      analyzeBranch much later on).
      2247072b
Loading