Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/ShrinkWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ bool ShrinkWrapImpl::useOrDefCSROrFI(const MachineInstr &MI, RegScavenger *RS,
return isa<GlobalValue>(UO);
}
if (const PseudoSourceValue *PSV = Op->getPseudoValue())
return PSV->isJumpTable();
return PSV->isJumpTable() || PSV->isConstantPool();
return false;
};
// Load/store operations may access the stack indirectly when we previously
Expand Down
10 changes: 6 additions & 4 deletions llvm/test/CodeGen/AArch64/shrink-wrap-const-pool-access.mir
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
br label %common.ret
}
...
# FIXME: Following code has a load from constant pool. Accessing constant pool
# Following code has a load from constant pool. Accessing constant pool
# must not be considered as a stack access and hence, shrink wrapping must
# happen.
# CHECK-LABEL:name: shrink_wrap_load_from_const_pool
# CHECK-NOT: savePoint
# CHECK-NOT: restorePoint
# CHECK-LABEL:name: shrink_wrap_load_from_const_pool
# CHECK: savePoint:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anchor with a CHECK-LABEL?

Suggested change
# CHECK: savePoint:
# CHECK-LABEL: name: shrink_wrap_load_from_const_pool
# CHECK: savePoint:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will add this before committing. Thanks

# CHECK: - point: '%bb.3'
# CHECK: restorePoint:
# CHECK: - point: '%bb.5'
---
name: shrink_wrap_load_from_const_pool
tracksRegLiveness: true
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/X86/fp128-select.ll
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ define void @test_select(ptr %p, ptr %q, i1 zeroext %c) nounwind {
; SSE: # %bb.0:
; SSE-NEXT: testl %edx, %edx
; SSE-NEXT: jne .LBB0_1
; SSE-NEXT: # %bb.3:
; SSE-NEXT: movaps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; SSE-NEXT: # %bb.2:
; SSE-NEXT: movaps {{.*#+}} xmm0 = [NaN]
; SSE-NEXT: movaps %xmm0, (%rsi)
; SSE-NEXT: retq
; SSE-NEXT: .LBB0_1:
Expand Down Expand Up @@ -58,7 +58,7 @@ define fp128 @test_select_cc(fp128, fp128) nounwind {
; SSE-NEXT: xorps %xmm1, %xmm1
; SSE-NEXT: jmp .LBB1_3
; SSE-NEXT: .LBB1_1:
; SSE-NEXT: movaps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
; SSE-NEXT: movaps {{.*#+}} xmm1 = [1.0E+0]
; SSE-NEXT: .LBB1_3: # %BB0
; SSE-NEXT: testl %ebx, %ebx
; SSE-NEXT: movaps (%rsp), %xmm0 # 16-byte Reload
Expand Down
Loading