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