1. Dec 18, 2018
    • Louis Dionne's avatar
      [libcxx] Remove XFAILs for older macOS versions · c19d7297
      Louis Dionne authored
      That test doesn't fail anymore since r349378, since the assertions that
      r349378 removed must have been bugs in the dylib at some point.
      
      llvm-svn: 349484
      c19d7297
    • Simon Pilgrim's avatar
      [X86][SSE] Add shift combine 'out of range' tests with UNDEFs · be0fbe67
      Simon Pilgrim authored
      Shows failure to simplify out of range shift amounts to UNDEF if any element is UNDEF.
      
      llvm-svn: 349483
      be0fbe67
    • Pavel Labath's avatar
      Un-XFail TestThreadStates.test_process_interrupt · e0d47ca1
      Pavel Labath authored
      This test is passing now on linux. The same test is claimed to be flaky
      on darwin, so it's possible that's true on linux too. If that's the case
      we'll have to skip it here too (or fix it).
      
      I mark the test as not-debug-info-dependent as a drive-by.
      
      llvm-svn: 349482
      e0d47ca1
    • Nikita Popov's avatar
      [X86] Use UADDSAT/USUBSAT instead of ADDUS/SUBUS · 665ab081
      Nikita Popov authored
      Replace the X86ISD opcodes ADDUS and SUBUS with generic ISD opcodes
      UADDSAT and USUBSAT. As a side-effect, this also makes codegen for
      the @llvm.uadd.sat and @llvm.usub.sat intrinsics reasonable.
      
      This only replaces use in the X86 backend, and does not move any of
      the ADDUS/SUBUS X86 specific combines into generic codegen.
      
      Differential Revision: https://reviews.llvm.org/D55787
      
      llvm-svn: 349481
      665ab081
    • Nikita Popov's avatar
      [SelectionDAG][X86] Fix [US](ADD|SUB)SAT vector legalization, add tests · a7d2a235
      Nikita Popov authored
      Integer result promotion needs to use the scalar size, and we need
      support for result widening.
      
      This is in preparation for D55787.
      
      llvm-svn: 349480
      a7d2a235
    • Pavel Labath's avatar
      Un-XFAIL TestExitDuringBreak.py for linux · 56168f0d
      Pavel Labath authored
      This test is passing now on linux, and probably has been passing since
      r282993.
      
      llvm-svn: 349479
      56168f0d
    • Pavel Labath's avatar
      Un-XFAIL TestNamespaceLookup for linux · 7f032031
      Pavel Labath authored
      These tests are now passing on linux, at least with top-of-tree clang,
      clang-6 and gcc-7.3. It's possible it may still be failing with some
      older compilers, but I don't have those around to test.
      
      llvm-svn: 349478
      7f032031
    • Peter Smith's avatar
      [docs] Improve HowToCrossCompilerBuiltinsOnArm · d1328e1a
      Peter Smith authored
      Some recent experience on llvm-dev pointed out some errors in the document:
      - Assumption of ninja
      - Use of --march rather than -march
      - Problems with host include files when a multiarch setup was used
      - Insufficient target information passed to assembler
      - Instructions on using the cmake cache file BaremetalARM.cmake were
        incomplete
      
      There was also insufficient guidance on what to do when various stages
      failed due to misconfiguration or missing steps.
      
      Summary of changes:
      - Fixed problems above
      - Added a troubleshooting section with common errors.
      - Cleared up one "at time of writing" that is no longer a problem.
      
      Differential Revision: https://reviews.llvm.org/D55709
      
      llvm-svn: 349477
      d1328e1a
    • George Rimar's avatar
      [llvm-dwarfdump] - Do not error out on R_X86_64_DTPOFF64/R_X86_64_DTPOFF32 relocations. · 1ec49110
      George Rimar authored
      This is https://bugs.llvm.org/show_bug.cgi?id=39992,
      
      If we have the following code (test.cpp):
      
      thread_local int tdata = 24;
      and build an .o file with debug information:
      
      clang --target=x86_64-pc-linux -c bar.cpp -g
      
      Then object produced may have R_X86_64_DTPOFF64/R_X86_64_DTPOFF32 relocations.
      (clang emits R_X86_64_DTPOFF64 and gcc emits R_X86_64_DTPOFF32 for the code above for me)
      
      Currently, llvm-dwarfdump fails to compute this TLS relocation when dumping
      object and reports an
      error:
      failed to compute relocation: R_X86_64_DTPOFF64, Invalid data was encountered while parsing the file
      
      This relocation represents the offset in the TLS block and resolved by the linker,
      but this info is unavailable at the
      point when the object file is dumped by this tool.
      
      The patch adds the simple evaluation for such relocations to avoid emitting errors.
      Resulting behavior seems to be equal to GNU dwarfdump.
      
      Differential revision: https://reviews.llvm.org/D55762
      
      llvm-svn: 349476
      1ec49110
    • Petar Avramovic's avatar
      [MIPS GlobalISel] ClampScalar G_AND G_OR and G_XOR · 150fd430
      Petar Avramovic authored
      Add narrowScalar for G_AND and G_XOR.
      Legalize G_AND G_OR and G_XOR for types other then s32 
      with clampScalar on MIPS32.
      
      Differential Revision: https://reviews.llvm.org/D55362
      
      llvm-svn: 349475
      150fd430
    • Luke Cheeseman's avatar
      Fix typo in r349473 · 307839cc
      Luke Cheeseman authored
      llvm-svn: 349474
      307839cc
    • Luke Cheeseman's avatar
      Update CallFrameString API to account for r349472 · 9f236d85
      Luke Cheeseman authored
      - CallFrameString now takes an Arch parameter to account for multiplexing
        overlapping CFI directives
      
      llvm-svn: 349473
      9f236d85
    • Luke Cheeseman's avatar
      [AArch64] - Return address signing dwarf support · f57d7d82
      Luke Cheeseman authored
      - Reapply changes intially introduced in r343089
      - The archtecture info is no longer loaded whenever a DWARFContext is created
      - The runtimes libraries (santiziers) make use of the dwarf context classes but
        do not intialise the target info
      - The architecture of the object can be obtained without loading the target info
      - Adding a method to the dwarf context to get this information and multiplex the
        string printing later on
      
      Differential Revision: https://reviews.llvm.org/D55774
      
      llvm-svn: 349472
      f57d7d82
    • Simon Pilgrim's avatar
      [X86][AVX] Add 256/512-bit vector funnel shift tests · ba8e84b3
      Simon Pilgrim authored
      Extra coverage for D55747
      
      llvm-svn: 349471
      ba8e84b3
    • Simon Pilgrim's avatar
      [X86][SSE] Add 128-bit vector funnel shift tests · 46b90e85
      Simon Pilgrim authored
      Extra coverage for D55747
      
      llvm-svn: 349470
      46b90e85
    • Dylan McKay's avatar
      [IPO][AVR] Create new Functions in the default address space specified in the data layout · f920da00
      Dylan McKay authored
      This modifies the IPO pass so that it respects any explicit function
      address space specified in the data layout.
      
      In targets with nonzero program address spaces, all functions should, by
      default, be placed into the default program address space.
      
      This is required for Harvard architectures like AVR. Without this, the
      functions will be marked as residing in data space, and thus not be
      callable.
      
      This has no effect to any in-tree official backends, as none use an
      explicit program address space in their data layouts.
      
      Patch by Tim Neumann.
      
      llvm-svn: 349469
      f920da00
    • Matt Arsenault's avatar
      AMDGPU: Legalize/regbankselect frame_index · c94e26c7
      Matt Arsenault authored
      llvm-svn: 349468
      c94e26c7
    • Matt Arsenault's avatar
      AMDGPU: Legalize/regbankselect fma · c0ea2210
      Matt Arsenault authored
      llvm-svn: 349467
      c0ea2210
    • Simon Pilgrim's avatar
      [TargetLowering] Fallback from SimplifyDemandedVectorElts to SimplifyDemandedBits · af6fbbf1
      Simon Pilgrim authored
      For opcodes not covered by SimplifyDemandedVectorElts, SimplifyDemandedBits might be able to help now that it supports demanded elts as well.
      
      llvm-svn: 349466
      af6fbbf1
    • Tim Northover's avatar
      SROA: preserve alignment tags on loads and stores. · 856628f7
      Tim Northover authored
      When splitting up an alloca's uses we were dropping any explicit
      alignment tags, which means they default to the ABI-required default
      alignment and this can cause miscompiles if the real value was smaller.
      
      Also refactor the TBAA metadata into a parent class since it's shared by
      both children anyway.
      
      llvm-svn: 349465
      856628f7
    • Matt Arsenault's avatar
      GlobalISel: Improve crash on invalid mapping · 1ac38ba7
      Matt Arsenault authored
      If NumBreakDowns is 0, BreakDown is null.
      This trades a null dereference with an assert somewhere
      else.
      
      llvm-svn: 349464
      1ac38ba7
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Legalize/regbankselect fneg/fabs/fsub · e01e7c81
      Matt Arsenault authored
      llvm-svn: 349463
      e01e7c81
    • Simon Pilgrim's avatar
      [X86][SSE] Move VSRAI sign extend in reg fold into SimplifyDemandedBits · 8488a44c
      Simon Pilgrim authored
      (VSRAI (VSHLI X, C1), C1) --> X iff NumSignBits(X) > C1
      
      This works better as part of SimplifyDemandedBits than part of the general combine.
      
      llvm-svn: 349462
      8488a44c
    • Pavel Labath's avatar
      build.py: inherit environment in the gcc builder · 78453945
      Pavel Labath authored
      Summary:
      This should enable the compiler to find the system linker for the link
      step.
      
      Reviewers: stella.stamenova, zturner
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D55736
      
      llvm-svn: 349461
      78453945
    • Joachim Protze's avatar
      [Tests] fix non-determinism failure in testcase · cf80e72e
      Joachim Protze authored
      llvm-svn: 349460
      cf80e72e
    • Simon Pilgrim's avatar
      [X86][SSE] Replace (VSRLI (VSRAI X, Y), 31) -> (VSRLI X, 31) fold. · 26c630f4
      Simon Pilgrim authored
      This fold was incredibly specific - replace with a SimplifyDemandedBits fold to remove a VSRAI if only the original sign bit is demanded (its guaranteed to stay the same).
      
      Test change is merely a rescheduling.
      
      llvm-svn: 349459
      26c630f4
    • Joachim Protze's avatar
      [OMPT] First chunk of final OMPT 5.0 interface updates · 0e0d6cdd
      Joachim Protze authored
      This patch updates the implementation of the ompt_frame_t, ompt_wait_id_t
      and ompt_state_t. The final version of the OpenMP 5.0 spec added the "t"
      for these types.
      Furthermore the structure for ompt_frame_t changed and allows to specify
      that the reenter frame belongs to the runtime.
      
      Patch partially prepared by Simon Convent
      
      Reviewers: hbae
      llvm-svn: 349458
      0e0d6cdd
    • Joachim Protze's avatar
      [OMPT] Add testcase for thread_num provided by implicit task events · 1f7d4aca
      Joachim Protze authored
      llvm-svn: 349457
      1f7d4aca
    • Kristof Beyls's avatar
      Introduce control flow speculation tracking pass for AArch64 · e66bc1f7
      Kristof Beyls authored
      The pass implements tracking of control flow miss-speculation into a "taint"
      register. That taint register can then be used to mask off registers with
      sensitive data when executing under miss-speculation, a.k.a. "transient
      execution".
      This pass is aimed at mitigating against SpectreV1-style vulnarabilities.
      
      At the moment, it implements the tracking of miss-speculation of control
      flow into a taint register, but doesn't implement a mechanism yet to then
      use that taint register to mask off vulnerable data in registers (something
      for a follow-on improvement). Possible strategies to mask out vulnerable
      data that can be implemented on top of this are:
      - speculative load hardening to automatically mask of data loaded
        in registers.
      - using intrinsics to mask of data in registers as indicated by the
        programmer (see https://lwn.net/Articles/759423/).
      
      For AArch64, the following implementation choices are made.
      Some of these are different than the implementation choices made in
      the similar pass implemented in X86SpeculativeLoadHardening.cpp, as
      the instruction set characteristics result in different trade-offs.
      - The speculation hardening is done after register allocation. With a
        relative abundance of registers, one register is reserved (X16) to be
        the taint register. X16 is expected to not clash with other register
        reservation mechanisms with very high probability because:
        . The AArch64 ABI doesn't guarantee X16 to be retained across any call.
        . The only way to request X16 to be used as a programmer is through
          inline assembly. In the rare case a function explicitly demands to
          use X16/W16, this pass falls back to hardening against speculation
          by inserting a DSB SYS/ISB barrier pair which will prevent control
          flow speculation.
      - It is easy to insert mask operations at this late stage as we have
        mask operations available that don't set flags.
      - The taint variable contains all-ones when no miss-speculation is detected,
        and contains all-zeros when miss-speculation is detected. Therefore, when
        masking, an AND instruction (which only changes the register to be masked,
        no other side effects) can easily be inserted anywhere that's needed.
      - The tracking of miss-speculation is done by using a data-flow conditional
        select instruction (CSEL) to evaluate the flags that were also used to
        make conditional branch direction decisions. Speculation of the CSEL
        instruction can be limited with a CSDB instruction - so the combination of
        CSEL + a later CSDB gives the guarantee that the flags as used in the CSEL
        aren't speculated. When conditional branch direction gets miss-speculated,
        the semantics of the inserted CSEL instruction is such that the taint
        register will contain all zero bits.
        One key requirement for this to work is that the conditional branch is
        followed by an execution of the CSEL instruction, where the CSEL
        instruction needs to use the same flags status as the conditional branch.
        This means that the conditional branches must not be implemented as one
        of the AArch64 conditional branches that do not use the flags as input
        (CB(N)Z and TB(N)Z). This is implemented by ensuring in the instruction
        selectors to not produce these instructions when speculation hardening
        is enabled. This pass will assert if it does encounter such an instruction.
      - On function call boundaries, the miss-speculation state is transferred from
        the taint register X16 to be encoded in the SP register as value 0.
      
      Future extensions/improvements could be:
      - Implement this functionality using full speculation barriers, akin to the
        x86-slh-lfence option. This may be more useful for the intrinsics-based
        approach than for the SLH approach to masking.
        Note that this pass already inserts the full speculation barriers if the
        function for some niche reason makes use of X16/W16.
      - no indirect branch misprediction gets protected/instrumented; but this
        could be done for some indirect branches, such as switch jump tables.
      
      Differential Revision: https://reviews.llvm.org/D54896
      
      llvm-svn: 349456
      e66bc1f7
    • Serge Guelton's avatar
      Portable Python script across Python version · 3744de52
      Serge Guelton authored
      In Python2, division between integer yields an integer, while it yields a float in Python3.
      Use a combination of from __future__ import division and // operator to get a portable behavior.
      
      Differential Revision: https://reviews.llvm.org/D55204
      
      llvm-svn: 349455
      3744de52
    • Serge Guelton's avatar
      Portable Python script across Python version · c0ebe773
      Serge Guelton authored
      Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version.
      
      Differential Revision: https://reviews.llvm.org/D55213
      
      llvm-svn: 349454
      c0ebe773
    • Martin Storsjo's avatar
      85833393
    • Martin Storsjo's avatar
      [Driver] Automatically enable -munwind-tables if -fseh-exceptions is enabled · 56f9c81c
      Martin Storsjo authored
      For targets where SEH exceptions are used by default (on MinGW,
      only x86_64 so far), -munwind-tables are added automatically. If
      -fseh-exeptions is enabled on a target where SEH exeptions are
      availble but not enabled by default yet (aarch64), we need to
      pass -munwind-tables if -fseh-exceptions was specified.
      
      Differential Revision: https://reviews.llvm.org/D55749
      
      llvm-svn: 349452
      56f9c81c
    • Martin Storsjo's avatar
      [AArch64] [MinGW] Allow enabling SEH exceptions · 8f0cb9c3
      Martin Storsjo authored
      The default still is dwarf, but SEH exceptions can now be enabled
      optionally for the MinGW target.
      
      Differential Revision: https://reviews.llvm.org/D55748
      
      llvm-svn: 349451
      8f0cb9c3
    • Craig Topper's avatar
      [X86] Add test cases to show isel failing to match BMI blsmsk/blsi/blsr when... · 284d426f
      Craig Topper authored
      [X86] Add test cases to show isel failing to match BMI blsmsk/blsi/blsr when the flag result is used.
      
      A similar things happen to TBM instructions which we already have tests for.
      
      llvm-svn: 349450
      284d426f
    • Serge Guelton's avatar
      Portable Python script across Python version · 73cf752f
      Serge Guelton authored
      ConfigParser module has been renamed as configparser in Python3
      
      Differential Revision: https://reviews.llvm.org/D55200
      
      llvm-svn: 349449
      73cf752f
    • Serge Guelton's avatar
      Portable Python script across Python version · c5d97e3e
      Serge Guelton authored
      Replace `xrange(...)` by either `range(...)` or `list(range(...))` depending on the context.
      
      Differential Revision: https://reviews.llvm.org/D55193
      
      llvm-svn: 349448
      c5d97e3e
    • Serge Guelton's avatar
      Portable Python script across Python version · 366c089b
      Serge Guelton authored
      dict no longer have the `has_key` method in Python3. Instead, one can
      use the `in` keyword which already works in Python2.
      
      llvm-svn: 349447
      366c089b
    • Kewen Lin's avatar
      [PowerPC][NFC]Update vabsd cases with vselect test cases · bbb461f7
      Kewen Lin authored
      Power9 VABSDU* instructions can be exploited for some special vselect sequences.
      Check in the orignal test case here, later the exploitation patch will update this 
      and reviewers can check the differences easily.
      
      llvm-svn: 349446
      bbb461f7
    • Kewen Lin's avatar
      [PowerPC] Exploit power9 new instruction setb · 44ace925
      Kewen Lin authored
      Check the expected pattens feeding to SELECT_CC like:
         (select_cc lhs, rhs,  1, (sext (setcc [lr]hs, [lr]hs, cc2)), cc1)
         (select_cc lhs, rhs, -1, (zext (setcc [lr]hs, [lr]hs, cc2)), cc1)
         (select_cc lhs, rhs,  0, (select_cc [lr]hs, [lr]hs,  1, -1, cc2), seteq)
         (select_cc lhs, rhs,  0, (select_cc [lr]hs, [lr]hs, -1,  1, cc2), seteq)
      Further transform the sequence to comparison + setb if hits.
      
      Differential Revision: https://reviews.llvm.org/D53275
      
      llvm-svn: 349445
      44ace925