1. Dec 08, 2020
    • Luís Marques's avatar
      [Clang][CodeGen][RISCV] Fix hard float ABI test cases with empty struct · fa8f5bfa
      Luís Marques authored
      The code seemed not to account for the field 1 offset.
      
      Differential Revision: https://reviews.llvm.org/D91270
      fa8f5bfa
    • Luís Marques's avatar
      [Clang][CodeGen][RISCV] Add hard float ABI tests with empty struct · ca93f9ab
      Luís Marques authored
      This patch adds tests that showcase a behavior that is currently buggy.
      Fix in a follow-up patch.
      
      Differential Revision: https://reviews.llvm.org/D91269
      ca93f9ab
    • Anton Afanasyev's avatar
      [SLP][Test] Differentiate SSE/AVX512 test coverage (NFC) · 6c3f56ef
      Anton Afanasyev authored
      Add test coverage for SSE/AVX512 for insert-after-bundle.ll test.
      Prepare this test for accurate showing of PR46983 fix.
      6c3f56ef
    • Richard Smith's avatar
      Revert "Add new 'preferred_name' attribute." · a1344779
      Richard Smith authored
      This change exposed a pre-existing issue with deserialization cycles
      caused by a combination of attributes and template instantiations
      violating the deserialization ordering restrictions; see PR48434 for
      details.
      
      A previous commit attempted to work around PR48434, but appears to have
      only been a partial fix, and fixing this properly seems non-trivial.
      Backing out for now to unblock things.
      
      This reverts commit 98f76adf and
      commit a64c26a4.
      a1344779
    • David Blaikie's avatar
      Fix shtest-timeout test harder · 44156787
      David Blaikie authored
      Don't produce or expect any output from the infinite looping test -
      doing so is a recipe for racey flakyness without a longer timeout to
      ensure the output is received first, even though that doesn't seem
      integral/important to the test. Instead have a plain, no output infinite
      loop and check that that is caught and handled.
      
      If for some reason the output is valuable for test coverage - the
      timeout should be increased from 1 second to give the process time to
      output the text, flush, and for that text to be received and buffered
      before the test is timed out.
      44156787
    • Marek Kurdej's avatar
      [libc++] Mark LWG3200 as Nothing To Do. NFC. · ba3adfad
      Marek Kurdej authored
      This is only a wording change, because it is currently impossible to constrain the overload set on whether the type is complete or not.
      ba3adfad
    • Qiu Chaofan's avatar
      92160b23
    • Arthur Eubanks's avatar
      [test] Pin provenance.ll to legacy PM · ac6b03c2
      Arthur Eubanks authored
      It doesn't seem right to port -pa-eval just for one test, punting
      decision for how to handle this.
      ac6b03c2
    • Arthur Eubanks's avatar
      [test] Fix loop-micro-op-buffer-size-t99.ll under NPM · 281af44c
      Arthur Eubanks authored
      The NPM runs loop passes on loops in forward program order instead of
      the legacy PM's reverse program order, causing some debug output to be
      in a different order.
      281af44c
    • wlei's avatar
      [llvm-profgen][NFC] Fix test failure by making unwinder's output deterministic · eea67baf
      wlei authored
      Don't know why under Sanitizer build(asan/msan/ubsan), the `std::unordered_map<string, ...>`'s output order is reversed, make the regression test failed.
      
      This change creates a workaround by using sorted container to make the output deterministic.
      
      Reviewed By: hoy, wenlei
      
      Differential Revision: https://reviews.llvm.org/D92816
      eea67baf
    • Qiu Chaofan's avatar
      [PowerPC] Implement intrinsic for DARN instruction · 5e85a2ba
      Qiu Chaofan authored
      Instruction darn was introduced in ISA 3.0. It means 'Deliver A Random
      Number'. The immediate number L means:
      
      - L=0, the number is 32-bit (higher 32-bits are all-zero)
      - L=1, the number is 'conditioned' (processed by hardware to reduce bias)
      - L=2, the number is not conditioned, directly from noise source
      
      GCC implements them in three separate intrinsics: __builtin_darn,
      __builtin_darn_32 and __builtin_darn_raw. This patch implements the
      same intrinsics. And this change also addresses Bugzilla PR39800.
      
      Reviewed By: steven.zhang
      
      Differential Revision: https://reviews.llvm.org/D92465
      5e85a2ba
    • Arthur Eubanks's avatar
      [test] Fix Transforms/LoopVersioningLICM under NPM · f4f81031
      Arthur Eubanks authored
      There were already both legacy and new PM RUN lines.
      Also make the NPM RUN line actually match the legacy PM RUN line.
      f4f81031
    • Arthur Eubanks's avatar
      [test] Fix Transforms/LoopVectorize under NPM · dc93a8d1
      Arthur Eubanks authored
      The -enable-new-pm=1 translation caused loop-vectorize to run on all
      functions, then instcombine, rather than all passes on one function then
      the next. This caused the output of -debug-only and -print-after to be
      interleaved in an unexpected way.
      dc93a8d1
    • Arthur Eubanks's avatar
      [test] Fix store_cost.ll under NPM · a820261b
      Arthur Eubanks authored
      The NPM processes loops in forward program order, whereas the legacy PM
      processes them in reverse program order. No reason to test both PMs
      here, so just stick to the NPM.
      a820261b
    • Jonas Devlieghere's avatar
      [lldb] Include thread id in the reproducer trace (NFC) · 33e3b07a
      Jonas Devlieghere authored
      Include the current thread ID in the reproducer trace during
      capture/recording.
      33e3b07a
    • Vitaly Buka's avatar
      [NFC][MSan] Round up OffsetPtr in PoisonMembers · 6e614b0c
      Vitaly Buka authored
      getFieldOffset(layoutStartOffset)  is expected to point to the first trivial
      field or the one which follows non-trivial. So it must be byte aligned already.
      However this is not obvious without assumptions about callers.
      This patch will avoid the need in such assumptions.
      
      Depends on D92727.
      
      Differential Revision: https://reviews.llvm.org/D92728
      6e614b0c
    • Arthur Eubanks's avatar
      [test] Fix widen-iv.ll under NPM · deac8b1f
      Arthur Eubanks authored
      The -loop-flatten legacy pass preserves loop analyses. The legacy PM
      will check all passes that preserve loop analyses that they preserve
      LCSSA. This implicitly involves running -loop-simplify. The test
      shouldn't depend on verify flags being set in order to run
      -loop-simplify, so explicitly add it. The new PM ends up not running it
      otherwise.
      deac8b1f
    • Kai Luo's avatar
      [DAGCombine][PowerPC] Simplify nabs by using legal `smin` operation · 44bd8ea1
      Kai Luo authored
      Convert `0 - abs(x)` to `smin (x, -x)` if `smin` is a legal operation.
      
      Verification: https://alive2.llvm.org/ce/z/vpquFR
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D92637
      44bd8ea1
    • Esme-Yi's avatar
      [PowerPC] Correct the bit-width definition for some imm operand in td. · 49599cb1
      Esme-Yi authored
      Summary: The imm operands of some instructions are not defined accurately in td.
      This is a small patch to correct these definitions.
      
      Reviewed By: steven.zhang
      
      Differential Revision: https://reviews.llvm.org/D91603
      49599cb1
    • Richard Smith's avatar
      Fix assertion failure due to incorrect dependence bits on a DeclRefExpr · 590e1465
      Richard Smith authored
      that can only be set correctly after instantiating the initializer for a
      variable.
      590e1465
    • Fangrui Song's avatar
      [test] Rewrite split-debug.c · 29295e21
      Fangrui Song authored
      Use generic ELF target triples.
      Add missing coverage: -gsplit-dwarf=split -g -fsplit-dwarf-inlining
      Reorganize and add comments.
      Test -gno-pubnames
      29295e21
    • Arthur Eubanks's avatar
      [test] Fix LoopFusion tests under NewPM · 689b8e91
      Arthur Eubanks authored
      The legacy pass depended on -loop-simplify running. The NPM does not
      allow for a non-analysis pass to depend on another non-analysis pass.
      689b8e91
    • Jessica Paquette's avatar
      [AArch64][GlobalISel] Refactor G_BRCOND selection · d49f6491
      Jessica Paquette authored
      `selectCompareBranch` was hard to understand.
      
      Also, it was being needlessly pessimistic with the `ProduceNonFlagSettingCondBr`
      case. It assumed that everything in `selectCompareBranch` would emit a TB(N)Z
      or C(B)NZ. That's not true; the G_FCMP + G_BRCOND case would never emit those
      instructions, and the G_ICMP + G_BRCOND case was capable of emitting an integer
      compare + Bcc.
      
      - Refactor `selectCompareBranch` into separate functions based off of what is
      feeding the G_BRCOND's condition.
      
      - Move G_BRCOND selection code from `select` to `selectCompareBranch`.
      
      - Remove duplicated constraint code from the code originally in `select`;
        `emitTestBit` already handles that, so no need to constrain twice.
      
      - Factor out the G_FCMP + G_BRCOND case into `selectCompareBranchFedByFCmp`.
      
      - Split the G_ICMP + G_BRCOND case into an optimization function,
      `tryOptCompareBranchFedByICmp` and a general selection function,
      `selectCompareBranchFedByICmp`.
      
      - Reduce the number of things passed to `tryOptAndIntoCompareBranch`.
      
      - Improve documentation.
      
      - Give some variables more descriptive names.
      
      Other than improving the code generation for functions with
      speculative_load_hardening by getting the logic correct, this is NFC.
      
      Differential Revision: https://reviews.llvm.org/D92582
      d49f6491
    • Valentin Churavy's avatar
      [VNCoercion] Disallow coercion between different ni addrspaces · 700cf7dc
      Valentin Churavy authored
      
      
      I'm not sure if it would be legal by the IR reference to introduce
      an addrspacecast here, since the IR reference is a bit vague on
      the exact semantics, but at least for our usage of it (and I
      suspect for many other's usage) it is not. For us, addrspacecasts
      between non-integral address spaces carry frontend information that the
      optimizer cannot deduce afterwards in a generic way (though we
      have frontend specific passes in our pipline that do propagate
      these). In any case, I'm sure nobody is using it this way at
      the moment, since it would have introduced inttoptrs, which
      are definitely illegal.
      
      Fixes PR38375
      
      Co-authored-by: default avatarKeno Fischer <keno@alumni.harvard.edu>
      
      Reviewed By: reames
      
      Differential Revision: https://reviews.llvm.org/D50010
      700cf7dc
    • Yaxun (Sam) Liu's avatar
      Fix lit test failure due to 0b81d9 · efc063b6
      Yaxun (Sam) Liu authored
      These lit tests now requires amdgpu-registered-target since they
      use clang driver and clang driver passes an LLVM option which
      is available only if amdgpu target is registered.
      
      Change-Id: I2df31967409f1627fc6d342d1ab5cc8aa17c9c0c
      efc063b6
    • Douglas Yung's avatar
      Fixup test in path to use C:\ instead of D:\ which may be mapped to a removable. · ccc5160d
      Douglas Yung authored
      Our internal build bot hit a failure in llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test
      because the test was checking for an error message that is emitted when a pdb file is
      missing. But when the drive is mapped to a removalable drive (such as a DVD drive) in
      Windows, you get a different error message which causes the test to fail.
      
      This fixes the test by changing the drive the missing pdb is expected to be on to C:\
      instead of D:\ as that is the drive historically used to install Windows and thus
      if present should be a hard drive.
      
      Reviewed By: rnk
      
      Differential Revision: https://reviews.llvm.org/D92787
      ccc5160d
    • Richard Smith's avatar
      Fix deserialization cycle in preferred_name attribute. · a64c26a4
      Richard Smith authored
      This is really just a workaround for a more fundamental issue in the way
      we deserialize attributes. See PR48434 for details.
      
      Also fix tablegen code generator to produce more correct indentation to
      resolve buildbot issues with -Werror=misleading-indentation firing
      inside the generated code.
      a64c26a4
    • Yaxun (Sam) Liu's avatar
      [AMDGPU] add -mcode-object-version=n · 0b81d9a9
      Yaxun (Sam) Liu authored
      Add option -mcode-object-version=n to control code object version for
      AMDGPU.
      
      Differential Revision: https://reviews.llvm.org/D91310
      0b81d9a9
    • Yaxun (Sam) Liu's avatar
      [clang][AMDGPU] remove mxnack and msramecc options · 5cae7080
      Yaxun (Sam) Liu authored
      Remove mxnack and msramecc options since they
      are deprecated by --offload-arch.
      
      This is part of https://reviews.llvm.org/D60620
      5cae7080
    • Yaxun (Sam) Liu's avatar
      [HIP] fix bundle entry ID for -- · 4bed1d9b
      Yaxun (Sam) Liu authored
      Canonicalize triple used in fat binary. Change from
      amdgcn-amd-amdhsa to amdgcn-amd-amdhsa-.
      
      This is part of https://reviews.llvm.org/D60620
      4bed1d9b
    • Mehdi Amini's avatar
      Add Python binding for MLIR Type Attribute · e56f398d
      Mehdi Amini authored
      Differential Revision: https://reviews.llvm.org/D92711
      e56f398d
    • Mehdi Amini's avatar
      Customize exception thrown from mlir.Operation.create() python bindings · e15ae454
      Mehdi Amini authored
      The default exception handling isn't very user friendly and does not
      point accurately to the issue. Instead we can indicate which of the
      operands isn't valid and provide contextual information in the error
      message.
      
      Differential Revision: https://reviews.llvm.org/D92710
      e15ae454
    • Yaxun (Sam) Liu's avatar
      [clang][AMDGPU] rename sram-ecc as sramecc · 40ad476a
      Yaxun (Sam) Liu authored
      As backend renamed sram-ecc to sramecc, this patch makes
      corresponding change in clang.
      
      Differential Revision: https://reviews.llvm.org/D86217
      40ad476a
    • Jessica Paquette's avatar
      [AArch64][GlobalISel] Narrow 128-bit regs to 64-bit regs in emitTestBit · 195a7af0
      Jessica Paquette authored
      When we have a 128-bit register, emitTestBit would incorrectly narrow to 32
      bits always. If the bit number was > 32, then we would need a TB(N)ZX. This
      would cause a crash, as we'd have the wrong register class. (PR48379)
      
      This generalizes `narrowExtReg` into `moveScalarRegClass`.
      
      This also allows us to remove `widenGPRBankRegIfNeeded` entirely, since
      `selectCopy` correctly handles SUBREG_TO_REG etc.
      
      This does create some codegen changes (since `selectCopy` uses the `all`
      regclass variants). However, I think that these will likely be optimized away,
      and we can always improve the `selectCopy` code. It looks like we should
      revisit `selectCopy` at this point, and possibly refactor it into at least one
      `emit` function.
      
      Differential Revision: https://reviews.llvm.org/D92707
      195a7af0
    • Philip Reames's avatar
      Teach isKnownNonEqual how to recurse through invertible multiplies · 26568853
      Philip Reames authored
      Build on the work started in 8f076291, and add the multiply case. In the process, more clearly describe the requirement for the operation we're looking through.
      
      Differential Revision: https://reviews.llvm.org/D92726
      26568853
    • Jann Horn's avatar
      [clang] Fix noderef for AddrOf on MemberExpr · 6dad7ec5
      Jann Horn authored
      Committing on behalf of thejh (Jann Horn).
      
      As part of this change, one existing test case has to be adjusted
      because it accidentally stripped the NoDeref attribute without
      getting caught.
      
      Depends on D92140
      
      Differential Review: https://reviews.llvm.org/D92141
      6dad7ec5
    • peter klausler's avatar
      [flang] Improve initializer semantics, esp. for component default values · 641ede93
      peter klausler authored
      This patch plugs many holes in static initializer semantics, improves error
      messages for default initial values and other component properties in
      parameterized derived type instantiations, and cleans up several small
      issues noticed during development.  We now do proper scalar expansion,
      folding, and type, rank, and shape conformance checking for component
      default initializers in derived types and PDT instantiations.
      The initial values of named constants are now guaranteed to have been folded
      when installed in the symbol table, and are no longer folded or
      scalar-expanded at each use in expression folding.  Semantics documentation
      was extended with information about the various kinds of initializations
      in Fortran and when each of them are processed in the compiler.
      
      Some necessary concomitant changes have bulked this patch out a bit:
      * contextual messages attachments, which are now produced for parameterized
        derived type instantiations so that the user can figure out which
        instance caused a problem with a component, have been added as part
        of ContextualMessages, and their implementation was debugged
      * several APIs in evaluate::characteristics was changed so that a FoldingContext
        is passed as an argument rather than just its intrinsic procedure table;
        this affected client call sites in many files
      * new tools in Evaluate/check-expression.cpp to determine when an Expr
        actually is a single constant value and to validate a non-pointer
        variable initializer or object component default value
      * shape conformance checking has additional arguments that control
        whether scalar expansion is allowed
      * several now-unused functions and data members noticed and removed
      * several crashes and bogus errors exposed by testing this new code
        were fixed
      * a -fdebug-stack-trace option to enable LLVM's stack tracing on
        a crash, which might be useful in the future
      
      TL;DR: Initialization processing does more and takes place at the right
      times for all of the various kinds of things that can be initialized.
      
      Differential Review: https://reviews.llvm.org/D92783
      641ede93
    • Leonard Chan's avatar
      [clang] Fix noderef for array member of deref expr · 155fca3c
      Leonard Chan authored
          Committing on behalf of thejh (Jann Horn).
      
          Given an attribute((noderef)) pointer "p" to the struct
      
          struct s { int a[2]; };
          ensure that the following expressions are treated the same way by the
          noderef logic:
      
          p->a
          (*p).a
          Until now, the first expression would be treated correctly (nothing is
          added to PossibleDerefs because CheckMemberAccessOfNoDeref() bails out
          on array members), but the second expression would incorrectly warn
          because "*p" creates a PossibleDerefs entry.
      
          Handle this case the same way as for the AddrOf operator.
      
          Differential Revision: https://reviews.llvm.org/D92140
      155fca3c
    • Mitch Phillips's avatar
      Revert "[test] Fix asan/TestCases/Linux/globals-gc-sections-lld.cpp with... · 1d03a54d
      Mitch Phillips authored
      Revert "[test] Fix asan/TestCases/Linux/globals-gc-sections-lld.cpp with -fsanitize-address-globals-dead-stripping"
      
      This reverts commit 14080876.
      
      Reason: Broke the upstream bots - discussed offline.
      1d03a54d
    • Erik Pilkington's avatar
      [clang] Add support for attribute 'swift_async' · 5a28e1d9
      Erik Pilkington authored
      This attributes specifies how (or if) a given function or method will be
      imported into a swift async method. rdar://70111252
      
      Differential revision: https://reviews.llvm.org/D92742
      5a28e1d9