Skip to content

Commit 9afbff9

Browse files
Use RemovedSlots to decide whether to run remapInstructions
1 parent 400dcb1 commit 9afbff9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/CodeGen/StackColoring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ bool StackColoring::runOnMachineFunction(MachineFunction &Func) {
13551355

13561356
// Scan the entire function and update all machine operands that use frame
13571357
// indices to use the remapped frame index.
1358-
if (!SlotRemap.empty()) {
1358+
if (RemovedSlots > 0) {
13591359
expungeSlotMap(SlotRemap, NumSlots);
13601360
remapInstructions(SlotRemap);
13611361
}

llvm/test/CodeGen/X86/StackColoring-tbaa.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ body: |
5353
; CHECK: [[LEA64r:%[0-9]+]]:gr64 = nuw LEA64r %stack.1.agg, 1, $noreg, 24, $noreg
5454
; CHECK-NEXT: CMP8mi %stack.1.agg, 1, $noreg, 47, $noreg, 0, implicit-def $eflags :: (dereferenceable load (s8) from %ir.a22, !tbaa !2)
5555
; CHECK-NEXT: [[CMOV64rm:%[0-9]+]]:gr64 = CMOV64rm [[LEA64r]], %stack.1.agg, 1, $noreg, 24, $noreg, 8, implicit $eflags :: (dereferenceable load (s64) from %ir.a2)
56-
; CHECK-NEXT: [[MOV8rm:%[0-9]+]]:gr8 = MOV8rm killed [[CMOV64rm]], 1, $noreg, 16, $noreg :: (load (s8) from %ir.add.ptr.i, !tbaa !2)
56+
; CHECK-NEXT: [[MOV8rm:%[0-9]+]]:gr8 = MOV8rm killed [[CMOV64rm]], 1, $noreg, 16, $noreg :: (load (s8) from %ir.add.ptr.i)
5757
; CHECK-NEXT: $al = COPY [[MOV8rm]]
5858
; CHECK-NEXT: RET 0, $al
5959
LIFETIME_START %stack.0.padding

0 commit comments

Comments
 (0)