Skip to content

Commit

Permalink
[PowerPC] Add test for #68783 (NFC)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0ead1fa)
  • Loading branch information
nikic authored and tru committed Oct 17, 2023
1 parent 7a23a5d commit 8ce6b65
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions llvm/test/CodeGen/PowerPC/and-extend-combine.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
; RUN: llc < %s -mtriple=powerpc64le-unknown-unknown -ppc-asm-full-reg-names \
; RUN: -mcpu=pwr8 -verify-machineinstrs | FileCheck %s

define dso_local ptr @foo(i32 noundef zeroext %arg, ptr nocapture noundef readonly %arg1, ptr noundef writeonly %arg2) local_unnamed_addr {
; CHECK-LABEL: foo:
; CHECK: # %bb.0: # %bb
Expand All @@ -21,3 +22,17 @@ bb:
%i8 = getelementptr inbounds i8, ptr %arg2, i64 %i7
ret ptr %i8
}

; FIXME: This is a miscompile.
define void @pr68783(i32 %x, ptr %p) {
; CHECK-LABEL: pr68783:
; CHECK: # %bb.0:
; CHECK-NEXT: rlwinm r3, r3, 31, 24, 31
; CHECK-NEXT: stw r3, 0(r4)
; CHECK-NEXT: blr
%lshr = lshr i32 %x, 1
%zext = zext i32 %lshr to i48
%and = and i48 %zext, 255
store i48 %and, ptr %p
ret void
}

0 comments on commit 8ce6b65

Please sign in to comment.