Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86] Enable forwarding bool arguments in tail calls (PR26305)
The code was previously not able to track a boolean argument at a call site back to the formal argument of the caller. Differential Revision: http://reviews.llvm.org/D17786 llvm-svn: 262575
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
; RUN: llc -mtriple=i686-unknown-linux-gnu -o - %s | FileCheck %s | ||
|
||
declare void @g_bool(i1 zeroext) | ||
define void @f_bool(i1 zeroext %x) { | ||
entry: | ||
tail call void @g_bool(i1 zeroext %x) | ||
ret void | ||
|
||
; Forwarding a bool in a tail call works. | ||
; CHECK-LABEL: f_bool: | ||
; CHECK-NOT: movz | ||
; CHECK: jmp g_bool | ||
} | ||
|
||
|
||
declare void @g_float(float) | ||
define void @f_i32(i32 %x) { | ||
entry: | ||
%0 = bitcast i32 %x to float | ||
tail call void @g_float(float %0) | ||
ret void | ||
|
||
; Forwarding a bitcasted value works too. | ||
; CHECK-LABEL: f_i32 | ||
; CHECK-NOT: mov | ||
; CHECK: jmp g_float | ||
} |