Skip to content

Commit 70856b8

Browse files
committed
fix c scalar binop assign complex unecessary atom nesting
1 parent 8203f28 commit 70856b8

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

clang/lib/CodeGen/CGExprComplex.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,8 @@ EmitComplexCompoundAssignmentLValue(const CompoundAssignOperator *E) {
15501550
LValue CodeGenFunction::
15511551
EmitScalarCompoundAssignWithComplex(const CompoundAssignOperator *E,
15521552
llvm::Value *&Result) {
1553-
ApplyAtomGroup Grp(getDebugInfo());
1553+
// Key Instructions: Don't need to create an atom group here; one will already
1554+
// be active through scalar handling code.
15541555
CompoundFunc Op = getComplexOp(E->getOpcode());
15551556
RValue Val;
15561557
LValue Ret = ComplexExprEmitter(*this).EmitCompoundAssignLValue(E, Op, Val);

clang/test/DebugInfo/KeyInstructions/complex.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ void test() {
5454

5555
#ifndef __cplusplus
5656
// CHECK-C: %2 = load float, ptr @f, align 4
57-
// CHECK-C: %add.r24 = fadd float %2, %ci.real22, !dbg [[G9R2:!.*]]
58-
// CHECK-C: store float %add.r24, ptr @f, align 4, !dbg [[G9R1:!.*]]
57+
// CHECK-C: %add.r24 = fadd float %2, %ci.real22, !dbg [[G8R2:!.*]]
58+
// CHECK-C: store float %add.r24, ptr @f, align 4, !dbg [[G8R1:!.*]]
5959
f += ci;
6060

6161
// CHECK-C: %3 = load float, ptr @f, align 4
62-
// CHECK-C: %sub.r27 = fsub float %3, %ci.real25, !dbg [[G11R2:!.*]]
63-
// CHECK-C: store float %sub.r27, ptr @f, align 4, !dbg [[G11R1:!.*]]
62+
// CHECK-C: %sub.r27 = fsub float %3, %ci.real25, !dbg [[G9R2:!.*]]
63+
// CHECK-C: store float %sub.r27, ptr @f, align 4, !dbg [[G9R1:!.*]]
6464
f -= ci;
6565

66-
// CHECK-C: %coerce32.real = load float, ptr %coerce32.realp, align 4, !dbg [[G13R2:!.*]]
67-
// CHECK-C: store float %coerce32.real, ptr @f, align 4, !dbg [[G13R1:!.*]]
66+
// CHECK-C: %coerce32.real = load float, ptr %coerce32.realp, align 4, !dbg [[G10R2:!.*]]
67+
// CHECK-C: store float %coerce32.real, ptr @f, align 4, !dbg [[G10R1:!.*]]
6868
f /= ci;
6969

70-
// CHECK-C: %mul.rl = fmul float %5, %ci.real33, !dbg [[G15R2:!.*]]
71-
// CHECK-C: store float %mul.rl, ptr @f, align 4, !dbg [[G15R1:!.*]]
70+
// CHECK-C: %mul.rl = fmul float %5, %ci.real33, !dbg [[G11R2:!.*]]
71+
// CHECK-C: store float %mul.rl, ptr @f, align 4, !dbg [[G11R1:!.*]]
7272
f *= ci;
7373
#endif
7474
}
@@ -88,11 +88,11 @@ void test() {
8888
// CHECK: [[G7R2]] = !DILocation({{.*}}, atomGroup: 7, atomRank: 2)
8989
// CHECK: [[G7R1]] = !DILocation({{.*}}, atomGroup: 7, atomRank: 1)
9090
// FIXME: These inc by 2 atom groups each time?
91+
// CHECK-C: [[G8R2]] = !DILocation({{.*}}, atomGroup: 8, atomRank: 2)
92+
// CHECK-C: [[G8R1]] = !DILocation({{.*}}, atomGroup: 8, atomRank: 1)
9193
// CHECK-C: [[G9R2]] = !DILocation({{.*}}, atomGroup: 9, atomRank: 2)
9294
// CHECK-C: [[G9R1]] = !DILocation({{.*}}, atomGroup: 9, atomRank: 1)
95+
// CHECK-C: [[G10R2]] = !DILocation({{.*}}, atomGroup: 10, atomRank: 2)
96+
// CHECK-C: [[G10R1]] = !DILocation({{.*}}, atomGroup: 10, atomRank: 1)
9397
// CHECK-C: [[G11R2]] = !DILocation({{.*}}, atomGroup: 11, atomRank: 2)
9498
// CHECK-C: [[G11R1]] = !DILocation({{.*}}, atomGroup: 11, atomRank: 1)
95-
// CHECK-C: [[G13R2]] = !DILocation({{.*}}, atomGroup: 13, atomRank: 2)
96-
// CHECK-C: [[G13R1]] = !DILocation({{.*}}, atomGroup: 13, atomRank: 1)
97-
// CHECK-C: [[G15R2]] = !DILocation({{.*}}, atomGroup: 15, atomRank: 2)
98-
// CHECK-C: [[G15R1]] = !DILocation({{.*}}, atomGroup: 15, atomRank: 1)

0 commit comments

Comments
 (0)