Sync
Browse files- dataset.jsonl +0 -0
- dataset/127534.json +68 -0
- dataset/128736.json +81 -0
- dataset/128770.json +59 -0
- scripts/extract_from_issues.py +1 -1
- scripts/postfix_extract.py +2 -0
dataset.jsonl
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
dataset/127534.json
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bug_id": "127534",
|
3 |
+
"issue_url": "https://github.com/llvm/llvm-project/issues/127534",
|
4 |
+
"bug_type": "crash",
|
5 |
+
"base_commit": "6de5d1e46d1812de2bbbbe8d8d2c811e4d16acbe",
|
6 |
+
"knowledge_cutoff": "2025-02-17T18:29:15Z",
|
7 |
+
"lit_test_dir": [
|
8 |
+
"llvm/test/Transforms/LoopSimplifyCFG"
|
9 |
+
],
|
10 |
+
"hints": {
|
11 |
+
"fix_commit": "41437a6067b2f9dc8e7c458ff6417397796be31c",
|
12 |
+
"components": [
|
13 |
+
"LoopSimplifyCFG"
|
14 |
+
],
|
15 |
+
"bug_location_lineno": {
|
16 |
+
"llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp": [
|
17 |
+
[
|
18 |
+
369,
|
19 |
+
375
|
20 |
+
]
|
21 |
+
]
|
22 |
+
},
|
23 |
+
"bug_location_funcname": {
|
24 |
+
"llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp": [
|
25 |
+
"handleDeadExits"
|
26 |
+
]
|
27 |
+
}
|
28 |
+
},
|
29 |
+
"patch": "commit 41437a6067b2f9dc8e7c458ff6417397796be31c\nAuthor: Aleksandr Popov <[email protected]>\nDate: Fri Feb 21 12:26:39 2025 +0100\n\n [LoopSimplifyCFG] Fix SCEV invalidation after removing dead exit (#127536)\n \n Fixes #127534\n\ndiff --git a/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp b/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp\nindex 765b76e54068..4524446e5947 100644\n--- a/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp\n+++ b/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp\n@@ -369,7 +369,7 @@ private:\n DeadInstructions.emplace_back(LandingPad);\n \n for (Instruction *I : DeadInstructions) {\n- SE.forgetBlockAndLoopDispositions(I);\n+ SE.forgetValue(I);\n I->replaceAllUsesWith(PoisonValue::get(I->getType()));\n I->eraseFromParent();\n }\n",
|
30 |
+
"tests": [
|
31 |
+
{
|
32 |
+
"file": "llvm/test/Transforms/LoopSimplifyCFG/pr117537.ll",
|
33 |
+
"commands": [
|
34 |
+
"opt -S -passes='print<scalar-evolution>,loop-mssa(licm,loop-simplifycfg,loop-predication)' -verify-scev < %s"
|
35 |
+
],
|
36 |
+
"tests": [
|
37 |
+
{
|
38 |
+
"test_name": "<module>",
|
39 |
+
"test_body": "\n; Make sure we don't assert due to insufficient SCEV invalidation.\n\ndefine i64 @\"main\"(ptr addrspace(1) %p, i1 %check) {\n;\nentry:\n br label %loop0.pre\n\nloop0.pre:\n br i1 %check, label %exit, label %loop0\n\nloop0:\n %length = load atomic i32, ptr addrspace(1) %p unordered, align 4\n %28 = icmp ugt i32 %length, 1\n br i1 %28, label %loop0.out, label %loop1.preheader\n\nloop0.out:\n %t = add i32 0, 1\n br i1 false, label %loop1.preheader, label %mid\n\nloop1.preheader:\n %length.lcssa = phi i32 [ %length, %loop0.out ], [ %length, %loop0 ]\n %local = phi i32 [ 0, %loop0 ], [ %t, %loop0.out ]\n br label %loop1\n\nloop1:\n %iv1 = phi i32 [ 4, %loop1.preheader ], [ %iv1.next, %loop1.guarded ]\n %82 = icmp ult i32 %iv1, %length.lcssa\n %wc = call i1 @llvm.experimental.widenable.condition()\n %guard.chk = and i1 %82, %wc\n br i1 %guard.chk, label %loop1.guarded, label %deopt-exit\n\nloop1.guarded:\n %iv1.next = add nuw nsw i32 %iv1, 1\n %chk = icmp ugt i32 %iv1, 310\n br i1 %chk, label %loop1.exit, label %loop1\n\ndeopt-exit:\n %100 = call i64 (...) @llvm.experimental.deoptimize.i64(i32 13) [ \"deopt\"() ]\n ret i64 %100\n\nloop1.exit:\n ret i64 0\n\nmid:\n br label %loop0.pre\n\nexit:\n ret i64 0\n}\n\ndeclare i64 @foo()\n\ndeclare i64 @llvm.experimental.deoptimize.i64(...)\n\n; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite)\ndeclare noundef i1 @llvm.experimental.widenable.condition()"
|
40 |
+
}
|
41 |
+
]
|
42 |
+
}
|
43 |
+
],
|
44 |
+
"issue": {
|
45 |
+
"title": "[SCEV] Assertion `isAvailableAtLoopEntry(RHS, L) && \"RHS is not available at Loop Entry\"' failed",
|
46 |
+
"body": "During our local testing, we encountered the assertion failure `isAvailableAtLoopEntry(RHS, L) && \"RHS is not available at Loop Entry\".\n\nReduced reproducer:\n\n```llvm\ntarget datalayout = \"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2\"\ntarget triple = \"x86_64-unknown-linux-gnu\"\n\ndefine i64 @\"main\"(ptr addrspace(1) %p, i1 %check) {\nentry:\n br label %loop0.pre\n\nloop0.pre:\n br i1 %check, label %exit, label %loop0\n\nloop0:\n %length = load atomic i32, ptr addrspace(1) %p unordered, align 4\n %28 = icmp ugt i32 %length, 1\n br i1 %28, label %loop0.out, label %loop1.preheader\n\nloop0.out:\n %t = add i32 0, 1\n br i1 false, label %loop1.preheader, label %mid\n\nloop1.preheader:\n %length.lcssa = phi i32 [ %length, %loop0.out ], [ %length, %loop0 ]\n %local = phi i32 [ 0, %loop0 ], [ %t, %loop0.out ]\n br label %loop1\n\nloop1:\n %iv1 = phi i32 [ 4, %loop1.preheader ], [ %iv1.next, %loop1.guarded ]\n %82 = icmp ult i32 %iv1, %length.lcssa\n %wc = call i1 @llvm.experimental.widenable.condition()\n %guard.chk = and i1 %82, %wc\n br i1 %guard.chk, label %loop1.guarded, label %deopt-exit\n\nloop1.guarded:\n %iv1.next = add nuw nsw i32 %iv1, 1\n %chk = icmp ugt i32 %iv1, 310\n br i1 %chk, label %loop1.exit, label %loop1\n\ndeopt-exit:\n %100 = call i64 (...) @llvm.experimental.deoptimize.i64(i32 13) [ \"deopt\"() ]\n ret i64 %100\n\nloop1.exit:\n ret i64 0\n\nmid:\n br label %loop0.pre\n\nexit:\n ret i64 0\n}\n\ndeclare i64 @foo()\n\ndeclare i64 @llvm.experimental.deoptimize.i64(...)\n\n; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite)\ndeclare noundef i1 @llvm.experimental.widenable.condition()\n```\n\n\nSteps to reproduce:\n`$opt -passes='print<scalar-evolution>,loop-mssa(licm,loop-simplifycfg,loop-predication)'`\n\nProof: https://godbolt.org/z/8hsbahTjq\n\nLooks like `LoopSimplifyCFGPass` is guilty - it doesn\u2019t invalidate SCEV when removing a dead exit:\n\n```c++\n void handleDeadExits() {\n...\n for (Instruction *I : DeadInstructions) {\n SE.forgetBlockAndLoopDispositions(I);\n I->replaceAllUsesWith(PoisonValue::get(I->getType()));\n I->eraseFromParent();\n }\n```\n\n",
|
47 |
+
"author": "aleks-tmb",
|
48 |
+
"labels": [
|
49 |
+
"crash",
|
50 |
+
"llvm:transforms"
|
51 |
+
],
|
52 |
+
"comments": [
|
53 |
+
{
|
54 |
+
"author": "aleks-tmb",
|
55 |
+
"body": "The `LoopSimplifyCFG` pass removes `%length.lcssa.ph`, but later, in the `LoopPredication` pass, we encounter an assertion failure for the `%length.lcssa` SCEV, which remains equal to `%length`\n\n<img width=\"935\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/4d630238-569e-4d2b-b760-b09d54b4450f\" />\n\n"
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"author": "aleks-tmb",
|
59 |
+
"body": "It seems the reason why forgetBlockAndLoopDispositions doesn't cover this case is that `%length.lcssa.ph` doesn't have an existing SCEV, since the instruction was just added by the previous LICM pass."
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"author": "nikic",
|
63 |
+
"body": "There is some pretty tricky interaction between LCSSA formation and SCEV invalidation, see:\nhttps://github.com/llvm/llvm-project/blob/7f69a399df384c86428d0c97e3afbc8146324226/llvm/lib/Transforms/Utils/LCSSA.cpp#L206-L211\n\nBasically, when forming LCSSA form, we take care not to break the invalidation chain, so that invalidation of the LCSSA phi node is sufficient.\n\nI think the LICM predecessor splitting effectively does manual LCSSA formation and doesn't maintain this special logic.\n\nI think the extra forgetValue() call works around this issue and variants of this might appear elsewhere. But TBH I'm not totally sure."
|
64 |
+
}
|
65 |
+
]
|
66 |
+
},
|
67 |
+
"verified": true
|
68 |
+
}
|
dataset/128736.json
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bug_id": "128736",
|
3 |
+
"issue_url": "https://github.com/llvm/llvm-project/issues/128736",
|
4 |
+
"bug_type": "crash",
|
5 |
+
"base_commit": "02128342d2818e5a65846fec4179ed5344045102",
|
6 |
+
"knowledge_cutoff": "2025-02-25T16:27:23Z",
|
7 |
+
"lit_test_dir": [
|
8 |
+
"llvm/test/Transforms/SLPVectorizer"
|
9 |
+
],
|
10 |
+
"hints": {
|
11 |
+
"fix_commit": "39bab1de33333ee3c62b586c4e8d26f8c443bc60",
|
12 |
+
"components": [
|
13 |
+
"SLPVectorizer"
|
14 |
+
],
|
15 |
+
"bug_location_lineno": {
|
16 |
+
"llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp": [
|
17 |
+
[
|
18 |
+
1389,
|
19 |
+
1397
|
20 |
+
],
|
21 |
+
[
|
22 |
+
2849,
|
23 |
+
2859
|
24 |
+
],
|
25 |
+
[
|
26 |
+
2915,
|
27 |
+
2926
|
28 |
+
],
|
29 |
+
[
|
30 |
+
16466,
|
31 |
+
16474
|
32 |
+
],
|
33 |
+
[
|
34 |
+
17075,
|
35 |
+
17081
|
36 |
+
],
|
37 |
+
[
|
38 |
+
20449,
|
39 |
+
20456
|
40 |
+
],
|
41 |
+
[
|
42 |
+
20678,
|
43 |
+
20684
|
44 |
+
]
|
45 |
+
]
|
46 |
+
},
|
47 |
+
"bug_location_funcname": {
|
48 |
+
"llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp": [
|
49 |
+
"tryToReduce",
|
50 |
+
"removeInstructionsAndOperands",
|
51 |
+
"BoUpSLP::vectorizeTree"
|
52 |
+
]
|
53 |
+
}
|
54 |
+
},
|
55 |
+
"patch": "commit 39bab1de33333ee3c62b586c4e8d26f8c443bc60\nAuthor: Alexey Bataev <[email protected]>\nDate: Wed Feb 26 14:12:05 2025 -0800\n\n [SLP]Check if the operand for removal is the reduction operand, awaiting for the reduction\n \n If the operand of the instruction-to-be-removed is a reduction value,\n which is not reduced yet, and, thus, it has no users, it may be removed\n during operands analysis.\n \n Fixes #128736\n\ndiff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp\nindex b25b09306aca..e8c91ebd508c 100644\n--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp\n+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp\n@@ -1389,9 +1389,10 @@ public:\n /// Vectorize the tree but with the list of externally used values \\p\n /// ExternallyUsedValues. Values in this MapVector can be replaced but the\n /// generated extractvalue instructions.\n- Value *\n- vectorizeTree(const ExtraValueToDebugLocsMap &ExternallyUsedValues,\n- Instruction *ReductionRoot = nullptr);\n+ Value *vectorizeTree(\n+ const ExtraValueToDebugLocsMap &ExternallyUsedValues,\n+ Instruction *ReductionRoot = nullptr,\n+ ArrayRef<std::tuple<Value *, unsigned, bool>> VectorValuesAndScales = {});\n \n /// \\returns the cost incurred by unwanted spills and fills, caused by\n /// holding live values over call sites.\n@@ -2849,11 +2850,13 @@ public:\n /// Remove instructions from the parent function and clear the operands of \\p\n /// DeadVals instructions, marking for deletion trivially dead operands.\n template <typename T>\n- void removeInstructionsAndOperands(ArrayRef<T *> DeadVals) {\n+ void removeInstructionsAndOperands(\n+ ArrayRef<T *> DeadVals,\n+ ArrayRef<std::tuple<Value *, unsigned, bool>> VectorValuesAndScales) {\n SmallVector<WeakTrackingVH> DeadInsts;\n for (T *V : DeadVals) {\n auto *I = cast<Instruction>(V);\n- DeletedInstructions.insert(I);\n+ eraseInstruction(I);\n }\n DenseSet<Value *> Processed;\n for (T *V : DeadVals) {\n@@ -2915,12 +2918,17 @@ public:\n // loop iteration.\n if (auto *OpI = dyn_cast<Instruction>(OpV))\n if (!DeletedInstructions.contains(OpI) &&\n+ (!OpI->getType()->isVectorTy() ||\n+ none_of(VectorValuesAndScales,\n+ [&](const std::tuple<Value *, unsigned, bool> &V) {\n+ return std::get<0>(V) == OpI;\n+ })) &&\n isInstructionTriviallyDead(OpI, TLI))\n DeadInsts.push_back(OpI);\n }\n \n VI->removeFromParent();\n- DeletedInstructions.insert(VI);\n+ eraseInstruction(VI);\n SE->forgetValue(VI);\n }\n }\n@@ -16466,9 +16474,10 @@ Value *BoUpSLP::vectorizeTree() {\n return vectorizeTree(ExternallyUsedValues);\n }\n \n-Value *\n-BoUpSLP::vectorizeTree(const ExtraValueToDebugLocsMap &ExternallyUsedValues,\n- Instruction *ReductionRoot) {\n+Value *BoUpSLP::vectorizeTree(\n+ const ExtraValueToDebugLocsMap &ExternallyUsedValues,\n+ Instruction *ReductionRoot,\n+ ArrayRef<std::tuple<Value *, unsigned, bool>> VectorValuesAndScales) {\n // All blocks must be scheduled before any instructions are inserted.\n for (auto &BSIter : BlocksSchedules) {\n scheduleBlock(BSIter.second.get());\n@@ -17075,7 +17084,7 @@ BoUpSLP::vectorizeTree(const ExtraValueToDebugLocsMap &ExternallyUsedValues,\n // cache correctness.\n // NOTE: removeInstructionAndOperands only marks the instruction for deletion\n // - instructions are not deleted until later.\n- removeInstructionsAndOperands(ArrayRef(RemovedInsts));\n+ removeInstructionsAndOperands(ArrayRef(RemovedInsts), VectorValuesAndScales);\n \n Builder.ClearInsertionPoint();\n InstrElementSize.clear();\n@@ -20449,8 +20458,8 @@ public:\n InsertPt = GetCmpForMinMaxReduction(RdxRootInst);\n \n // Vectorize a tree.\n- Value *VectorizedRoot =\n- V.vectorizeTree(LocalExternallyUsedValues, InsertPt);\n+ Value *VectorizedRoot = V.vectorizeTree(\n+ LocalExternallyUsedValues, InsertPt, VectorValuesAndScales);\n // Update TrackedToOrig mapping, since the tracked values might be\n // updated.\n for (Value *RdxVal : Candidates) {\n@@ -20678,7 +20687,7 @@ public:\n Ignore->replaceAllUsesWith(P);\n }\n }\n- V.removeInstructionsAndOperands(RdxOps);\n+ V.removeInstructionsAndOperands(RdxOps, VectorValuesAndScales);\n }\n } else if (!CheckForReusedReductionOps) {\n for (ReductionOpsType &RdxOps : ReductionOps)\n",
|
56 |
+
"tests": [
|
57 |
+
{
|
58 |
+
"file": "llvm/test/Transforms/SLPVectorizer/X86/reduction-with-removed-extracts.ll",
|
59 |
+
"commands": [
|
60 |
+
"opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu -mcpu=znver2 < %s"
|
61 |
+
],
|
62 |
+
"tests": [
|
63 |
+
{
|
64 |
+
"test_name": "<module>",
|
65 |
+
"test_body": "\ndefine i32 @test(i32 %arg) {\n;\nbb:\n br label %bb1\n\nbb1:\n %phi = phi i32 [ 0, %bb ], [ %mul37, %bb1 ]\n %mul = mul i64 0, 0\n %trunc = trunc i64 %mul to i32\n %or = or i32 0, %trunc\n %or2 = or i32 0, %or\n %or3 = or i32 %or2, 0\n %mul4 = mul i32 0, %or3\n %mul5 = mul i32 %or3, 0\n %mul6 = mul i32 %mul5, %mul4\n %mul7 = mul i32 %mul6, %mul4\n %mul8 = mul i32 %mul7, %or3\n %mul9 = mul i64 0, 0\n %trunc10 = trunc i64 %mul9 to i32\n %or11 = or i32 0, %trunc10\n %or12 = or i32 %arg, %or11\n %or13 = or i32 %or12, 0\n %mul14 = mul i32 %or13, %mul8\n %mul15 = mul i32 %mul14, 0\n %mul16 = mul i32 %mul15, 0\n %mul17 = mul i32 %mul16, %or13\n %shl = shl i64 0, 0\n %mul18 = mul i64 %shl, 0\n %trunc19 = trunc i64 %mul18 to i32\n %or20 = or i32 0, %trunc19\n %or21 = or i32 0, %or20\n %or22 = or i32 %or21, 0\n %mul23 = mul i32 %or22, %mul17\n %mul24 = mul i32 %mul23, 0\n %mul25 = mul i32 %mul24, 0\n %mul26 = mul i32 %mul25, %or22\n %shl27 = shl i64 0, 0\n %mul28 = mul i64 %shl27, 0\n %trunc29 = trunc i64 %mul28 to i32\n %or30 = or i32 0, %trunc29\n %or31 = or i32 0, %or30\n %or32 = or i32 %or31, 0\n %mul33 = mul i32 0, %or32\n %mul34 = mul i32 %or32, %mul26\n %mul35 = mul i32 %mul34, %mul33\n %mul36 = mul i32 %mul35, %mul33\n %mul37 = mul i32 %mul36, %or32\n br label %bb1\n}"
|
66 |
+
}
|
67 |
+
]
|
68 |
+
}
|
69 |
+
],
|
70 |
+
"issue": {
|
71 |
+
"title": "Assertion `I->use_empty() && \"trying to erase instruction with users.\"' failed.",
|
72 |
+
"body": "To reproduce run opt with the test below using -passes=slp-vectorizer.\n```\n; ModuleID = './reduced.ll'\nsource_filename = \"./reduced.ll\"\ntarget datalayout = \"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2\"\ntarget triple = \"x86_64-unknown-linux-gnu\"\n\ndefine i32 @wombat(i32 %arg) #0 gc \"statepoint-example\" {\nbb:\n br label %bb1\n \nbb1: ; preds = %bb1, %bb\n %phi = phi i32 [ 0, %bb ], [ %mul37, %bb1 ]\n %mul = mul i64 0, 0\n %trunc = trunc i64 %mul to i32\n %or = or i32 0, %trunc\n %or2 = or i32 0, %or\n %or3 = or i32 %or2, 0\n %mul4 = mul i32 0, %or3\n %mul5 = mul i32 %or3, 0\n %mul6 = mul i32 %mul5, %mul4\n %mul7 = mul i32 %mul6, %mul4\n %mul8 = mul i32 %mul7, %or3\n %mul9 = mul i64 0, 0\n %trunc10 = trunc i64 %mul9 to i32\n %or11 = or i32 0, %trunc10\n %or12 = or i32 %arg, %or11\n %or13 = or i32 %or12, 0\n %mul14 = mul i32 %or13, %mul8\n %mul15 = mul i32 %mul14, 0\n %mul16 = mul i32 %mul15, 0\n %mul17 = mul i32 %mul16, %or13\n %shl = shl i64 0, 0\n %mul18 = mul i64 %shl, 0\n %trunc19 = trunc i64 %mul18 to i32\n %or20 = or i32 0, %trunc19\n %or21 = or i32 0, %or20\n %or22 = or i32 %or21, 0\n %mul23 = mul i32 %or22, %mul17\n %mul24 = mul i32 %mul23, 0\n %mul25 = mul i32 %mul24, 0\n %mul26 = mul i32 %mul25, %or22\n %shl27 = shl i64 0, 0\n %mul28 = mul i64 %shl27, 0\n %trunc29 = trunc i64 %mul28 to i32\n %or30 = or i32 0, %trunc29\n %or31 = or i32 0, %or30\n %or32 = or i32 %or31, 0\n %mul33 = mul i32 0, %or32\n %mul34 = mul i32 %or32, %mul26\n %mul35 = mul i32 %mul34, %mul33\n %mul36 = mul i32 %mul35, %mul33\n %mul37 = mul i32 %mul36, %or32\n br label %bb1\n}\n\nattributes #0 = { \"target-cpu\"=\"znver2\" }\n```\n\nReproducer: https://godbolt.org/z/4PPzsMbP3\n\nStack dump:\n```\nopt: /root/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4570: llvm::slpvectorizer::BoUpSLP::~BoUpSLP(): Assertion `I->use_empty() && \"trying to erase instruction with users.\"' failed.\nPLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.\nStack dump:\n0.\tProgram arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=slp-vectorizer <source>\n1.\tRunning pass \"function(slp-vectorizer)\" on module \"<source>\"\n2.\tRunning pass \"slp-vectorizer\" on function \"wombat\"\n #0 0x00000000054546a8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x54546a8)\n #1 0x0000000005452064 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0\n #2 0x00007b5c5f242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)\n #3 0x00007b5c5f2969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)\n #4 0x00007b5c5f242476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)\n #5 0x00007b5c5f2287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)\n #6 0x00007b5c5f22871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)\n #7 0x00007b5c5f239e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)\n #8 0x000000000440d177 (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x440d177)\n #9 0x00000000044d46ae llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (.part.0) SLPVectorizer.cpp:0:0\n#10 0x00000000044d50cb llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x44d50cb)\n#11 0x000000000318a35e llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x318a35e)\n#12 0x000000000524e9e0 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x524e9e0)\n#13 0x0000000000e6f88e llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0xe6f88e)\n#14 0x000000000524d2fb llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x524d2fb)\n#15 0x0000000000e6eb7e llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0xe6eb7e)\n#16 0x000000000524cd00 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x524cd00)\n#17 0x0000000000935e7a llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x935e7a)\n#18 0x00000000009294ec optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x9294ec)\n#19 0x00007b5c5f229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)\n#20 0x00007b5c5f229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)\n#21 0x0000000000920dc5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x920dc5)\nProgram terminated with signal: SIGSEGV\nCompiler returned: 139\n```",
|
73 |
+
"author": "TatyanaDoubts",
|
74 |
+
"labels": [
|
75 |
+
"llvm:SLPVectorizer",
|
76 |
+
"crash"
|
77 |
+
],
|
78 |
+
"comments": []
|
79 |
+
},
|
80 |
+
"verified": true
|
81 |
+
}
|
dataset/128770.json
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bug_id": "128770",
|
3 |
+
"issue_url": "https://github.com/llvm/llvm-project/issues/128770",
|
4 |
+
"bug_type": "crash",
|
5 |
+
"base_commit": "7f482aa848c5f136d2b32431f91f88492c78c709",
|
6 |
+
"knowledge_cutoff": "2025-02-25T20:34:44Z",
|
7 |
+
"lit_test_dir": [
|
8 |
+
"llvm/test/Transforms/SLPVectorizer"
|
9 |
+
],
|
10 |
+
"hints": {
|
11 |
+
"fix_commit": "418a9872851ef5342b29baa36dd672129f129953",
|
12 |
+
"components": [
|
13 |
+
"SLPVectorizer"
|
14 |
+
],
|
15 |
+
"bug_location_lineno": {
|
16 |
+
"llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp": [
|
17 |
+
[
|
18 |
+
13353,
|
19 |
+
13358
|
20 |
+
],
|
21 |
+
[
|
22 |
+
13453,
|
23 |
+
13459
|
24 |
+
]
|
25 |
+
]
|
26 |
+
},
|
27 |
+
"bug_location_funcname": {
|
28 |
+
"llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp": [
|
29 |
+
"BoUpSLP::isGatherShuffledSingleRegisterEntry"
|
30 |
+
]
|
31 |
+
}
|
32 |
+
},
|
33 |
+
"patch": "commit 418a9872851ef5342b29baa36dd672129f129953\nAuthor: Alexey Bataev <[email protected]>\nDate: Wed Feb 26 12:59:27 2025 -0800\n\n [SLP]Do not use node, if it is a subvector or buildvector node\n \n If the buildvector has some matches with another node, which is\n a subvector of another buildvector node, need to check for this and\n cancel matching to avoid incorrect ordering of the nodes.\n \n Fixes #128770\n\ndiff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp\nindex 02fea2eaf9d4..b25b09306aca 100644\n--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp\n+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp\n@@ -13353,6 +13353,14 @@ BoUpSLP::isGatherShuffledSingleRegisterEntry(\n return EdgeInfo(const_cast<TreeEntry *>(TE), 0);\n return TE->UserTreeIndex;\n };\n+ auto HasGatherUser = [&](const TreeEntry *TE) {\n+ while (TE->Idx != 0 && TE->UserTreeIndex) {\n+ if (TE->UserTreeIndex.EdgeIdx == UINT_MAX)\n+ return true;\n+ TE = TE->UserTreeIndex.UserTE;\n+ }\n+ return false;\n+ };\n const EdgeInfo TEUseEI = GetUserEntry(TE);\n if (!TEUseEI)\n return std::nullopt;\n@@ -13453,7 +13461,8 @@ BoUpSLP::isGatherShuffledSingleRegisterEntry(\n // If the user instruction is used for some reason in different\n // vectorized nodes - make it depend on index.\n if (TEUseEI.UserTE != UseEI.UserTE &&\n- TEUseEI.UserTE->Idx < UseEI.UserTE->Idx)\n+ (TEUseEI.UserTE->Idx < UseEI.UserTE->Idx ||\n+ HasGatherUser(TEUseEI.UserTE)))\n continue;\n }\n \n",
|
34 |
+
"tests": [
|
35 |
+
{
|
36 |
+
"file": "llvm/test/Transforms/SLPVectorizer/X86/buildvector-reused-with-bv-subvector.ll",
|
37 |
+
"commands": [
|
38 |
+
"opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu -mcpu=skylake < %s"
|
39 |
+
],
|
40 |
+
"tests": [
|
41 |
+
{
|
42 |
+
"test_name": "<module>",
|
43 |
+
"test_body": "\ndefine void @test(ptr %0, i64 %1, i64 %2) {\n;\n %4 = ptrtoint ptr %0 to i64\n %5 = ptrtoint ptr %0 to i64\n %6 = ptrtoint ptr %0 to i64\n %7 = ptrtoint ptr %0 to i64\n %8 = ptrtoint ptr %0 to i64\n br label %.preheader.lr.ph\n\n.preheader.lr.ph:\n br label %.preheader.us.us.preheader\n\n.preheader.us.us.preheader:\n %9 = or i64 %1, %7\n %10 = or i64 %2, %7\n %11 = or i64 %1, %4\n %12 = or i64 %1, %8\n %13 = or i64 %5, %8\n %14 = or i64 %8, %4\n %15 = or i64 %5, %6\n %16 = or i64 %6, %4\n br label %.preheader.us.us\n\n.preheader.us.us:\n %diff.check1 = icmp ult i64 %9, 32\n %diff.check2 = icmp ult i64 %10, 32\n %conflict.rdx3 = or i1 %diff.check1, %diff.check2\n %diff.check4 = icmp ult i64 %11, 32\n %conflict.rdx5 = or i1 %conflict.rdx3, %diff.check4\n %diff.check6 = icmp ult i64 %12, 32\n %conflict.rdx7 = or i1 %conflict.rdx5, %diff.check6\n %diff.check8 = icmp ult i64 %13, 32\n %conflict.rdx9 = or i1 %conflict.rdx7, %diff.check8\n %diff.check10 = icmp ult i64 %14, 32\n %conflict.rdx11 = or i1 %conflict.rdx9, %diff.check10\n %diff.check12 = icmp ult i64 %15, 32\n %conflict.rdx13 = or i1 %conflict.rdx11, %diff.check12\n %diff.check14 = icmp ult i64 %16, 32\n %conflict.rdx15 = or i1 %conflict.rdx13, %diff.check14\n br i1 %conflict.rdx15, label %scalar.ph, label %.preheader.us.us\n\nscalar.ph:\n ret void\n}"
|
44 |
+
}
|
45 |
+
]
|
46 |
+
}
|
47 |
+
],
|
48 |
+
"issue": {
|
49 |
+
"title": "SLP: Instruction does not dominate all uses (insertelement/shufflevector)",
|
50 |
+
"body": "[slp.ll.gz](https://github.com/user-attachments/files/18972113/slp.ll.gz)\n\nReproducer: `opt -passes=slp-vectorizer slp.ll -mcpu=skylake`\n\n@alexey-bataev can you please take a look?",
|
51 |
+
"author": "vzakhari",
|
52 |
+
"labels": [
|
53 |
+
"llvm:SLPVectorizer",
|
54 |
+
"crash"
|
55 |
+
],
|
56 |
+
"comments": []
|
57 |
+
},
|
58 |
+
"verified": true
|
59 |
+
}
|
scripts/extract_from_issues.py
CHANGED
@@ -34,7 +34,7 @@ session.headers.update(
|
|
34 |
)
|
35 |
|
36 |
issue_id_begin = 76663 # Since 2024-01-01
|
37 |
-
issue_id_end =
|
38 |
|
39 |
|
40 |
def wait(progress):
|
|
|
34 |
)
|
35 |
|
36 |
issue_id_begin = 76663 # Since 2024-01-01
|
37 |
+
issue_id_end = 129004
|
38 |
|
39 |
|
40 |
def wait(progress):
|
scripts/postfix_extract.py
CHANGED
@@ -119,9 +119,11 @@ fix_commit_map = {
|
|
119 |
"125374": None, # Duplicate of #119173
|
120 |
"125400": None, # Reverted
|
121 |
"126409": None, # Reverted
|
|
|
122 |
"126974": "29f3a352068ce562bcb65e18a676c82a9991583c",
|
123 |
"127173": None, # Reverted
|
124 |
"127177": None, # Reverted
|
|
|
125 |
}
|
126 |
|
127 |
if issue_id in fix_commit_map:
|
|
|
119 |
"125374": None, # Duplicate of #119173
|
120 |
"125400": None, # Reverted
|
121 |
"126409": None, # Reverted
|
122 |
+
"126909": None, # Cannot reproduce the crash
|
123 |
"126974": "29f3a352068ce562bcb65e18a676c82a9991583c",
|
124 |
"127173": None, # Reverted
|
125 |
"127177": None, # Reverted
|
126 |
+
"127220": None, # Reverted
|
127 |
}
|
128 |
|
129 |
if issue_id in fix_commit_map:
|