radeon/llvm: Use amdgcn triple for SI+ on LLVM >= 3.6
[mesa.git] / src / gallium / drivers / radeon / r600_pipe_common.c
index d4133d8cbad259514911281c55fe62ad86c277ab..d46b3b38f8685a5638436ca6b1f54fa816f30b66 100644 (file)
@@ -499,6 +499,12 @@ static int r600_get_compute_param(struct pipe_screen *screen,
        switch (param) {
        case PIPE_COMPUTE_CAP_IR_TARGET: {
                const char *gpu;
+               const char *triple;
+               if (rscreen->family <= CHIP_ARUBA || HAVE_LLVM < 0x0306) {
+                       triple = "r600--";
+               } else {
+                       triple = "amdgcn--";
+               }
                switch(rscreen->family) {
                /* Clang < 3.6 is missing Hainan in its list of
                 * GPUs, so we need to use the name of a similar GPU.
@@ -513,9 +519,10 @@ static int r600_get_compute_param(struct pipe_screen *screen,
                        break;
                }
                if (ret) {
-                       sprintf(ret, "%s-r600--", gpu);
+                       sprintf(ret, "%s-%s", gpu, triple);
+
                }
-               return (8 + strlen(gpu)) * sizeof(char);
+               return (strlen(triple) + strlen(gpu)) * sizeof(char);
        }
        case PIPE_COMPUTE_CAP_GRID_DIMENSION:
                if (ret) {