-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[AArch64][SVE] Fix definition of bfloat fcvt intrinsics. #110281
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 |
---|---|---|
|
@@ -5549,10 +5549,17 @@ static SDValue getSVEPredicateBitCast(EVT VT, SDValue Op, SelectionDAG &DAG) { | |
"Only expect to cast between legal scalable predicate types!"); | ||
|
||
// Return the operand if the cast isn't changing type, | ||
// e.g. <n x 16 x i1> -> <n x 16 x i1> | ||
if (InVT == VT) | ||
return Op; | ||
|
||
// Look through casts to <vscale x 16 x i1> when their input has more lanes | ||
// than VT. This will increase the chances of removing casts that introduce | ||
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. Perhaps better written as 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. I knew something was odd when I was writing it but couldn't figure it out :) I'll change it to 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. Done, plus removed another redundant reference to |
||
// new lanes, which have to be explicitly zero'd. | ||
if (Op.getOpcode() == ISD::INTRINSIC_WO_CHAIN && | ||
Op.getConstantOperandVal(0) == Intrinsic::aarch64_sve_convert_to_svbool && | ||
Op.getOperand(1).getValueType().bitsGT(VT)) | ||
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. Is this something that should have been caught by the SVEIntrinsicOpts pass? 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. No. At the IR level the conversion is a two step process because you have to cast through the "svbool" type. i.e. There is no intrinsic that will convert |
||
Op = Op.getOperand(1); | ||
|
||
SDValue Reinterpret = DAG.getNode(AArch64ISD::REINTERPRET_CAST, DL, VT, Op); | ||
|
||
// We only have to zero the lanes if new lanes are being defined, e.g. when | ||
|
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.
Given we won't get any IR verification of the old intrinsic, is it worth asserting or reporting an error if the predicate isn't <vscale x 8 x i1> here?
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.