llvm-project/llvm/test/CodeGen/PowerPC/fast-isel-load-store-vsx.ll
Kai Nacke 427fb35192 [PPC] Opaque pointer migration, part 1.
The LIT test cases were migrated with the script provided by
Nikita Popov. Due to the size of the change it is split into
several parts.

Reviewed By: nemanja, amyk, nikic, PowerPC

Differential Revision: https://reviews.llvm.org/D135470
2022-10-11 17:24:06 +00:00

28 lines
1.3 KiB
LLVM

; RUN: llc < %s -O0 -fast-isel -mattr=+vsx -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -ppc-late-peephole=false | FileCheck %s --check-prefix=ELF64VSX
;; The semantics of VSX stores for when R0 is used is different depending on
;; whether it is used as base or offset. If used as base, the effective
;; address computation will use zero regardless of the content of R0. If used as
;; an offset the content will be used in the effective address. We observed that
;; for some constructors, the initialization values were being stored without
;; an offset register being specified which was causing R0 to be used as offset
;; in regions where it contained the value in the link register. This test
;; verifies that R0 is used as base in these situations.
%SomeStruct = type { double }
; ELF64VSX-LABEL: SomeStructCtor
define linkonce_odr void @SomeStructCtor(ptr %this, double %V) unnamed_addr align 2 {
entry:
%this.addr = alloca ptr, align 8
%V.addr = alloca double, align 8
store ptr %this, ptr %this.addr, align 8
; ELF64VSX: stfd {{[0-9][0-9]?}}, -{{[1-9][0-9]?}}({{[1-9][0-9]?}})
store double %V, ptr %V.addr, align 8
%this1 = load ptr, ptr %this.addr
; ELF64VSX: stxsdx {{[0-9][0-9]?}}, 0, {{[1-9][0-9]?}}
%0 = load double, ptr %V.addr, align 8
store double %0, ptr %this1, align 8
ret void
}