Skip to content

Conversation

yotto3s
Copy link

@yotto3s yotto3s commented Sep 27, 2025

PR for #1791

@yotto3s yotto3s changed the title Add EhSetjmpOp to CIR dialect [CIR] Add EhSetjmpOp to CIR dialect Sep 27, 2025
@yotto3s yotto3s changed the title [CIR] Add EhSetjmpOp to CIR dialect [CIR] Add EhLongjmpOp to CIR dialect Sep 27, 2025
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after nit

def CIR_EhLongjmpOp : CIR_Op<"eh.longjmp"> {
let summary = "CIR longjmp operation";
let description = [{
Restore the environment (e.g., stack pointer, instruction pointer, signal mask, and other registers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it 80-cols

Copy link
Collaborator

@xlauko xlauko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % nits

Address buf = emitPointerWithAlignment(E->getArg(0));
mlir::Location loc = getLoc(E->getExprLoc());

cir::PointerType ppTy = builder.getPointerTo(builder.getVoidPtrTy());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cir::PointerType ppTy = builder.getPointerTo(builder.getVoidPtrTy());
cir::PointerType ppTy = builder.getVoidPtrTy();
mlir::Value castBuf = builder.createBitcast(buf.getPointer(), ppTy);

Comment on lines +77 to +78
// LLVM-SAME: (ptr{{.*}}[[ENV:%.*]])
// LLVM-NEXT: @llvm.eh.sjlj.longjmp(ptr{{.*}}[[ENV]])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// LLVM-SAME: (ptr{{.*}}[[ENV:%.*]])
// LLVM-NEXT: @llvm.eh.sjlj.longjmp(ptr{{.*}}[[ENV]])
// LLVM: @llvm.eh.sjlj.longjmp

Comment on lines +82 to +83
// OGCG-SAME: (ptr{{.*}}[[ENV:%.*]])
// OGCG: @llvm.eh.sjlj.longjmp(ptr{{.*}}[[ENV]])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// OGCG-SAME: (ptr{{.*}}[[ENV:%.*]])
// OGCG: @llvm.eh.sjlj.longjmp(ptr{{.*}}[[ENV]])
// OGCG: @llvm.eh.sjlj.longjmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants