@@ -682,19 +682,6 @@ mlir::LogicalResult CIRToLLVMStoreOpLowering::matchAndRewrite(
682
682
return mlir::LogicalResult::success ();
683
683
}
684
684
685
- // / Switches on the type of attribute and calls the appropriate conversion.
686
- mlir::Value lowerCirAttrAsValue (mlir::Operation *parentOp,
687
- const mlir::Attribute attr,
688
- mlir::ConversionPatternRewriter &rewriter,
689
- const mlir::TypeConverter *converter,
690
- mlir::DataLayout const &dataLayout) {
691
- CIRAttrToValue valueConverter (parentOp, rewriter, converter);
692
- const mlir::Value value = valueConverter.visit (attr);
693
- if (!value)
694
- llvm_unreachable (" unhandled attribute type" );
695
- return value;
696
- }
697
-
698
685
bool hasTrailingZeros (cir::ConstArrayAttr attr) {
699
686
auto array = mlir::dyn_cast<mlir::ArrayAttr>(attr.getElts ());
700
687
return attr.hasTrailingZeros () ||
@@ -749,16 +736,16 @@ mlir::LogicalResult CIRToLLVMConstantOpLowering::matchAndRewrite(
749
736
750
737
std::optional<mlir::Attribute> denseAttr;
751
738
if (constArr && hasTrailingZeros (constArr)) {
752
- const mlir::Value newOp = lowerCirAttrAsValue (
753
- op, constArr, rewriter, getTypeConverter (), dataLayout );
739
+ const mlir::Value newOp =
740
+ lowerCirAttrAsValue ( op, constArr, rewriter, getTypeConverter ());
754
741
rewriter.replaceOp (op, newOp);
755
742
return mlir::success ();
756
743
} else if (constArr &&
757
744
(denseAttr = lowerConstArrayAttr (constArr, typeConverter))) {
758
745
attr = denseAttr.value ();
759
746
} else {
760
- const mlir::Value initVal = lowerCirAttrAsValue (
761
- op, op.getValue (), rewriter, typeConverter, dataLayout );
747
+ const mlir::Value initVal =
748
+ lowerCirAttrAsValue ( op, op.getValue (), rewriter, typeConverter);
762
749
rewriter.replaceAllUsesWith (op, initVal);
763
750
rewriter.eraseOp (op);
764
751
return mlir::success ();
0 commit comments