-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for bfloat in VInsert PreLegalizerCombiner #243
base: aie-public
Are you sure you want to change the base?
Add support for bfloat in VInsert PreLegalizerCombiner #243
Conversation
d6afe1c
to
85d6911
Compare
llvm/test/CodeGen/AIE/aie2/GlobalISel/combine-set-extract-prelegalizer.mir
Outdated
Show resolved
Hide resolved
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 think this looks good, but I'm wondering if getting rid of aie2_set_bf512_bf256
in the frontend and using aie2_set_I512_I256
wouldn't be better
f10042d
to
39c7708
Compare
@@ -527,9 +527,9 @@ INTRINSIC(v32bfloat16) insert(v32bfloat16 a, int idx, v16bfloat16 b) { | |||
// Set 256-bit portion of 512-bit register | |||
INTRINSIC(v32bfloat16) set_v32bfloat16(int idx, v16bfloat16 b) { | |||
if (idx == 0) | |||
return __builtin_aiev2_set_bf512_bf256(b, 0); | |||
return __builtin_aiev2_set_I512_I256(b, 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.
This looks curious, all values different from 0 can be used as index 1
. I was wondering why not simply:
return __builtin_aiev2_set_I512_I256(b, idx == 0 ? 0 : 1);
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 think those headers were partly auto-generated, and for some intrinsics we have more than two different values. So I'd assume it's easier to write a generic generator if sticking to if
/else
.
39c7708
to
d234b71
Compare
MachineInstr * | ||
llvm::getDefIgnoringCopiesAndBitcasts(Register Reg, | ||
llvm::getDefIgnoringCopiesAndBitcasts(Register Reg, bool AllowMultiUse, | ||
const MachineRegisterInfo &MRI) { | ||
|
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.
You seem to never use AllowMultiUse=true
. Do you have future plans outside of this PR?
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.
Oh okay there is one use in matchExtractConcat
. I would be curious to see if allowing multiple uses in other combiners would help as well?
@@ -191,6 +191,7 @@ unsigned getVInsertScalarSize(unsigned IntrinsicID) { | |||
case Intrinsic::aie2_vinsert8_I512: | |||
return 8; | |||
case Intrinsic::aie2_vinsert16_I512: | |||
case Intrinsic::aie2_vinsert16_bf512: |
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 think we should also get rid of that intrinsic at some point
534837e
to
9d57d0f
Compare
9d57d0f
to
2c573c6
Compare
Add support for bfloat in SetExtract PreLegalizerCombiner
Add support for bfloat in VInsert PreLegalizerCombiner