forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MergeFunctions: Two different sized allocas are *not* the same
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237193 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
11fb964
commit 414a781
Showing
2 changed files
with
42 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,33 @@ | ||
; RUN: opt -mergefunc -S < %s | FileCheck %s | ||
|
||
;; Make sure that two different sized allocas are not treated as equal. | ||
|
||
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" | ||
|
||
%kv1 = type { i32, i32 } | ||
%kv2 = type { i8 } | ||
|
||
|
||
define void @a(i8 *%f) { | ||
%v = alloca %kv1, align 8 | ||
%f_2 = bitcast i8* %f to void (%kv1 *)* | ||
call void %f_2(%kv1 * %v) | ||
call void %f_2(%kv1 * %v) | ||
call void %f_2(%kv1 * %v) | ||
call void %f_2(%kv1 * %v) | ||
ret void | ||
} | ||
|
||
; CHECK-LABEL: define void @b | ||
; CHECK-NOT: call @a | ||
; CHECK: ret | ||
|
||
define void @b(i8 *%f) { | ||
%v = alloca %kv2, align 8 | ||
%f_2 = bitcast i8* %f to void (%kv2 *)* | ||
call void %f_2(%kv2 * %v) | ||
call void %f_2(%kv2 * %v) | ||
call void %f_2(%kv2 * %v) | ||
call void %f_2(%kv2 * %v) | ||
ret void | ||
} |