Skip to content

[Clang] fix for heterogeneous chip's host side's MaybeODRUseExprs clear #121085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions clang/lib/Sema/SemaStmtAsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
Expr *asmString, MultiExprArg clobbers,
unsigned NumLabels,
SourceLocation RParenLoc) {
struct _Cleaner {
Sema &S;
~_Cleaner() {
S.DiscardCleanupsInEvaluationContext();
}
} _C{*this};
unsigned NumClobbers = clobbers.size();

SmallVector<TargetInfo::ConstraintInfo, 4> OutputConstraintInfos;
Expand Down
13 changes: 13 additions & 0 deletions clang/test/SemaCUDA/hostside_no_assert.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// REQUIRES: nvptx-registered-target
// REQUIRES: x86-registered-target

// RUN: %clang_cc1 "-triple" "x86_64-unknown-linux-gnu" "-aux-triple" "nvptx64-nvidia-cuda" \
// RUN: "-target-cpu" "x86-64" "-fsyntax-only" %s

#include "Inputs/cuda.h"

typedef __attribute__((ext_vector_type(16))) float float32x16_t;
__device__ void test(float32x16_t& vodd) {
constexpr int pose = 16;
__asm__ __volatile__("vadd %0, %1, %2":"=&v"(vodd):"r"(pose),"v"(vodd));
}