@@ -859,32 +859,35 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
859
859
}
860
860
861
861
cir::LoadOp createLoad (mlir::Location loc, Address addr,
862
- bool isVolatile = false ) {
862
+ bool isVolatile = false , bool isNontemporal = false ) {
863
863
auto ptrTy = mlir::dyn_cast<cir::PointerType>(addr.getPointer ().getType ());
864
864
if (addr.getElementType () != ptrTy.getPointee ())
865
865
addr = addr.withPointer (
866
866
createPtrBitcast (addr.getPointer (), addr.getElementType ()));
867
867
868
868
return create<cir::LoadOp>(
869
869
loc, addr.getElementType (), addr.getPointer (), /* isDeref=*/ false ,
870
- /* is_volatile=*/ isVolatile, /* alignment=*/ mlir::IntegerAttr{},
870
+ /* is_volatile=*/ isVolatile, /* is_nontemporal=*/ isNontemporal,
871
+ /* alignment=*/ mlir::IntegerAttr{},
871
872
/* mem_order=*/ cir::MemOrderAttr{}, /* tbaa=*/ cir::TBAAAttr{});
872
873
}
873
874
874
875
cir::LoadOp createAlignedLoad (mlir::Location loc, mlir::Type ty,
875
876
mlir::Value ptr, llvm::MaybeAlign align,
876
- bool isVolatile) {
877
+ bool isVolatile, bool isNontemporal ) {
877
878
if (ty != mlir::cast<cir::PointerType>(ptr.getType ()).getPointee ())
878
879
ptr = createPtrBitcast (ptr, ty);
879
880
uint64_t alignment = align ? align->value () : 0 ;
880
- return CIRBaseBuilderTy::createLoad (loc, ptr, isVolatile, alignment);
881
+ return CIRBaseBuilderTy::createLoad (loc, ptr, isVolatile, isNontemporal,
882
+ alignment);
881
883
}
882
884
883
885
cir::LoadOp createAlignedLoad (mlir::Location loc, mlir::Type ty,
884
886
mlir::Value ptr, llvm::MaybeAlign align) {
885
887
// TODO: make sure callsites shouldn't be really passing volatile.
886
888
assert (!cir::MissingFeatures::volatileLoadOrStore ());
887
- return createAlignedLoad (loc, ty, ptr, align, /* isVolatile=*/ false );
889
+ return createAlignedLoad (loc, ty, ptr, align, /* isVolatile=*/ false ,
890
+ /* isNontemporal=*/ false );
888
891
}
889
892
890
893
cir::LoadOp
@@ -894,11 +897,11 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
894
897
}
895
898
896
899
cir::StoreOp createStore (mlir::Location loc, mlir::Value val, Address dst,
897
- bool _volatile = false ,
900
+ bool isVolatile = false , bool isNontemporal = false ,
898
901
::mlir::IntegerAttr align = {},
899
902
cir::MemOrderAttr order = {}) {
900
- return CIRBaseBuilderTy::createStore (loc, val, dst.getPointer (), _volatile ,
901
- align, order);
903
+ return CIRBaseBuilderTy::createStore (loc, val, dst.getPointer (), isVolatile ,
904
+ isNontemporal, align, order);
902
905
}
903
906
904
907
cir::StoreOp createFlagStore (mlir::Location loc, bool val, mlir::Value dst) {
@@ -937,16 +940,17 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
937
940
cir::StoreOp
938
941
createAlignedStore (mlir::Location loc, mlir::Value val, mlir::Value dst,
939
942
clang::CharUnits align = clang::CharUnits::One(),
940
- bool _volatile = false , cir::MemOrderAttr order = {}) {
943
+ bool isVolatile = false , bool isNontemporal = false ,
944
+ cir::MemOrderAttr order = {}) {
941
945
llvm::MaybeAlign mayAlign = align.getAsAlign ();
942
946
mlir::IntegerAttr alignAttr;
943
947
if (mayAlign) {
944
948
uint64_t alignment = mayAlign ? mayAlign->value () : 0 ;
945
949
alignAttr = mlir::IntegerAttr::get (
946
950
mlir::IntegerType::get (dst.getContext (), 64 ), alignment);
947
951
}
948
- return CIRBaseBuilderTy::createStore (loc, val, dst, _volatile, alignAttr ,
949
- order);
952
+ return CIRBaseBuilderTy::createStore (loc, val, dst, isVolatile ,
953
+ isNontemporal, alignAttr, order);
950
954
}
951
955
952
956
// Convert byte offset to sequence of high-level indices suitable for
0 commit comments