-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][Flang][NFC] Replace use of vector.insertelement/extractelement
#143272
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
base: main
Are you sure you want to change the base?
[mlir][Flang][NFC] Replace use of vector.insertelement/extractelement
#143272
Conversation
This PR is part of the last step to remove `vector.extractelement` and `vector.insertelement` ops (RFC: https://discourse.llvm.org/t/rfc-psa-remove-vector-extractelement-and-vector-insertelement-ops-in-favor-of-vector-extract-and-vector-insert-ops) It replaces `vector.insertelement` and `vector.extractelement` with `vector.insert` and `vector.extract` in Flang. It looks like no lit tests are impacted.
@llvm/pr-subscribers-flang-fir-hlfir Author: Diego Caballero (dcaballe) ChangesThis PR is part of the last step to remove Full diff: https://github.com/llvm/llvm-project/pull/143272.diff 1 Files Affected:
diff --git a/flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp b/flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
index fcc91752552c3..6090f008adb1c 100644
--- a/flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
@@ -1685,7 +1685,7 @@ PPCIntrinsicLibrary::genVecExtract(mlir::Type resultType,
if (!isNativeVecElemOrderOnLE())
uremOp = convertVectorElementOrder(builder, loc, vecTyInfo, uremOp);
- return builder.create<mlir::vector::ExtractElementOp>(loc, varg0, uremOp);
+ return builder.create<mlir::vector::ExtractOp>(loc, varg0, uremOp);
}
// VEC_INSERT
@@ -1706,8 +1706,8 @@ PPCIntrinsicLibrary::genVecInsert(mlir::Type resultType,
if (!isNativeVecElemOrderOnLE())
uremOp = convertVectorElementOrder(builder, loc, vecTyInfo, uremOp);
- auto res{builder.create<mlir::vector::InsertElementOp>(loc, argBases[0],
- varg1, uremOp)};
+ auto res{
+ builder.create<mlir::vector::InsertOp>(loc, argBases[0], varg1, uremOp)};
return builder.create<fir::ConvertOp>(loc, vecTyInfo.toFirVectorType(), res);
}
|
kind ping :) |
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.
Look ok to me even I'm not super familiar with the ppc part of flang.
fyi @DanielCChen |
I see these LIT failures.
The error looks like this:
|
Thanks! Let me fix that. I didn't test with the powerpc target enabled |
This PR is part of the last step to remove
vector.extractelement
andvector.insertelement
ops (RFC: https://discourse.llvm.org/t/rfc-psa-remove-vector-extractelement-and-vector-insertelement-ops-in-favor-of-vector-extract-and-vector-insert-ops).It replaces
vector.insertelement
andvector.extractelement
withvector.insert
andvector.extract
in Flang. It looks like no lit tests are impacted?