-
Notifications
You must be signed in to change notification settings - Fork 14
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
[AIE2P] End-to-End support of fifo store intrinsics #308
Conversation
case Intrinsic::aie2p_fifo_st_push_512_bfp16: | ||
case Intrinsic::aie2p_fifo_st_flush: | ||
case Intrinsic::aie2p_fifo_st_flush_conv: | ||
case Intrinsic::aie2p_fifo_st_flush_1d: |
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.
Would that be equivalent to what you call a normal aie2p_fifo_st_flush
followed by a ptr increment? Same for 2d/3d?
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.
I would hope so. And the architecture file calls it normal ;-)
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.
I was just wondering because we would then only need the aie2p_fifo_st_flush
instrinsic/builtin. And we could get the 1d/2d/3d versions using instruction selection combiners like we do for "normal" load/stores. But then we would probably need new G_AIE_FIFO_xxxx
opcodes, so it's probably not worth to do this now.
llvm/test/CodeGen/AIE/aie2p/GlobalIsel/inst-select-fifo-stores.mir
Outdated
Show resolved
Hide resolved
5de2dfb
to
25d6fdd
Compare
void test_fifo_st_flush_2d_byte(v16uint32 *&p, fifo_state_t &s, int off, | ||
int size1, addr_t &count1, int inc1) { | ||
return fifo_st_flush_2d_byte(p, s, off, size1, count1, inc1); | ||
} |
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.
Nit: This really is a huge file and it is pretty much impossible to review. It seems that in many cases, only the vector type changes. Do you think it would be possible to templatise all those test_xxxx
functions and run the same file multiple times with e.g. -DTYPE=v16uint32
, -DTYPE=v16int32
, etc.
At least I think that would work for the "flush" tests, because the vector type does not seem to appear in the check lines. For "push", we might have so write a test for each type, but there aren't that many push variants, so I think that's fine.
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.
I tried it but there is still the function label line which depends on the type.
07dda5e
to
eec639b
Compare
clang/lib/Headers/aie2p_ldst.h
Outdated
FIFO_ST_NORMAL(v32int16) | ||
FIFO_ST_NORMAL(v32uint16) | ||
FIFO_ST_NORMAL(v16int32) | ||
FIFO_ST_NORMAL(v16uint32) |
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.
Should #undef
these macros after their usage
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.
Done
clang/lib/Headers/aie2p_ldst.h
Outdated
@@ -81,4 +81,118 @@ INTRINSIC(v64uint16) unpack(v64uint8 v) { return unpack(v, __SIGN_UNSIGNED); } | |||
INTRINSIC(v128int8) unpack(v128int4 v) { return unpack(v, __SIGN_SIGNED); } | |||
INTRINSIC(v128uint8) unpack(v128uint4 v) { return unpack(v, __SIGN_UNSIGNED); } | |||
|
|||
#define FIFO_ST_PUSH_NORMAL(T) \ | |||
INTRINSIC(void) fifo_st_reset(T *&p, T v, fifo_state_t &s) { \ |
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 API also supports volatile
qualified pointers. Could you add those variants as well?
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.
Correction: I meant restrict
, not volatile
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.
I have added the versions with memory bank annotations and the restrict
qualifier. See the last fixup commit.
It would be good if you could squash the fixup commit with the original commit. This will help keep the commit history clean. |
I will do that later. Just wanted to show what the fixup commit fixed and when. |
be6981a
to
305332a
Compare
f85aa4e
to
74da324
Compare
// RUN: %clang -O1 --target=aie2 -nostdlibinc -S -emit-llvm %s -o - | FileCheck %s | ||
// RUN: %clang -O1 --target=aie2p -nostdlibinc -S -emit-llvm %s -o - | FileCheck %s |
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.
Noice
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.
LGTM. I cannot verify every line, but what I've seen is correct and our regression suite seems to confirm that. Nice work!
74da324
to
434e55e
Compare
434e55e
to
6840966
Compare
6840966
to
a33eb0a
Compare
No description provided.