Skip to content
  1. Jun 12, 2019
    • Fangrui Song's avatar
      [ELF][RISCV] Treat R_RISCV_{ADD,SET,SUB}* as link-time constants · 4ce0a519
      Fangrui Song authored
      R_RISCV_{ADD,SET,SUB}* are used for local label computation.
      Add a new RelExpr member R_RISCV_ADD to represent them.
      
      R_RISCV_ADD is treated as a link-time constant because otherwise
      R_RISCV_{ADD,SET,SUB}* are not allowed in -pie/-shared mode.
      In glibc Scrt1.o, .rela.eh_frame contains such relocations.
      Because .eh_frame is not writable, we get this error:
      
          ld.lld: error: can't create dynamic relocation R_RISCV_ADD32 against symbol: .L0 in readonly segment; recompil object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
          >>> defined in ..../riscv64-linux-gnu/lib/Scrt1.o
      
      With D63076 and this patch, I can run -pie/-shared programs linked against glibc.
      
      Note llvm-mc cannot currently produce R_RISCV_SET* so they are not tested.
      
      Reviewed By: ruiu
      
      Differential Revision: https://reviews.llvm.org/D63183
      
      llvm-svn: 363128
      4ce0a519
    • Nikolai Kosjar's avatar
      [NFC] Test commit · 6fab7d0e
      Nikolai Kosjar authored
      llvm-svn: 363127
      6fab7d0e
    • Fangrui Song's avatar
      [ELF][PPC64] Don't report "relocation refers to a discarded section" for .toc · 11549e5c
      Fangrui Song authored
      Summary:
      clang (as of 2019-06-12) / gcc (as of 8.2.1) PPC64 may emit a .rela.toc
      which references an embedded switch table in a discarded .rodata/.text
      section. The .toc and the .rela.toc are incorrectly not placed in the
      comdat.
      
      Technically a relocation from outside the group is not allowed by the ELF spec:
      
      > A symbol table entry with STB_LOCAL binding that is defined relative
      > to one of a group's sections, and that is contained in a symbol table
      > section that is not part of the group, must be discarded if the group
      > members are discarded. References to this symbol table entry from
      > outside the group are not allowed.
      
      Don't report errors to work around the bug.
      
      This should fix the ppc64le-lld-multistage-test bot while linking llvm-tblgen:
      
          ld.lld: error: relocation refers to a discarded section: .rodata._ZNK4llvm3MVT13getSizeInBitsEv
          >>> defined in utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenRegisters.cpp.o
          >>> referenced by CodeGenRegisters.cpp
          >>> utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenRegisters.cpp.o:(.toc+0x0)
      
      Some other PPC specific sections may have similar problems. We can blacklist more
      section names when problems occur.
      
          // A simple program that reproduces the bug.
          // Note .rela.toc (outside the group) references a section symbol (STB_LOCAL) in a group.
          void puts(const char *);
          struct A {
            void foo(int a) {
              switch (a) {
              case 0: puts("0"); break;
              case 1: puts("1"); puts("1"); break;
              case 2: puts("2"); break;
              case 3: puts("3"); puts("4"); break;
              case 4: puts("4"); break;
              case 5: puts("5"); puts("5"); break;
              case 6: puts("6"); break;
              }
            }
            int a;
          };
          void foo(A x) { x.foo(x.a); }
      
      Reviewers: ruiu, sfertile, espindola
      
      Reviewed By: ruiu
      
      Subscribers: emaste, nemanjai, arichardson, kbarton, jsji, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63182
      
      llvm-svn: 363126
      11549e5c
    • Craig Topper's avatar
      [X86] Add VCMPSSZrr_Intk and VCMPSDZrr_Intk to isNonFoldablePartialRegisterLoad. · ed4cd448
      Craig Topper authored
      The non-masked versions are already in there. I'm having some
      trouble coming up with a way to test this right now. Most load
      folding should happen during isel so I'm not sure how to get
      peephole pass to do it.
      
      llvm-svn: 363125
      ed4cd448
    • Fangrui Song's avatar
      Revert "Revert r362867: [ELF][PPC] Simplify {read,write}FromHalf16" · 8a529f3c
      Fangrui Song authored
      This reverts commit r363060 and restores r362867.
      
      r362867 is innocent. The ppc64le-lld-multistage-test bot failure was due to a clang/gcc .toc bug:
      
          ld.lld: error: relocation refers to a discarded section: .rodata._ZNK4llvm3MVT13getSizeInBitsEv
          >>> defined in utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenRegisters.cpp.o
          >>> referenced by CodeGenRegisters.cpp
          >>>               utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenRegisters.cpp.o:(.toc+0x0)
      
      It will be worked around by D63182.
      
      llvm-svn: 363124
      8a529f3c
    • Alex Bradbury's avatar
      [RISCV] Fix inline-asm.ll test by adding nounwind attribute · aa6f2af4
      Alex Bradbury authored
      This test failed since CFI directive support was added in r361320.
      
      llvm-svn: 363123
      aa6f2af4
    • Zi Xuan Wu's avatar
      [PowerPC] [Clang] Port SSE2 intrinsics to PowerPC · cc12f68f
      Zi Xuan Wu authored
      Port emmintrin.h which include Intel SSE2 intrinsics implementation to PowerPC platform (using Altivec).
      
      The new headers containing those implemenations are located into a directory named ppc_wrappers
      which has higher priority when the platform is PowerPC on Linux. They are mainly developed by Steven Munroe,
      with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu.
      
      It's a follow-up patch of D62121.
      
      Patched by: Qiu Chaofan <qiucf@cn.ibm.com>
      
      Differential Revision: https://reviews.llvm.org/D62569
      
      llvm-svn: 363122
      cc12f68f
    • Michael Kruse's avatar
      [ScopBuilder] Move hoistInvariantLoads to ScopBuilder. NFC. · 549991e4
      Michael Kruse authored
      Refactor Scop and ScopBuilder class:
      
      1. Move hoistInvariantLoads function from Scop to ScopBuilder class.
      
      2. Private functions (addInvariantLoads, getNonHoistableCtx) are moved
         to public section of Scop class. hoistInvariantLoads function
         references these functions. These functions will be moved to
         ScopBuilder as well in the next steps.
      
      Patch by Dominik Adamski <adamski.dominik@gmail.com>
      
      Differential Revision: https://reviews.llvm.org/D62925
      
      llvm-svn: 363121
      549991e4
    • Hsiangkai Wang's avatar
      [RISCV] Add CFI directives for RISCV prologue/epilog. · 04ddf39b
      Hsiangkai Wang authored
      In order to generate correct debug frame information, it needs to
      generate CFI information in prologue and epilog.
      
      Differential Revision: https://reviews.llvm.org/D61773
      
      llvm-svn: 363120
      04ddf39b
    • Hsiangkai Wang's avatar
      [NFC] Correct comments in RegisterCoalescer. · 93be25b5
      Hsiangkai Wang authored
      Differential Revision: https://reviews.llvm.org/D63124
      
      llvm-svn: 363119
      93be25b5
    • Kai Luo's avatar
      [PowerPC][NFC] Added test for sext/shl combination after isel. · 8faff560
      Kai Luo authored
      llvm-svn: 363118
      8faff560
    • Eric Fiselier's avatar
      Apply [[nodebug]] to typedefs throughout the STL. · 14d48692
      Eric Fiselier authored
      When applied to a typedef or alias template, the [[nodebug]] attribute
      makes the typedef transparent to the debugger, so instead of seeing
      `std::__function::__alloc_func<remove_reference<void(&)()>::type,
      allocator<remove_reference<void(&)()>, void()>::_Target` you see
      `void(&)()` as the type of the variable in your debugger.
      
      Removing all this SFINAE noise from debug info has huge binary size
      wins, in addition to improving the readability.
      
      For now this change is on by default. Users can override it by
      specifying -D_LIBCPP_NODEBUG_TYPE=
      
      llvm-svn: 363117
      14d48692
    • Pengfei Wang's avatar
      [X86] [ABI] Fix i386 ABI "__m64" type bug · fbfee60c
      Pengfei Wang authored
      According to System V i386 ABI: the  __m64 type paramater and return
      value are passed by MMX registers. But current implementation treats
      __m64 as i64 which results in parameter passing by stack and returning
      by EDX and EAX.
      
      This patch fixes the bug (https://bugs.llvm.org/show_bug.cgi?id=41029)
      for Linux and NetBSD.
      
      Patch by Wei Xiao (wxiao3)
      
      Differential Revision: https://reviews.llvm.org/D59744
      
      llvm-svn: 363116
      fbfee60c
    • Jason Molenda's avatar
      Back out r363103 ("When reading ObjC class table, use new SPI if it is avail") · dd4bed3d
      Jason Molenda authored
      because it breaks the windows bot - asprintf() is not available.
      
      llvm-svn: 363115
      dd4bed3d
    • Cameron McInally's avatar
      [NFC][CodeGen] Add unary FNeg tests to X86/avx512vl-intrinsics-fast-isel.ll X86/combine-fabs.ll · 6fe46ec2
      Cameron McInally authored
      X86/avx512vl-intrinsics-fast-isel.ll is only partially complete.
      
      llvm-svn: 363114
      6fe46ec2
    • Richard Smith's avatar
      Mark declarations as referenced by a default argument in a · 7f61d441
      Richard Smith authored
      potentially-evaluated context.
      
      This applies even if the use of the default argument is within an
      unevaluated context.
      
      llvm-svn: 363113
      7f61d441
    • Philip Reames's avatar
      Fix a bug in getSCEVAtScope w.r.t. non-canonical loops · 02f0b379
      Philip Reames authored
      The issue is that if we have a loop with multiple predecessors outside the loop, the code was expecting to merge them and only return if equal, but instead returned the first one seen.
      
      I have no idea if this actually tripped anywhere.  I noticed it by accident when reading the code and have no idea how to go about constructing a test case.
      
      llvm-svn: 363112
      02f0b379
    • Eric Fiselier's avatar
      0e9b1d2a
    • Eric Fiselier's avatar
      Add documentation and tests for Clangs C++11 extensions in C++03. · 49595426
      Eric Fiselier authored
      As we gear up to drop support for GCC in C++03, we should make clear
      what our C++03 mode is, the C++11 extensions it provides,
      and the C++11 extensions it depends on.
      
      The section of this document discussing user-facing extensions has
      been left blank while the community discusses new directions. For now
      it's just a warning to users.
      
      Additionally, the document contains examples of how these extensions
      should be used and why. For example, using alias templates over class
      templates.
      
      llvm-svn: 363110
      49595426
    • Alex Langford's avatar
      6691f1b6
    • Philip Reames's avatar
      Generalize icmp matching in IndVars' eliminateTrunc · 082cd303
      Philip Reames authored
      We were only matching RHS being a loop invariant value, not the inverse. Since there's nothing which appears to canonicalize loop invariant values to RHS, this means we missed cases.
      
      Differential Revision: https://reviews.llvm.org/D63112
      
      llvm-svn: 363108
      082cd303
    • Louis Dionne's avatar
      [libcxx] Mark CTAD tests for set and multiset as unsupported on older Apple Clangs · c06943b6
      Louis Dionne authored
      Those fail on Green Dragon.
      
      llvm-svn: 363107
      c06943b6
    • Sanjay Patel's avatar
      [Analysis] add isSplatValue() for vectors in IR · 40e3bdf8
      Sanjay Patel authored
      We have the related getSplatValue() already in IR (see code just above the proposed addition).
      But sometimes we only need to know that the value is a splat rather than capture the splatted
      scalar value. Also, we have an isSplatValue() function already in SDAG.
      
      Motivation - recent bugs that would potentially benefit from improved splat analysis in IR:
      https://bugs.llvm.org/show_bug.cgi?id=37428
      https://bugs.llvm.org/show_bug.cgi?id=42174
      
      Differential Revision: https://reviews.llvm.org/D63138
      
      llvm-svn: 363106
      40e3bdf8
    • Jinsong Ji's avatar
      [PowerPC][NFC]Remove sms-simple.ll test temporarily. · 898d4811
      Jinsong Ji authored
      Looks like a MachinePipeliner algorithm problem found by
      sanitizer-x86_64-linux-fast.
      I will backout this test first while investigating the problem to
      unblock buildbot.
      
      ==49637==ERROR: AddressSanitizer: heap-buffer-overflow on address
      0x614000002e08 at pc 0x000004364350 bp 0x7ffe228a3bd0 sp 0x7ffe228a3bc8
      READ of size 4 at 0x614000002e08 thread T0
          #0 0x436434f in
      llvm::SwingSchedulerDAG::checkValidNodeOrder(llvm::SmallVector<llvm::NodeSet,
      8u> const&) const
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/CodeGen/MachinePipeliner.cpp:3736:11
          #1 0x4342cd0 in llvm::SwingSchedulerDAG::schedule()
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/CodeGen/MachinePipeliner.cpp:486:3
          #2 0x434042d in
      llvm::MachinePipeliner::swingModuloScheduler(llvm::MachineLoop&)
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/CodeGen/MachinePipeliner.cpp:385:7
          #3 0x433eb90 in
      llvm::MachinePipeliner::runOnMachineFunction(llvm::MachineFunction&)
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/CodeGen/MachinePipeliner.cpp:207:5
          #4 0x428b7ea in
      llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/CodeGen/MachineFunctionPass.cpp:73:13
          #5 0x4d1a913 in llvm::FPPassManager::runOnFunction(llvm::Function&)
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1648:27
          #6 0x4d1b192 in llvm::FPPassManager::runOnModule(llvm::Module&)
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1685:16
          #7 0x4d1c06d in runOnModule
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1752:27
          #8 0x4d1c06d in llvm::legacy::PassManagerImpl::run(llvm::Module&)
      /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1865
          #9 0xa48ca3 in compileModule(char**, llvm::LLVMContext&)
      /b/sanitizer-x86_64-linux-fast/build/llvm/tools/llc/llc.cpp:611:8
          #10 0xa4270f in main
      /b/sanitizer-x86_64-linux-fast/build/llvm/tools/llc/llc.cpp:365:22
          #11 0x7fec902572e0 in __libc_start_main
      (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
          #12 0x971b69 in _start
      (/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llc+0x971b69)
      
      llvm-svn: 363105
      898d4811
  2. Jun 11, 2019
Loading