Skip to content
  1. Mar 25, 2019
  2. Mar 20, 2019
    • Andrew Savonichev's avatar
      [OpenCL] Generate 'unroll.enable' metadata for __attribute__((opencl_unroll_hint)) · 76b178d9
      Andrew Savonichev authored
      Summary:
      [OpenCL] Generate 'unroll.enable' metadata for  __attribute__((opencl_unroll_hint))
          
      For both !{!"llvm.loop.unroll.enable"} and !{!"llvm.loop.unroll.full"} the unroller
      will try to fully unroll a loop unless the trip count is not known at compile time.
      In that case for '.full' metadata no unrolling will be processed, while for '.enable'
      the loop will be partially unrolled with a heuristically chosen unroll factor.
          
      See: docs/LanguageExtensions.rst
          
      From https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/attributes-loopUnroll.html
      
          __attribute__((opencl_unroll_hint))
          for (int i=0; i<2; i++)
          {
              ...
          }
          
      In the example above, the compiler will determine how much to unroll the loop.
      
          
      Before the patch for  __attribute__((opencl_unroll_hint)) was generated metadata
      !{!"llvm.loop.unroll.full"}, which limits ability of loop unroller to decide, how
      much to unroll the loop.
      
      Reviewers: Anastasia, yaxunl
      
      Reviewed By: Anastasia
      
      Subscribers: zzheng, dmgreen, jdoerfert, cfe-commits, asavonic, AlexeySotkin
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59493
      
      llvm-svn: 356571
      76b178d9
  3. Mar 18, 2019
  4. Mar 06, 2019
  5. Feb 26, 2019
    • Yaxun Liu's avatar
      [OpenCL] Fix assertion due to blocks · d83c7402
      Yaxun Liu authored
      A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called.
      
      There is code
      
        Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee());
      getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle
      BlockExpr and returns nullptr, which causes isa to assert.
      
      This patch fixes that.
      
      Differential Revision: https://reviews.llvm.org/D58658
      
      llvm-svn: 354893
      d83c7402
  6. Feb 21, 2019
  7. Feb 19, 2019
    • Alexey Bader's avatar
      [OpenCL] Change type of block pointer for OpenCL · 24fa0c18
      Alexey Bader authored
      Summary:
      
      For some reason OpenCL blocks in LLVM IR are represented as function pointers.
      These pointers do not point to any real function and never get called. Actually
      they point to some structure, which in turn contains pointer to the real block
      invoke function.
      This patch changes represntation of OpenCL blocks in LLVM IR from function
      pointers to pointers to `%struct.__block_literal_generic`.
      Such representation allows to avoid unnecessary bitcasts and simplifies
      further processing (e.g. translation to SPIR-V ) of the module for targets
      which do not support function pointers.
      
      Patch by: Alexey Sotkin.
      
      Reviewers: Anastasia, yaxunl, svenvh
      
      Reviewed By: Anastasia
      
      Subscribers: alexbatashev, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D58277
      
      llvm-svn: 354337
      24fa0c18
  8. Feb 15, 2019
  9. Feb 12, 2019
  10. Feb 09, 2019
  11. Feb 08, 2019
    • James Y Knight's avatar
      [opaque pointer types] Cleanup CGBuilder's Create*GEP. · f5f1b0e5
      James Y Knight authored
      Some of these functions take some extraneous arguments, e.g. EltSize,
      Offset, which are computable from the Type and DataLayout.
      
      Add some asserts to ensure that the computed values are consistent
      with the passed-in values, in preparation for eliminating the
      extraneous arguments. This also asserts that the Type is an Array for
      the calls named "Array" and a Struct for the calls named "Struct".
      
      Then, correct a couple of errors:
      
      1. Using CreateStructGEP on an array type. (this causes the majority
         of the test differences, as struct GEPs are created with i32
         indices, while array GEPs are created with i64 indices)
      
      2. Passing the wrong Offset to CreateStructGEP in TargetInfo.cpp on
         x86-64 NACL (which uses 32-bit pointers).
      
      Differential Revision: https://reviews.llvm.org/D57766
      
      llvm-svn: 353529
      f5f1b0e5
  12. Jan 31, 2019
  13. Jan 29, 2019
  14. Jan 28, 2019
  15. Jan 10, 2019
  16. 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
  17. 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
  18. Dec 01, 2018
  19. 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
  20. 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
  21. Nov 14, 2018
  22. Nov 08, 2018
  23. 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
  24. 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
  25. Oct 17, 2018
  26. Oct 02, 2018
  27. Aug 10, 2018
  28. Aug 08, 2018
  29. Aug 07, 2018
  30. Aug 03, 2018
  31. Aug 02, 2018
Loading