ci: enable piglit testing of clover/llvmpipe.

This adds support for building clover/llvmpipe and running the
piglit CL tests on it.

It uses the gl testing container, and add builds the libclc
spirv libraries as part of that which requires the llvm spirv
translator in the build container.

It also builds the llvm spirv translator as part of the build
root and creates a mesa build that builds clover for testing
against it. It uses llvm 10 as the baseline.

This drops bswap as it has an oob memory access with llvmpipe
which cause flaky test results. phatk also seems flaky

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6901>
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 443ced1..ecc5d46 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -258,7 +258,7 @@
   extends:
     - .use-x86_build-base
   variables:
-    FDO_DISTRIBUTION_TAG: &x86_build "2020-10-06-clang10-2"
+    FDO_DISTRIBUTION_TAG: &x86_build "2020-10-06-clang10-cl3"
 
 .use-x86_build:
   variables:
@@ -330,7 +330,7 @@
 x86_test-gl:
   extends: .use-x86_test-base
   variables:
-    FDO_DISTRIBUTION_TAG: &x86_test-gl "2020-10-06-clang10-2"
+    FDO_DISTRIBUTION_TAG: &x86_test-gl "2020-10-06-clang10-cl3"
 
 # Debian 10 based x86 test image for VK
 x86_test-vk:
@@ -566,6 +566,26 @@
     - .gitlab-ci/meson-build.sh
     - .gitlab-ci/prepare-artifacts.sh
 
+meson-clover-testing:
+  extends:
+    - .meson-build
+    - .ci-deqp-artifacts
+  variables:
+    UNWIND: "enabled"
+    LLVM_VERSION: 10
+    DRI_LOADERS: >
+      -D glx=disabled
+      -D egl=disabled
+      -D gbm=disabled
+    GALLIUM_ST: >
+      -D gallium-opencl=icd
+      -D opencl-spirv=true
+    GALLIUM_DRIVERS: "swrast"
+    BUILDTYPE: "debugoptimized"
+  script:
+    - .gitlab-ci/meson-build.sh
+    - .gitlab-ci/prepare-artifacts.sh
+
 meson-gallium:
   extends: .meson-build
   variables:
@@ -881,16 +901,22 @@
     paths:
       - results/
 
-.test-gl:
+.use-x86_test-gl:
   extends:
     - .test
   variables:
     TAG: *x86_test-gl
   image: "$CI_REGISTRY_IMAGE/debian/x86_test-gl:$TAG"
   needs:
-    - meson-testing
     - x86_test-gl
 
+.test-gl:
+  extends:
+    - .use-x86_test-gl
+  needs:
+    - x86_test-gl
+    - meson-testing
+
 .test-vk:
   extends:
     - .test
@@ -901,6 +927,13 @@
     - meson-testing
     - x86_test-vk
 
+.test-cl:
+  extends:
+    - .use-x86_test-gl
+  needs:
+    - x86_test-gl
+    - meson-clover-testing
+
 .piglit-test:
   extends:
     - .test-gl
@@ -916,6 +949,19 @@
   script:
     - install/piglit/run.sh
 
+piglit-cl:
+  extends:
+    - .piglit-test
+    - .test-cl
+  variables:
+    LP_CL: 1
+    LP_NUM_THREADS: 1
+    PIGLIT_PROFILES: cl
+    PIGLIT_OPTIONS: >
+      -x bswap -x phatk
+  script:
+    - install/piglit/run_cl.sh
+
 piglit-quick_gl:
   extends: .piglit-test
   variables: