tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
rocmPackages.llvm.mlir: fix upstream bug
Madoura
2 years ago
56f1d971
ab01e7cd
+54
-19
3 changed files
expand all
collapse all
unified
split
pkgs
development
rocm-modules
5
llvm
stage-3
0000-mlir-fix-debugtranslation.patch
1001-mlir-failing-tests.list
mlir.nix
+36
pkgs/development/rocm-modules/5/llvm/stage-3/0000-mlir-fix-debugtranslation.patch
···
1
1
+
From f1d1e10ec7e1061bf0b90abbc1e298d9438a5e74 Mon Sep 17 00:00:00 2001
2
2
+
From: Scott Linder <Scott.Linder@amd.com>
3
3
+
Date: Mon, 11 Sep 2023 18:37:37 +0000
4
4
+
Subject: [PATCH] [HeterogeneousDWARF] Update MLIR DI Metadata handling
5
5
+
6
6
+
Pass a default DW_MSPACE_LLVM_none to satisfy new API
7
7
+
8
8
+
Change-Id: I50df461f00b5510a715f55f61107122318102d22
9
9
+
---
10
10
+
lib/Target/LLVMIR/DebugTranslation.cpp | 6 ++++--
11
11
+
1 file changed, 4 insertions(+), 2 deletions(-)
12
12
+
13
13
+
diff --git a/lib/Target/LLVMIR/DebugTranslation.cpp b/lib/Target/LLVMIR/DebugTranslation.cpp
14
14
+
index 2053f5bcef06aa6..635ee5d7e5fefdc 100644
15
15
+
--- a/lib/Target/LLVMIR/DebugTranslation.cpp
16
16
+
+++ b/lib/Target/LLVMIR/DebugTranslation.cpp
17
17
+
@@ -148,7 +148,8 @@ llvm::DIDerivedType *DebugTranslation::translateImpl(DIDerivedTypeAttr attr) {
18
18
+
/*File=*/nullptr, /*Line=*/0,
19
19
+
/*Scope=*/nullptr, translate(attr.getBaseType()), attr.getSizeInBits(),
20
20
+
attr.getAlignInBits(), attr.getOffsetInBits(),
21
21
+
- /*DWARFAddressSpace=*/std::nullopt, /*Flags=*/llvm::DINode::FlagZero);
22
22
+
+ /*DWARFAddressSpace=*/std::nullopt, llvm::dwarf::DW_MSPACE_LLVM_none,
23
23
+
+ /*Flags=*/llvm::DINode::FlagZero);
24
24
+
}
25
25
+
26
26
+
llvm::DIFile *DebugTranslation::translateImpl(DIFileAttr attr) {
27
27
+
@@ -185,7 +186,8 @@ DebugTranslation::translateImpl(DILocalVariableAttr attr) {
28
28
+
llvmCtx, translate(attr.getScope()), getMDStringOrNull(attr.getName()),
29
29
+
translate(attr.getFile()), attr.getLine(), translate(attr.getType()),
30
30
+
attr.getArg(),
31
31
+
- /*Flags=*/llvm::DINode::FlagZero, attr.getAlignInBits(),
32
32
+
+ /*Flags=*/llvm::DINode::FlagZero, llvm::dwarf::DW_MSPACE_LLVM_none,
33
33
+
+ attr.getAlignInBits(),
34
34
+
/*Annotations=*/nullptr);
35
35
+
}
36
36
+
+11
pkgs/development/rocm-modules/5/llvm/stage-3/1001-mlir-failing-tests.list
···
1
1
+
./test/Target/LLVMIR/openmp-llvm.mlir
2
2
+
./test/mlir-spirv-cpu-runner/double.mlir
3
3
+
./test/mlir-spirv-cpu-runner/simple_add.mlir
4
4
+
./test/mlir-vulkan-runner/addf.mlir
5
5
+
./test/mlir-vulkan-runner/addi.mlir
6
6
+
./test/mlir-vulkan-runner/addi8.mlir
7
7
+
./test/mlir-vulkan-runner/mulf.mlir
8
8
+
./test/mlir-vulkan-runner/smul_extended.mlir
9
9
+
./test/mlir-vulkan-runner/subf.mlir
10
10
+
./test/mlir-vulkan-runner/time.mlir
11
11
+
./test/mlir-vulkan-runner/umul_extended.mlir
+7
-19
pkgs/development/rocm-modules/5/llvm/stage-3/mlir.nix
···
15
15
buildMan = false; # No man pages to build
16
16
targetName = "mlir";
17
17
targetDir = targetName;
18
18
+
19
19
+
# Fix `DebugTranslation.cpp:139:10: error: no matching function for call to 'get'`
20
20
+
# We patch at a different source root, so we modify the patch and include it locally
21
21
+
# https://github.com/RadeonOpenCompute/llvm-project/commit/f1d1e10ec7e1061bf0b90abbc1e298d9438a5e74.patch
22
22
+
extraPatches = [ ./0000-mlir-fix-debugtranslation.patch ];
18
23
extraNativeBuildInputs = [ clr ];
19
24
20
25
extraBuildInputs = [
···
34
39
];
35
40
36
41
extraPostPatch = ''
37
37
-
chmod +w ../llvm
38
38
-
mkdir -p ../llvm/build/bin
39
39
-
ln -s ${lit}/bin/lit ../llvm/build/bin/llvm-lit
40
40
-
41
42
# `add_library cannot create target "llvm_gtest" because an imported target with the same name already exists`
42
43
substituteInPlace CMakeLists.txt \
43
44
--replace "EXISTS \''${UNITTEST_DIR}/googletest/include/gtest/gtest.h" "FALSE"
44
45
45
45
-
substituteInPlace test/CMakeLists.txt \
46
46
-
--replace "FileCheck count not" "" \
47
47
-
--replace "list(APPEND MLIR_TEST_DEPENDS mlir_rocm_runtime)" ""
48
48
-
49
49
-
substituteInPlace lib/ExecutionEngine/CMakeLists.txt \
50
50
-
--replace "return()" ""
51
51
-
52
52
-
# Remove problematic tests
53
53
-
rm test/CAPI/execution_engine.c
54
54
-
rm test/Target/LLVMIR/llvmir-intrinsics.mlir
55
55
-
rm test/Target/LLVMIR/llvmir.mlir
56
56
-
rm test/Target/LLVMIR/openmp-llvm.mlir
57
57
-
rm test/mlir-cpu-runner/*.mlir
58
58
-
rm test/mlir-vulkan-runner/*.mlir
46
46
+
# Mainly `No such file or directory`
47
47
+
cat ${./1001-mlir-failing-tests.list} | xargs -d \\n rm
59
48
'';
60
49
61
50
extraPostInstall = ''
···
65
54
66
55
checkTargets = [ "check-${targetName}" ];
67
56
requiredSystemFeatures = [ "big-parallel" ];
68
68
-
isBroken = true; # `DebugTranslation.cpp:139:10: error: no matching function for call to 'get'`
69
57
}