@@ -859,32 +859,35 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
859859 }
860860
861861 cir::LoadOp createLoad (mlir::Location loc, Address addr,
862- bool isVolatile = false ) {
862+ bool isVolatile = false , bool isNontemporal = false ) {
863863 auto ptrTy = mlir::dyn_cast<cir::PointerType>(addr.getPointer ().getType ());
864864 if (addr.getElementType () != ptrTy.getPointee ())
865865 addr = addr.withPointer (
866866 createPtrBitcast (addr.getPointer (), addr.getElementType ()));
867867
868868 return create<cir::LoadOp>(
869869 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{},
871872 /* mem_order=*/ cir::MemOrderAttr{}, /* tbaa=*/ cir::TBAAAttr{});
872873 }
873874
874875 cir::LoadOp createAlignedLoad (mlir::Location loc, mlir::Type ty,
875876 mlir::Value ptr, llvm::MaybeAlign align,
876- bool isVolatile) {
877+ bool isVolatile, bool isNontemporal ) {
877878 if (ty != mlir::cast<cir::PointerType>(ptr.getType ()).getPointee ())
878879 ptr = createPtrBitcast (ptr, ty);
879880 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);
881883 }
882884
883885 cir::LoadOp createAlignedLoad (mlir::Location loc, mlir::Type ty,
884886 mlir::Value ptr, llvm::MaybeAlign align) {
885887 // TODO: make sure callsites shouldn't be really passing volatile.
886888 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 );
888891 }
889892
890893 cir::LoadOp
@@ -894,11 +897,11 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
894897 }
895898
896899 cir::StoreOp createStore (mlir::Location loc, mlir::Value val, Address dst,
897- bool _volatile = false ,
900+ bool isVolatile = false , bool isNontemporal = false ,
898901 ::mlir::IntegerAttr align = {},
899902 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);
902905 }
903906
904907 cir::StoreOp createFlagStore (mlir::Location loc, bool val, mlir::Value dst) {
@@ -937,16 +940,17 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
937940 cir::StoreOp
938941 createAlignedStore (mlir::Location loc, mlir::Value val, mlir::Value dst,
939942 clang::CharUnits align = clang::CharUnits::One(),
940- bool _volatile = false , cir::MemOrderAttr order = {}) {
943+ bool isVolatile = false , bool isNontemporal = false ,
944+ cir::MemOrderAttr order = {}) {
941945 llvm::MaybeAlign mayAlign = align.getAsAlign ();
942946 mlir::IntegerAttr alignAttr;
943947 if (mayAlign) {
944948 uint64_t alignment = mayAlign ? mayAlign->value () : 0 ;
945949 alignAttr = mlir::IntegerAttr::get (
946950 mlir::IntegerType::get (dst.getContext (), 64 ), alignment);
947951 }
948- return CIRBaseBuilderTy::createStore (loc, val, dst, _volatile, alignAttr ,
949- order);
952+ return CIRBaseBuilderTy::createStore (loc, val, dst, isVolatile ,
953+ isNontemporal, alignAttr, order);
950954 }
951955
952956 // Convert byte offset to sequence of high-level indices suitable for
0 commit comments