llvm-project/llvm/test/CodeGen/X86/i1narrowfail.ll
Simon Pilgrim 18c8ed5416 [DAG] ReduceLoadOpStoreWidth - replace getABITypeAlign with allowsMemoryAccess (PR45116)
One of the cases identified in PR45116 - we don't need to limit store narrowing to ABI alignment, we can use allowsMemoryAccess - which tests using getABITypeAlign, but also checks if a target permits (fast) misaligned memory access by checking allowsMisalignedMemoryAccesses as a fallback.
2021-09-25 18:35:57 +01:00

25 lines
652 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s
define void @foo(i64* %ptr) {
; CHECK-LABEL: foo:
; CHECK: ## %bb.0:
; CHECK-NEXT: orb $16, (%rdi)
; CHECK-NEXT: retq
%r11 = load i64, i64* %ptr, align 8
%r12 = or i64 16, %r11
store i64 %r12, i64* %ptr, align 8
ret void
}
define void @foo_noalign(i64* %ptr) {
; CHECK-LABEL: foo_noalign:
; CHECK: ## %bb.0:
; CHECK-NEXT: orb $16, (%rdi)
; CHECK-NEXT: retq
%r11 = load i64, i64* %ptr, align 1
%r12 = or i64 16, %r11
store i64 %r12, i64* %ptr, align 1
ret void
}