================
@@ -21,6 +21,48 @@
 using namespace clang;
 using namespace clang::CIRGen;
 
+/// Get integer from a mlir::Value that is an int constant or a constant op.
+static int64_t getIntValueFromConstOp(mlir::Value val) {
+  return val.getDefiningOp<cir::ConstantOp>().getIntValue().getSExtValue();
+}
+
+static mlir::Value emitClFlush(CIRGenFunction& cgf,
+                               const CallExpr* e,
+                               mlir::Value& op) {
+    mlir::Type voidTy = cir::VoidType::get(&cgf.getMLIRContext());
+    mlir::Location location = cgf.getLoc(e->getExprLoc());
+    return cir::LLVMIntrinsicCallOp::create(
+          cgf.getBuilder(), location, 
+          cgf.getBuilder().getStringAttr("x86.sse2.clflush"), voidTy, op)
+      .getResult();
+}
+
+static mlir::Value emitPrefetch(CIRGenFunction& cgf,
+                                const CallExpr* e,
+                                mlir::Value& addr,
+                                int64_t hint) {
+  CIRGenBuilderTy& builder = cgf.getBuilder();
+  mlir::Type voidTy = cir::VoidType::get(&cgf.getMLIRContext());
+  mlir::Type sInt32Ty = cir::IntType::get(&cgf.getMLIRContext(), 32, true);
----------------
andykaylor wrote:

```suggestion
  mlir::Type sInt32Ty = builder.getSIntNTy(32);
```

https://github.com/llvm/llvm-project/pull/167401
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to