-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[DAG] Teach SelectionDAGBuilder to read parameter alignment of compressstore/expandload. #83763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -start-after=codegenprepare -stop-before finalize-isel | FileCheck %s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need -start-after? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is almost copied from originally existed file llvm/test/CodeGen/X86/masked_compressstore_isel.ll I think the reason is to avoid ScalarizeMaskedMemIntrin pass scalarizing the intrinsic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't that not happen if it's legal for the target? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. it doesn't happened for this case. I just guessed the reason about that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use update_mir_test_checks.py. I'll fix the compress store test to use the script and we can rebase this on top of that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rebase after bdfebc3 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rebased. |
||
|
||
define <8 x i16> @_Z3fooiPiPs(<8 x i16> %src, <8 x i1> %mask) #0 { | ||
; CHECK-LABEL: name: _Z3fooiPiPs | ||
; CHECK: bb.0.entry: | ||
; CHECK-NEXT: liveins: $xmm0, $xmm1 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:vr128x = COPY $xmm1 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr128x = COPY $xmm0 | ||
; CHECK-NEXT: [[VPSLLWZ128ri:%[0-9]+]]:vr128x = VPSLLWZ128ri [[COPY]], 15 | ||
; CHECK-NEXT: [[VPMOVW2MZ128rr:%[0-9]+]]:vk16wm = VPMOVW2MZ128rr killed [[VPSLLWZ128ri]] | ||
; CHECK-NEXT: [[VPEXPANDWZ128rmk:%[0-9]+]]:vr128x = VPEXPANDWZ128rmk [[COPY1]], killed [[VPMOVW2MZ128rr]], $noreg, 1, $noreg, 0, $noreg :: (load unknown-size from `ptr null`, align 1) | ||
; CHECK-NEXT: $xmm0 = COPY [[VPEXPANDWZ128rmk]] | ||
; CHECK-NEXT: RET 0, $xmm0 | ||
entry: | ||
%res = call <8 x i16> @llvm.masked.expandload.v8i16(ptr null, <8 x i1> %mask, <8 x i16> %src) | ||
ret <8 x i16> %res | ||
} | ||
|
||
define <8 x i16> @_Z3foo2iPiPs(<8 x i16> %src, <8 x i1> %mask) #0 { | ||
; CHECK-LABEL: name: _Z3foo2iPiPs | ||
; CHECK: bb.0.entry: | ||
; CHECK-NEXT: liveins: $xmm0, $xmm1 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:vr128x = COPY $xmm1 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr128x = COPY $xmm0 | ||
; CHECK-NEXT: [[VPSLLWZ128ri:%[0-9]+]]:vr128x = VPSLLWZ128ri [[COPY]], 15 | ||
; CHECK-NEXT: [[VPMOVW2MZ128rr:%[0-9]+]]:vk16wm = VPMOVW2MZ128rr killed [[VPSLLWZ128ri]] | ||
; CHECK-NEXT: [[VPEXPANDWZ128rmk:%[0-9]+]]:vr128x = VPEXPANDWZ128rmk [[COPY1]], killed [[VPMOVW2MZ128rr]], $noreg, 1, $noreg, 0, $noreg :: (load unknown-size from `ptr null`, align 16) | ||
; CHECK-NEXT: $xmm0 = COPY [[VPEXPANDWZ128rmk]] | ||
; CHECK-NEXT: RET 0, $xmm0 | ||
entry: | ||
%res = call <8 x i16> @llvm.masked.expandload.v8i16(ptr align 16 null, <8 x i1> %mask, <8 x i16> %src) | ||
ret <8 x i16> %res | ||
} | ||
|
||
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: write) | ||
declare <8 x i16> @llvm.masked.expandload.v8i16(ptr, <8 x i1>, <8 x i16>) | ||
|
||
attributes #0 = { "target-cpu"="icelake-server" } | ||
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: write) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
were any tests passing 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LangRef tells that the alignment value of masked.load/store should be power of 2, so I think we could ignore the case.