Skip to content

[MCA] ADC executed when carry not generated #62507

Open
@837951602

Description

@837951602
$ llvm-mca kkkk -mcpu=skylake -timeline --timeline-max-iterations=2 --timeline-max-cycles=999
...
Timeline view:
Index     01234567

[0,0]     DeER . .   addq	%r8, %r9
[0,1]     D=eER. .   adcq	%r10, %r11
[0,2]     D==eER .   adcq	%r12, %r13
[0,3]     D===eER.   adcq	%r14, %r15
[0,4]     DeE---R.   incq	%rax
[0,5]     D=eE--R.   adcq	%rbx, %rcx
[1,0]     .DeE--R.   addq	%r8, %r9
[1,1]     .D=eE-R.   adcq	%r10, %r11
[1,2]     .D==eER.   adcq	%r12, %r13
[1,3]     .D===eER   adcq	%r14, %r15
[1,4]     .DeE---R   incq	%rax
[1,5]     .D===eER   adcq	%rbx, %rcx

$ llvm-mca --version
Ubuntu LLVM version 17.0.0
  Optimized build.
  Default target: x86_64-pc-linux-gnu

[0,5] is executed on cycle 2 but relies on result from cycle 4.

Problem found while discussing https://stackoverflow.com/questions/76151320/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions