Skip to content
  1. Jan 10, 2019
  2. Jan 08, 2019
    • Erich Keane's avatar
      Fix opencl test broken on windows by r350643. · e8abbeca
      Erich Keane authored
      Windows doesn't allow common with alignment >32 bits, so these tests
      were broken in windows mode.  This patch makes 'common' optional in
      these cases.
      
      Change-Id: I4d5fdd07ecdafc3570ef9b09cd816c2e5e4ed15e
      llvm-svn: 350645
      e8abbeca
  3. Dec 10, 2018
    • Andrew Savonichev's avatar
      [OpenCL][CodeGen] Fix replacing memcpy with addrspacecast · 1bf1a156
      Andrew Savonichev authored
      Summary:
      If a function argument is byval and RV is located in default or alloca address space
      an optimization of creating addrspacecast instead of memcpy is performed. That is
      not correct for OpenCL, where that can lead to a situation of address space casting
      from __private * to __global *. See an example below:
      
      ```
      typedef struct {
        int x;
      } MyStruct;
      
      void foo(MyStruct val) {}
      
      kernel void KernelOneMember(__global MyStruct* x) {
        foo (*x);
      }
      ```
      
      for this code clang generated following IR:
      ...
      %0 = load %struct.MyStruct addrspace(1)*, %struct.MyStruct addrspace(1)**
      %x.addr, align 4
      %1 = addrspacecast %struct.MyStruct addrspace(1)* %0 to %struct.MyStruct*
      ...
      
      So the optimization was disallowed for OpenCL if RV is located in an address space
      different than that of the argument (0).
      
      
      Reviewers: yaxunl, Anastasia
      
      Reviewed By: Anastasia
      
      Subscribers: cfe-commits, asavonic
      
      Differential Revision: https://reviews.llvm.org/D54947
      
      llvm-svn: 348752
      1bf1a156
  4. Dec 01, 2018
  5. Nov 27, 2018
    • Marco Antognini's avatar
      Derive builtin return type from its definition · 06d9d070
      Marco Antognini authored
      Summary:
      Prior to this patch, OpenCL code such as the following would attempt to create
      a BranchInst with a non-bool argument:
      
          if (enqueue_kernel(get_default_queue(), 0, nd, ^(void){})) /* ... */
      
      This patch is a follow up on a similar issue with pipe builtin
      operations. See commit r280800 and https://bugs.llvm.org/show_bug.cgi?id=30219.
      
      This change, while being conservative on non-builtin functions,
      should set the type of expressions invoking builtins to the
      proper type, instead of defaulting to `bool` and requiring
      manual overrides in Sema::CheckBuiltinFunctionCall.
      
      In addition to tests for enqueue_kernel, the tests are extended to
      check other OpenCL builtins.
      
      Reviewers: Anastasia, spatel, rsmith
      
      Reviewed By: Anastasia
      
      Subscribers: kristina, cfe-commits, svenvh
      
      Differential Revision: https://reviews.llvm.org/D52879
      
      llvm-svn: 347658
      06d9d070
  6. Nov 15, 2018
    • JF Bastien's avatar
      CGDecl::emitStoresForConstant fix synthesized constant's name · 3a881e6b
      JF Bastien authored
      Summary: The name of the synthesized constants for constant initialization was using mangling for statics, which isn't generally correct and (in a yet-uncommitted patch) causes the mangler to assert out because the static ends up trying to mangle function parameters and this makes no sense. Instead, mangle to `"__const." + FunctionName + "." + DeclName`.
      
      Reviewers: rjmccall
      
      Subscribers: dexonsmith, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54055
      
      llvm-svn: 346915
      3a881e6b
  7. Nov 14, 2018
  8. Nov 08, 2018
  9. Nov 07, 2018
    • Andrew Savonichev's avatar
      Revert r346326 [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation · 3b12b7e7
      Andrew Savonichev authored
      This patch breaks Index/opencl-types.cl LIT test:
      
      Script:
      --
      : 'RUN: at line 1';   stage1/bin/c-index-test -test-print-type llvm/tools/clang/test/Index/opencl-types.cl -cl-std=CL2.0 | stage1/bin/FileCheck llvm/tools/clang/test/Index/opencl-types.cl
      --
      Command Output (stderr):
      --
      llvm/tools/clang/test/Index/opencl-types.cl:3:26: warning: unsupported OpenCL extension 'cl_khr_fp16' - ignoring [-Wignored-pragmas]
      llvm/tools/clang/test/Index/opencl-types.cl:4:26: warning: unsupported OpenCL extension 'cl_khr_fp64' - ignoring [-Wignored-pragmas]
      llvm/tools/clang/test/Index/opencl-types.cl:8:9: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
      llvm/tools/clang/test/Index/opencl-types.cl:11:8: error: declaring variable of type 'half' is not allowed
      llvm/tools/clang/test/Index/opencl-types.cl:15:3: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
      llvm/tools/clang/test/Index/opencl-types.cl:16:3: error: use of type 'double4' (vector of 4 'double' values) requires cl_khr_fp64 extension to be enabled
      llvm/tools/clang/test/Index/opencl-types.cl:26:26: warning: unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring [-Wignored-pragmas]
      llvm/tools/clang/test/Index/opencl-types.cl:35:44: error: use of type '__read_only image2d_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled
      llvm/tools/clang/test/Index/opencl-types.cl:36:49: error: use of type '__read_only image2d_array_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled
      llvm/tools/clang/test/Index/opencl-types.cl:37:49: error: use of type '__read_only image2d_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled
      llvm/tools/clang/test/Index/opencl-types.cl:38:54: error: use of type '__read_only image2d_array_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled
      
      llvm-svn: 346338
      3b12b7e7
    • Andrew Savonichev's avatar
      [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension · 35dfce72
      Andrew Savonichev authored
      Summary:
      Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt
      
      Patch by Kristina Bessonova
      
      
      Reviewers: Anastasia, yaxunl, shafik
      
      Reviewed By: Anastasia
      
      Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51484
      
      llvm-svn: 346326
      35dfce72
  10. Oct 24, 2018
    • Craig Topper's avatar
      [CodeGen] Update min-legal-vector width based on function argument and return types · 3113ec3d
      Craig Topper authored
      This is a continuation of my patches to inform the X86 backend about what the largest IR types are in the function so that we can restrict the backend type legalizer to prevent 512-bit vectors on SKX when -mprefer-vector-width=256 is specified if no explicit 512 bit vectors were specified by the user.
      
      This patch updates the vector width based on the argument and return types of the current function and from the types of any functions it calls. This is intended to make sure the backend type legalizer doesn't disturb any types that are required for ABI.
      
      Differential Revision: https://reviews.llvm.org/D52441
      
      llvm-svn: 345168
      3113ec3d
  11. Oct 17, 2018
  12. Oct 02, 2018
  13. Aug 10, 2018
  14. Aug 08, 2018
  15. Aug 07, 2018
  16. Aug 03, 2018
  17. Aug 02, 2018
    • Matt Arsenault's avatar
      AMDGPU: Fix missing declaration of queue ptr builtin · e3d81572
      Matt Arsenault authored
      llvm-svn: 338754
      e3d81572
    • Matt Arsenault's avatar
      Try to make builtin address space declarations not useless · c65f966d
      Matt Arsenault authored
      The way address space declarations for builtins currently work
      is nearly useless. The code assumes the address spaces used for
      builtins is a confusingly named "target address space" from user
      code using __attribute__((address_space(N))) that matches
      the builtin declaration. There's no way to use this to declare
      a builtin that returns a language specific address space.
      The terminology used is highly cofusing since it has nothing
      to do with the the address space selected by the target to use
      for a language address space.
      
      This feature is essentially unused as-is. AMDGPU and NVPTX
      are the only in-tree targets attempting to use this. The AMDGPU
      builtins certainly do not behave as intended (i.e. all of the
      builtins returning pointers can never compile because the numbered
      address space never matches the expected named address space).
      
      The NVPTX builtins are missing tests for some, and the others
      seem to rely on an implicit addrspacecast.
      
      Change the used address space for builtins based on a target
      hook to allow using a language address space for a builtin.
      This allows the same builtin declaration to be used for multiple
      languages with similarly purposed address spaces (e.g. the same
      AMDGPU builtin can be used in OpenCL and CUDA even though the
      constant address spaces are arbitarily different).
      
      This breaks the possibility of using arbitrary numbered
      address spaces alongside the named address spaces for builtins.
      If this is an issue we probably need to introduce another builtin
      declaration character to distinguish language address spaces from
      so-called "target address spaces".
      
      llvm-svn: 338707
      c65f966d
  18. Aug 01, 2018
  19. Jul 30, 2018
  20. Jul 13, 2018
  21. May 21, 2018
    • Daniil Fukalov's avatar
      [AMDGPU] fixes for lds f32 builtins · 1b14a3ad
      Daniil Fukalov authored
      1. added restrictions to memory scope, order and volatile parameters
      2. added custom processing for these builtins - currently is not used code,
         needed to switch off GCCBuiltin link to the builtins (ongoing change to llvm
         tree)
      3. builtins renamed as requested
      
      Differential Revision: https://reviews.llvm.org/D43281
      
      llvm-svn: 332848
      1b14a3ad
  22. May 16, 2018
    • Sanjay Patel's avatar
      [OpenCL] make test independent of optimizer · cda77b30
      Sanjay Patel authored
      There shouldn't be any tests that run the entire optimizer here,
      but the last test in this file is definitely going to break with 
      a change in LLVM IR canonicalization. Change that part to check
      the unoptimized IR because that's the real intent of this file.
      
      llvm-svn: 332473
      cda77b30
  23. May 09, 2018
  24. May 01, 2018
  25. Apr 30, 2018
  26. Apr 27, 2018
    • Sven van Haastregt's avatar
      [OpenCL] Add separate read_only and write_only pipe IR types · 4700faa2
      Sven van Haastregt authored
      SPIR-V encodes the read_only and write_only access qualifiers of pipes,
      so separate LLVM IR types are required to target SPIR-V.  Other backends
      may also find this useful.
      
      These new types are `opencl.pipe_ro_t` and `opencl.pipe_wo_t`, which
      replace `opencl.pipe_t`.
      
      This replaces __get_pipe_num_packets(...) and __get_pipe_max_packets(...)
      which took a read_only pipe with separate versions for read_only and
      write_only pipes, namely:
      
       * __get_pipe_num_packets_ro(...)
       * __get_pipe_num_packets_wo(...)
       * __get_pipe_max_packets_ro(...)
       * __get_pipe_max_packets_wo(...)
      
      These separate versions exist to avoid needing a bitcast to one of the
      two qualified pipe types.
      
      Patch by Stuart Brady.
      
      Differential Revision: https://reviews.llvm.org/D46015
      
      llvm-svn: 331026
      4700faa2
  27. Apr 20, 2018
  28. Apr 06, 2018
    • Alexander Kornienko's avatar
      Fix typos in clang · 2a8c18d9
      Alexander Kornienko authored
      Found via codespell -q 3 -I ../clang-whitelist.txt
      Where whitelist consists of:
      
        archtype
        cas
        classs
        checkk
        compres
        definit
        frome
        iff
        inteval
        ith
        lod
        methode
        nd
        optin
        ot
        pres
        statics
        te
        thru
      
      Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few
      files that have dubious fixes reverted.)
      
      Differential revision: https://reviews.llvm.org/D44188
      
      llvm-svn: 329399
      2a8c18d9
  29. Mar 27, 2018
Loading