Skip to content

Commit 10522fd

Browse files
committed
Address code review comments
1 parent ea00ca2 commit 10522fd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3261,7 +3261,8 @@ def CIR_ComplexRealOp : CIR_Op<"complex.real", [Pure]> {
32613261
let summary = "Extract the real part of a complex value";
32623262
let description = [{
32633263
`cir.complex.real` operation takes an operand of `!cir.complex`, `!cir.int`
3264-
or `!cir.float` type and yields the real part of it.
3264+
or `!cir.float`. If the operand is `!cir.complex`, the real part of it will
3265+
be returned, otherwise the value returned unmodified.
32653266

32663267
Example:
32673268

clang/test/CIR/CodeGen/complex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ void real_on_scalar_glvalue() {
11401140
// CIR: %[[A_ADDR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["a"]
11411141
// CIR: %[[B_ADDR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["b", init]
11421142
// CIR: %[[TMP_A:.*]] = cir.load{{.*}} %[[A_ADDR]] : !cir.ptr<!cir.float>, !cir.float
1143-
// CIR: %[[A_REAL:.*]] = cir.complex.real %2 : !cir.float -> !cir.float
1143+
// CIR: %[[A_REAL:.*]] = cir.complex.real %[[TMP_A]] : !cir.float -> !cir.float
11441144
// CIR: cir.store{{.*}} %[[A_REAL]], %[[B_ADDR]] : !cir.float, !cir.ptr<!cir.float>
11451145

11461146
// LLVM: %[[A_ADDR:.*]] = alloca float, i64 1, align 4

0 commit comments

Comments
 (0)