@@ -895,10 +895,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
895
895
896
896
cir::StoreOp createStore (mlir::Location loc, mlir::Value val, Address dst,
897
897
bool _volatile = false ,
898
- ::mlir::IntegerAttr align = {},
899
898
cir::MemOrderAttr order = {}) {
900
- return CIRBaseBuilderTy::createStore (loc, val, dst.getPointer (), _volatile,
901
- align, order);
899
+ return createAlignedStore (loc, val, dst.getPointer (), dst.getAlignment (),
900
+ _volatile, order);
901
+ }
902
+
903
+ cir::StoreOp
904
+ createAlignedStore (mlir::Location loc, mlir::Value val, mlir::Value dst,
905
+ clang::CharUnits align,
906
+ bool _volatile = false , cir::MemOrderAttr order = {}) {
907
+ llvm::MaybeAlign mayAlign = align.getAsAlign ();
908
+ uint64_t alignment = mayAlign ? mayAlign->value () : 0 ;
909
+ return CIRBaseBuilderTy::createStore (loc, val, dst, _volatile, alignment,
910
+ order);
902
911
}
903
912
904
913
cir::StoreOp createFlagStore (mlir::Location loc, bool val, mlir::Value dst) {
@@ -934,21 +943,6 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
934
943
return createVecShuffle (loc, vec1, vec1, mask);
935
944
}
936
945
937
- cir::StoreOp
938
- createAlignedStore (mlir::Location loc, mlir::Value val, mlir::Value dst,
939
- clang::CharUnits align = clang::CharUnits::One(),
940
- bool _volatile = false , cir::MemOrderAttr order = {}) {
941
- llvm::MaybeAlign mayAlign = align.getAsAlign ();
942
- mlir::IntegerAttr alignAttr;
943
- if (mayAlign) {
944
- uint64_t alignment = mayAlign ? mayAlign->value () : 0 ;
945
- alignAttr = mlir::IntegerAttr::get (
946
- mlir::IntegerType::get (dst.getContext (), 64 ), alignment);
947
- }
948
- return CIRBaseBuilderTy::createStore (loc, val, dst, _volatile, alignAttr,
949
- order);
950
- }
951
-
952
946
// Convert byte offset to sequence of high-level indices suitable for
953
947
// GlobalViewAttr. Ideally we shouldn't deal with low-level offsets at all
954
948
// but currently some parts of Clang AST, which we don't want to touch just
0 commit comments