Skip to content

check_cfc: dash g generate different code with phi-node-elimination #43204

@llvmbot

Description

@llvmbot
Bugzilla Link 43859
Version trunk
OS Linux
Blocks #37076
Reporter LLVM Bugzilla Contributor
CC @gregbedwell,@pogo59,@vedantk

Extended Description

Debug Info should have no effect on codegen, using check_cfc to scan llvm_test_suite, find a bug here:

Reproduce:

$HOME/llvm-project/clang/utils/check_cfc/clang++ -w -c -O1 $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/7zip/Archive/SwfHandler.cpp -o tmp.ll -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/myWindows -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/include_windows

[result]
Check CFC, checking: dash_g_no_change, dash_s_no_change
/home/chris/test-suite/MultiSource/Benchmarks/7zip/CPP/7zip/Archive/SwfHandler.cpp Code difference detected with -g
--- /tmp/tmpGFtFSg.o

+++ /tmp/tmpBtaqgK.o

@@ -522,6 +522,6 @@

647: 41 54 push %r12
649: 53 push %rbx
64a: 48 83 ec 58 sub $0x58,%rsp

  • 64e: 4c 89 44 24 10 mov %r8,0x10(%rsp)
  • 653: 89 4c 24 18 mov %ecx,0x18(%rsp)
  • 64e: 4c 89 44 24 08 mov %r8,0x8(%rsp)
  • 653: 89 4c 24 10 mov %ecx,0x10(%rsp)
    657: 41 89 d6 mov %edx,%r14d
    *** Diff truncated ***

Reduce reproduce:

clang++ -S -O1 -mllvm -opt-bisect-limit=5449 $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/7zip/Archive/SwfHandler.cpp -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/myWindows -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/include_windows -o out1.s 2>log1
clang++ -g -S -O1 -mllvm -opt-bisect-limit=5453 $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/7zip/Archive/SwfHandler.cpp -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/myWindows -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP -I $HOME/test-suite/MultiSource/Benchmarks/7zip/CPP/include_windows -o out2.s 2>log2

[result]
out1.s:
1593 movq %r8, 16(%rsp) # 8-byte Spill
1594 movl %ecx, 24(%rsp) # 4-byte Spill
out2.s:
2745 movq %r8, 8(%rsp) # 8-byte Spill
2748 movl %ecx, 16(%rsp) # 4-byte Spill
log1:
BISECT: running pass (5449) Stack Slot Coloring on function
log2:
BISECT: running pass (5453) Stack Slot Coloring on function

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions