[llvm] r367483 - Fix to r367374 "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
Amy Huang via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 31 14:03:38 PDT 2019
Author: akhuang
Date: Wed Jul 31 14:03:38 2019
New Revision: 367483
URL: http://llvm.org/viewvc/llvm-project?rev=367483&view=rev
Log:
Fix to r367374 "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
after windows buildbot failure.
Added a check that the MachineInstr exists and is a call before trying
to add symbols around it.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
llvm/trunk/test/CodeGen/X86/label-heapallocsite.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp?rev=367483&r1=367482&r2=367483&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Wed Jul 31 14:03:38 2019
@@ -910,8 +910,10 @@ EmitSchedule(MachineBasicBlock::iterator
if (HasDbg)
ProcessSourceNode(N, DAG, Emitter, VRBaseMap, Orders, Seen, NewInsn);
- if (MDNode* MD = DAG->getHeapAllocSite(N))
- MF.addCodeViewHeapAllocSite(NewInsn, MD);
+ if (MDNode *MD = DAG->getHeapAllocSite(N)) {
+ if (NewInsn && NewInsn->isCall())
+ MF.addCodeViewHeapAllocSite(NewInsn, MD);
+ }
GluedNodes.pop_back();
}
@@ -921,8 +923,10 @@ EmitSchedule(MachineBasicBlock::iterator
if (HasDbg)
ProcessSourceNode(SU->getNode(), DAG, Emitter, VRBaseMap, Orders, Seen,
NewInsn);
- if (MDNode* MD = DAG->getHeapAllocSite(SU->getNode()))
- MF.addCodeViewHeapAllocSite(NewInsn, MD);
+ if (MDNode *MD = DAG->getHeapAllocSite(SU->getNode())) {
+ if (NewInsn && NewInsn->isCall())
+ MF.addCodeViewHeapAllocSite(NewInsn, MD);
+ }
}
// Insert all the dbg_values which have not already been inserted in source
Modified: llvm/trunk/test/CodeGen/X86/label-heapallocsite.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/label-heapallocsite.ll?rev=367483&r1=367482&r2=367483&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/label-heapallocsite.ll (original)
+++ llvm/trunk/test/CodeGen/X86/label-heapallocsite.ll Wed Jul 31 14:03:38 2019
@@ -88,10 +88,10 @@ declare void @llvm.dbg.value(metadata, m
; CHECK: callq alloc_foo
; DAG: .Lheapallocsite5:
; FAST: .Lheapallocsite7:
-; DAG: .Lheapallocsite8:
+; DAG: .Lheapallocsite6:
; FAST: .Lheapallocsite4:
; CHECK: callq alloc_foo
-; DAG: .Lheapallocsite9:
+; DAG: .Lheapallocsite7:
; FAST: .Lheapallocsite5:
; CHECK-LABEL: .short 4423 # Record kind: S_GPROC32_ID
@@ -113,12 +113,9 @@ declare void @llvm.dbg.value(metadata, m
; CHECK-NEXT: .short .Lheapallocsite5-.Lheapallocsite4
; CHECK-NEXT: .long 4099
; CHECK: .short 4446 # Record kind: S_HEAPALLOCSITE
-; FAST-NEXT: .secrel32 .Lheapallocsite6
-; FAST-NEXT: .secidx .Lheapallocsite6
-; FAST-NEXT: .short .Lheapallocsite7-.Lheapallocsite6
-; DAG-NEXT: .secrel32 .Lheapallocsite8
-; DAG-NEXT: .secidx .Lheapallocsite8
-; DAG-NEXT: .short .Lheapallocsite9-.Lheapallocsite8
+; CHECK-NEXT: .secrel32 .Lheapallocsite6
+; CHECK-NEXT: .secidx .Lheapallocsite6
+; CHECK-NEXT: .short .Lheapallocsite7-.Lheapallocsite6
; CHECK-NEXT: .long 4099
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
More information about the llvm-commits
mailing list