1. Oct 18, 2021
  2. Oct 17, 2021
    • Nikita Popov's avatar
      [ConstantRange] Add fast signed multiply · 274b2439
      Nikita Popov authored
      The multiply() implementation is very slow -- it performs six
      multiplications in double the bitwidth, which means that it will
      typically work on allocated APInts and bypass fast-path
      implementations. Add an additional implementation that doesn't
      try to produce anything better than a full range if overflow is
      possible. At least for the BasicAA use-case, we really don't care
      about more precise modeling of overflow behavior. The current
      use of multiply() is fine while the implementation is limited to
      a single index, but extending it to the multiple-index case makes
      the compile-time impact untenable.
      274b2439
    • Roman Lebedev's avatar
      [X86][Costmodel] Load/store i64 Stride=4 VF=16 interleaving costs · 91373bf1
      Roman Lebedev authored
      A few more tuples are being queried after D111546. Might be good to model them,
      They all require a lot of manual assembly surgery.
      
      The only sched models that for cpu's that support avx2
      but not avx512 are: haswell, broadwell, skylake, zen1-3
      
      For load we have:
      https://godbolt.org/z/9bnKrefcG - for intels `Block RThroughput: =40.0`; for ryzens, `Block RThroughput: =16.0`
      So could pick cost of `40`
      
      For store we have:
      https://godbolt.org/z/5s3s14dEY - for intels `Block RThroughput: =40.0`; for ryzens, `Block RThroughput: =16.0`
      So we could pick cost of `40`.
      
      I'm directly using the shuffling asm the llc produced,
      without any manual fixups that may be needed
      to ensure sequential execution.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D111945
      91373bf1
    • Roman Lebedev's avatar
      [X86][Costmodel] Load/store i64 Stride=2 VF=32 interleaving costs · 3274ce3a
      Roman Lebedev authored
      A few more tuples are being queried after D111546. Might be good to model them,
      They all require a lot of manual assembly surgery.
      
      The only sched models that for cpu's that support avx2
      but not avx512 are: haswell, broadwell, skylake, zen1-3
      
      For load we have:
      https://godbolt.org/z/MTaKboejM - for intels `Block RThroughput: =32.0`; for ryzens, `Block RThroughput: <=16.0`
      So could pick cost of `32`
      
      For store we have:
      https://godbolt.org/z/v7xPj3Wd4 - for intels `Block RThroughput: =32.0`; for ryzens, `Block RThroughput: <=32.0`
      So we could pick cost of `32`.
      
      I'm directly using the shuffling asm the llc produced,
      without any manual fixups that may be needed
      to ensure sequential execution.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D111944
      3274ce3a
    • Roman Lebedev's avatar
      [X86][Costmodel] Load/store i32 Stride=4 VF=32 interleaving costs · 3a6a9f74
      Roman Lebedev authored
      A few more tuples are being queried after D111546. Might be good to model them,
      They all require a lot of manual assembly surgery.
      
      The only sched models that for cpu's that support avx2
      but not avx512 are: haswell, broadwell, skylake, zen1-3
      
      For load we have:
      https://godbolt.org/z/11rcvdreP - for intels `Block RThroughput: <=68.0`; for ryzens, `Block RThroughput: <=48.0`
      So could pick cost of `68`
      
      For store we have:
      https://godbolt.org/z/6aM11fWcP - for intels `Block RThroughput: <=64.0`; for ryzens, `Block RThroughput: <=32.0`
      So we could pick cost of `64`.
      
      I'm directly using the shuffling asm the llc produced,
      without any manual fixups that may be needed
      to ensure sequential execution.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D111943
      3a6a9f74
    • Roman Lebedev's avatar
      [X86][Costmodel] Load/store i32 Stride=3 VF=32 interleaving costs · 4b76a74b
      Roman Lebedev authored
      A few more tuples are being queried after D111546. Might be good to model them,
      They all require a lot of manual assembly surgery.
      
      The only sched models that for cpu's that support avx2
      but not avx512 are: haswell, broadwell, skylake, zen1-3
      
      For load we have:
      https://godbolt.org/z/s5b6E6jsP - for intels `Block RThroughput: <=32.0`; for ryzens, `Block RThroughput: <=24.0`
      So could pick cost of `32`
      
      For store we have:
      https://godbolt.org/z/efh99d93b - for intels `Block RThroughput: <=48.0`; for ryzens, `Block RThroughput: <=32.0`
      So we could pick cost of `48`.
      
      I'm directly using the shuffling asm the llc produced,
      without any manual fixups that may be needed
      to ensure sequential execution.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D111942
      4b76a74b
    • Roman Lebedev's avatar
      [X86][Costmodel] Load/store i16 Stride=6 VF=32 interleaving costs · 887acf68
      Roman Lebedev authored
      A few more tuples are being queried after D111546. Might be good to model them,
      They all require a lot of manual assembly surgery.
      
      The only sched models that for cpu's that support avx2
      but not avx512 are: haswell, broadwell, skylake, zen1-3
      
      For load we have:
      https://godbolt.org/z/YTeT9M7fW - for intels `Block RThroughput: <=212.0`; for ryzens, `Block RThroughput: <=64.0`
      So could pick cost of `212`
      
      For store we have:
      https://godbolt.org/z/vc954KEGP - for intels `Block RThroughput: <=90.0`; for ryzens, `Block RThroughput: <=24.0`
      So we could pick cost of `90`.
      
      I'm directly using the shuffling asm the llc produced,
      without any manual fixups that may be needed
      to ensure sequential execution.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D111940
      887acf68
    • PeixinQiao's avatar
      This patch supports the following checks for THREADPRIVATE Directive: · dd8c8d4b
      PeixinQiao authored
      ```
      [5.1] 2.21.2 THREADPRIVATE Directive
      A variable that appears in a threadprivate directive must be declared in
      the scope of a module or have the SAVE attribute, either explicitly or
      implicitly.
      A variable that appears in a threadprivate directive must not be an
      element of a common block or appear in an EQUIVALENCE statement.
      ```
      
      This patch supports the following checks for DECLARE TARGET Directive:
      ```
      [5.1] 2.14.7 Declare Target Directive
      A variable that is part of another variable (as an array, structure
      element or type parameter inquiry) cannot appear in a declare
      target directive.
      A variable that appears in a declare target directive must be declared
      in the scope of a module or have the SAVE attribute, either explicitly
      or implicitly.
      A variable that appears in a declare target directive must not be an
      element of a common block or appear in an EQUIVALENCE statement.
      ```
      
      As Fortran 2018 standard [8.5.16] states, a variable, common block, or
      procedure pointer declared in the scoping unit of a main program,
      module, or submodule implicitly has the SAVE attribute, which may be
      confirmed by explicit specification.
      
      Reviewed By: kiranchandramohan
      
      Differential Revision: https://reviews.llvm.org/D109864
      dd8c8d4b
    • Aaron Ballman's avatar
      Bump the value of __STDC_VERSION__ in -std=c2x mode · c8be7743
      Aaron Ballman authored
      Previously, we reported the same value as for C17, now we report 202000L, which
      is the same value currently used by GCC.
      
      Once C23 ships, this value will be bumped to the correct date.
      c8be7743
    • David Green's avatar