[PATCH] D76934: [GlobalISel] fix crash in IRTranslator, MachineIRBuilder when translating @llvm.dbg.value intrinsic and using -debug
Dominik Montada via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 11 01:51:06 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf24e2e9eebde: [GlobalISel] fix crash in IRTranslator, MachineIRBuilder when translating @llvm. (authored by gargaroff).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76934/new/
https://reviews.llvm.org/D76934
Files:
llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
Index: llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
===================================================================
--- llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
+++ llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
@@ -1,5 +1,6 @@
; RUN: llc -global-isel -mtriple=aarch64 %s -stop-after=irtranslator -o - | FileCheck %s
-; RUN: llc -mtriple=aarch64 -global-isel --global-isel-abort=0 -o /dev/null
+; RUN: llc -mtriple=aarch64 -global-isel --global-isel-abort=0 %s -o /dev/null
+; RUN: llc -mtriple=aarch64 -global-isel --global-isel-abort=0 %s -o /dev/null -debug
; CHECK-LABEL: name: debug_declare
; CHECK: stack:
Index: llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
@@ -97,7 +97,7 @@
assert(
cast<DILocalVariable>(Variable)->isValidLocationForIntrinsic(getDL()) &&
"Expected inlined-at fields to agree");
- auto MIB = buildInstr(TargetOpcode::DBG_VALUE);
+ auto MIB = buildInstrNoInsert(TargetOpcode::DBG_VALUE);
if (auto *CI = dyn_cast<ConstantInt>(&C)) {
if (CI->getBitWidth() > 64)
MIB.addCImm(CI);
@@ -110,7 +110,8 @@
MIB.addReg(0U);
}
- return MIB.addImm(0).addMetadata(Variable).addMetadata(Expr);
+ MIB.addImm(0).addMetadata(Variable).addMetadata(Expr);
+ return insertInstr(MIB);
}
MachineInstrBuilder MachineIRBuilder::buildDbgLabel(const MDNode *Label) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76934.270060.patch
Type: text/x-patch
Size: 1524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200611/343e8078/attachment.bin>
More information about the llvm-commits
mailing list