Set the ReplaceFlags variable to false, since there is code meant only for the ADDItocHi/ADDItocL nodes. This has the side effect of disabling the peephole when the load/store instruction has a non-zero offset. This patch also fixes retrieving the `ImmOpnd` node from the AIX small code model pseduos and does the same for the register operand node. This allows cleaning up the later calls to replaceOperands. Finally move calculating the MaxOffset into the code guarded by ReplaceFlags as it is only used there and the comment is specific to the ELF ABI. Fixes https://github.com/llvm/llvm-project/issues/63927 Differential Revision: https://reviews.llvm.org/D155957
21 lines
456 B
LLVM
21 lines
456 B
LLVM
; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | \
|
|
; RUN: FileCheck %s
|
|
|
|
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | \
|
|
; RUN: FileCheck %s
|
|
|
|
@x = local_unnamed_addr global i32 218114560, align 4 #0
|
|
|
|
define i32 @main() local_unnamed_addr {
|
|
entry:
|
|
%0 = load i32, ptr @x, align 4
|
|
%shr = lshr i32 %0, 8
|
|
%and = and i32 %shr, 255
|
|
ret i32 %and
|
|
}
|
|
|
|
attributes #0 = { "toc-data" }
|
|
|
|
; CHECK: la [[ADDR:[0-9]+]], x[TD](2)
|
|
; CHECK: lbz {{.*}}, 2([[ADDR]])
|