| Issue |
180742
|
| Summary |
Unoptimal code with flags output and "asm goto"
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
ubizjak
|
The following testcase
```
void foo (void);
void bar (void);
void qux (void)
{
_Bool err;
asm goto ("#" :"=@ccz" (err) : : : lab);
if (err)
bar ();
return;
lab:
if (err)
foo ();
return;
}
```
compiles with `clang -O2` to:
```
# %bb.0:
#APP
#
#NO_APP
sete %al
# %bb.1:
testb %al, %al
je .LBB0_4
# %bb.2:
jmp bar # TAILCALL
.LBB0_3: # Inline asm indirect target
# Label of block must be emitted
je foo # TAILCALL
.LBB0_4:
retq
```
Please note unnecessary `sete %al / testb %al,%al / je ...` sequence that could be substituted with simple `jne ...`, as is the case after .LBB0_3 inline asm indirect target label.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs