[PATCH] D138899: [DAGCombiner] handle more store value forwarding

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 02:31:36 PST 2022


shchenz added inline comments.


================
Comment at: llvm/test/CodeGen/X86/fastcc-byval.ll:2
 ; RUN: llc < %s -tailcallopt=false | FileCheck %s
-; CHECK: movl 8(%esp), %eax
+; CHECK: movl $1, (%esp)
 ; CHECK: movl 8(%esp), %eax
----------------
Changing from:
```
_bar:                                   ## @bar
## %bb.0:
	subl	$12, %esp
	movl	$1, 8(%esp)
	movl	8(%esp), %eax
	movl	%eax, (%esp)
	calll	_foo
	movl	8(%esp), %eax
	addl	$12, %esp
	retl
```

To:
```
_bar:                                   ## @bar
## %bb.0:
	subl	$12, %esp
	movl	$1, 8(%esp)
	movl	$1, (%esp)
	calll	_foo
	movl	8(%esp), %eax
	addl	$12, %esp
	retl
```

Seems one load is saved, needs confirmation from X86 experts.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138899/new/

https://reviews.llvm.org/D138899



More information about the llvm-commits mailing list