Skip to content

check_cfc: dash g generate different code with machine-cp #43767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
llvmbot opened this issue Jan 1, 2020 · 3 comments
Open

check_cfc: dash g generate different code with machine-cp #43767

llvmbot opened this issue Jan 1, 2020 · 3 comments
Labels
bugzilla Issues migrated from bugzilla llvm:codegen

Comments

@llvmbot
Copy link
Member

llvmbot commented Jan 1, 2020

Bugzilla Link 44422
Version trunk
OS Linux
Depends On #43779
Blocks #37076
Reporter LLVM Bugzilla Contributor
CC @jmorse,@pogo59

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++ $HOME/test-suite/MultiSource/Benchmarks/Bullet/btConvexConvexAlgorithm.cpp -w -c -O2 -I $HOME/test-suite/MultiSource/Benchmarks/Bullet/include -o tmp.ll

[result]
Check CFC, checking: dash_g_no_change, dash_s_no_change
/home/chris/test-suite/MultiSource/Benchmarks/Bullet/btConvexConvexAlgorithm.cpp Code difference detected with -g
--- /tmp/tmpKmXkNI.o

+++ /tmp/tmp7GmGG6.o

@@ -254,6 +254,6 @@

  39c:	f3 41 0f 10 74 85 28 	movss  0x28(%r13,%rax,4),%xmm6
  3a3:	f3 45 0f 10 74 8d 28 	movss  0x28(%r13,%rcx,4),%xmm14
  3aa:	75 06                	jne    3b2 <_ZN23btConvexConvexAlgorithm16processCollisionEP17btCollisionObjectS1_RK16btDispatcherInfoP16btManifoldResult+0x1e2>
  • 3ac:	0f 8b 7f 11 00 00    	jnp    1531 <_ZN23btConvexConvexAlgorithm16processCollisionEP17btCollisionObjectS1_RK16btDispatcherInfoP16btManifoldResult+0x1361>
    
  • 3ac:	0f 8b 82 11 00 00    	jnp    1534 <_ZN23btConvexConvexAlgorithm16processCollisionEP17btCollisionObjectS1_RK16btDispatcherInfoP16btManifoldResult+0x1364>
    3b2:	0f 28 cd             	movaps %xmm5,%xmm1
    3b5:	f3 0f 59 cf          	mulss  %xmm7,%xmm1
    

*** Diff truncated ***

@llvmbot
Copy link
Member Author

llvmbot commented Jan 1, 2020

Analysis about this issue:

[Simply reproduce]
clang++ $HOME/test-suite/MultiSource/Benchmarks/Bullet/btConvexConvexAlgorithm.cpp -w -c -mllvm -opt-bisect-limit=6173 -O2 -I $HOME/test-suite/MultiSource/Benchmarks/Bullet/include -o out1.o 2>log1
objdump -d -j .text out1.o > out1.obj
clang++ -g $HOME/test-suite/MultiSource/Benchmarks/Bullet/btConvexConvexAlgorithm.cpp -w -c -mllvm -opt-bisect-limit=6179 -O2 -I $HOME/test-suite/MultiSource/Benchmarks/Bullet/include -o out2.o 2>log2
objdump -d -j .text out2.o > out2.obj
colordiff out1.obj out2.obj

[Root cause]
the DBG_VALUE break (669) Machine Copy Propagation PASS to handle BackwardCopyPropagateBlock() for LEA64 and COPY.

Case1: (with no debug value)

BB:
renamable $rbp = nuw LEA64r %stack.4, 1, $noreg, 64, $noreg
renamable $r8 = COPY killed renamable $rbp

Result:
MCP: Replacing $rbp
with $r8
renamable $r8 = nuw LEA64r %stack.4.input, 1, $noreg, 64, $noreg

Case2: (-g: with debug value)

BB:
renamable $rbp = nuw LEA64r %stack.4, 1, $noreg, 64, $noreg
DBG_VALUE
renamable $r8 = COPY killed renamable $rbp

Result: (MCP will not replace $rbp with $r8)
renamable $rbp = nuw LEA64r %stack.4, 1, $noreg, 64, $noreg
DBG_VALUE
renamable $r8 = COPY killed renamable $rbp

@llvmbot
Copy link
Member Author

llvmbot commented Jan 1, 2020

[Root cause]
the DBG_VALUE break (669) Machine Copy Propagation PASS to handle
BackwardCopyPropagateBlock() for LEA64 and COPY.

Correct "669" with "6173":
BISECT: running pass (6173) Machine Copy Propagation Pass on function (_ZN23btConvexConvexAlgorithm16processCollisionEP17btCollisionObjectS1_RK16btDispatcherInfoP16btManifoldResult)

@llvmbot
Copy link
Member Author

llvmbot commented Nov 27, 2021

mentioned in issue #43779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm:codegen
Projects
None yet
Development

No branches or pull requests

1 participant