@@ -1117,6 +1118,122 @@ mlir::LogicalResult
CIRToLLVMBinOpLowering::matchAndRewrite(
return mlir::LogicalResult::success();
}
+mlir::LogicalResult CIRToLLVMBinOpOverflowOpLowering::matchAndRewrite(
+cir::BinOpOverflowOp op, OpAdaptor adaptor,
+mlir::ConversionPatter
@@ -1402,3 +1501,23 @@ mlir::Value
CIRGenFunction::emitScalarPrePostIncDec(const UnaryOperator *e,
return ScalarExprEmitter(*this, builder)
.emitScalarPrePostIncDec(e, lv, isInc, isPre);
}
+
+mlir::Value CIRGenFunction::emitCheckedInBoundsGEP(
+mlir::Type elemTy, m
@@ -936,8 +936,107 @@ getUnwidenedIntegerType(const ASTContext &astContext,
const Expr *e) {
static mlir::Value emitPointerArithmetic(CIRGenFunction &cgf,
const BinOpInfo &op,
bool isSubtraction)
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/133118
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -936,8 +936,107 @@ getUnwidenedIntegerType(const ASTContext &astContext,
const Expr *e) {
static mlir::Value emitPointerArithmetic(CIRGenFunction &cgf,
const BinOpInfo &op,
bool isSubtraction)
@@ -936,8 +936,107 @@ getUnwidenedIntegerType(const ASTContext &astContext,
const Expr *e) {
static mlir::Value emitPointerArithmetic(CIRGenFunction &cgf,
const BinOpInfo &op,
bool isSubtraction)
https://github.com/andykaylor commented:
I don't see the value of this PR right now. The pointer arithmetic isn't
performing the correct arithmetic, and nothing generates the binop.overflow op.
It would be more useful to remove the binop.overflow part and add PtrDiffOp.
https://github.com/llvm
@@ -1117,6 +1118,122 @@ mlir::LogicalResult
CIRToLLVMBinOpLowering::matchAndRewrite(
return mlir::LogicalResult::success();
}
+mlir::LogicalResult CIRToLLVMBinOpOverflowOpLowering::matchAndRewrite(
+cir::BinOpOverflowOp op, OpAdaptor adaptor,
+mlir::ConversionPatter
@@ -936,8 +936,107 @@ getUnwidenedIntegerType(const ASTContext &astContext,
const Expr *e) {
static mlir::Value emitPointerArithmetic(CIRGenFunction &cgf,
const BinOpInfo &op,
bool isSubtraction)
@@ -223,6 +223,16 @@ class CIRGenFunction : public CIRGenTypeCache {
void emitDecl(const clang::Decl &d);
+ /// Same as IRBuilder::CreateInBoundsGEP, but additionally emits a check to
+ /// detect undefined behavior when the pointer overflow sanitizer is enabled.
+ /// \
@@ -223,6 +223,16 @@ class CIRGenFunction : public CIRGenTypeCache {
void emitDecl(const clang::Decl &d);
+ /// Same as IRBuilder::CreateInBoundsGEP, but additionally emits a check to
+ /// detect undefined behavior when the pointer overflow sanitizer is enabled.
+ /// \
@@ -1117,6 +1118,122 @@ mlir::LogicalResult
CIRToLLVMBinOpLowering::matchAndRewrite(
return mlir::LogicalResult::success();
}
+mlir::LogicalResult CIRToLLVMBinOpOverflowOpLowering::matchAndRewrite(
+cir::BinOpOverflowOp op, OpAdaptor adaptor,
+mlir::ConversionPatter
llvmbot wrote:
@llvm/pr-subscribers-clangir
Author: Morris Hafner (mmha)
Changes
This was part of #132420 originally but split off to reduce the diff
size.
This patch adds support for overflowing binary operators and all the plumbing
required for pointer arithmetic except for the actual
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Morris Hafner (mmha)
Changes
This was part of #132420 originally but split off to reduce the diff
size.
This patch adds support for overflowing binary operators and all the plumbing
required for pointer arithmetic except for the actual O
mmha wrote:
cc @andykaylor @erichkeane @dkolsen-pgi
https://github.com/llvm/llvm-project/pull/133118
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/133118
This was part of #132420 originally but split off to reduce the diff size.
This patch adds support for overflowing binary operators and all the plumbing
required for pointer arithmetic except for the actual Ops (`P
16 matches
Mail list logo