Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Unified Diff: tests_lit/llvm2ice_tests/alloc.ll

Issue 1361803002: Subzero: Improve handling of alloca instructions of constant size. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add a couple of basic tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/align-spill-locations.ll ('k') | tests_lit/llvm2ice_tests/ebp_args.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/alloc.ll
diff --git a/tests_lit/llvm2ice_tests/alloc.ll b/tests_lit/llvm2ice_tests/alloc.ll
index bd8c0e8b2f2083e1ebea72f820a3ed1279e2ee3d..b342d1e0e066ef6da669d11c2dbfe71ee98a88fb 100644
--- a/tests_lit/llvm2ice_tests/alloc.ll
+++ b/tests_lit/llvm2ice_tests/alloc.ll
@@ -221,3 +221,37 @@ entry:
; ARM32: add r0, r0, [[REG]]
; ARM32: and r0, r0, #-536870912 ; 0xe0000000
; ARM32: sub sp, sp, r0
+
+; Test that a simple alloca sequence doesn't trigger a frame pointer.
+define void @fixed_no_frameptr(i32 %arg) {
+entry:
+ %a1 = alloca i8, i32 8, align 4
+ %a2 = alloca i8, i32 12, align 4
+ %a3 = alloca i8, i32 16, align 4
+ %p1 = bitcast i8* %a1 to i32*
+ %p2 = bitcast i8* %a2 to i32*
+ %p3 = bitcast i8* %a3 to i32*
+ store i32 %arg, i32* %p1, align 1
+ store i32 %arg, i32* %p2, align 1
+ store i32 %arg, i32* %p3, align 1
+ ret void
+}
+; CHECK-LABEL: fixed_no_frameptr
+; CHECK-NOT: mov ebp,esp
+
+; Test that a more complex alloca sequence does trigger a frame pointer.
+define void @var_with_frameptr(i32 %arg) {
+entry:
+ %a1 = alloca i8, i32 8, align 4
+ %a2 = alloca i8, i32 12, align 4
+ %a3 = alloca i8, i32 %arg, align 4
+ %p1 = bitcast i8* %a1 to i32*
+ %p2 = bitcast i8* %a2 to i32*
+ %p3 = bitcast i8* %a3 to i32*
+ store i32 %arg, i32* %p1, align 1
+ store i32 %arg, i32* %p2, align 1
+ store i32 %arg, i32* %p3, align 1
+ ret void
+}
+; CHECK-LABEL: var_with_frameptr
+; CHECK: mov ebp,esp
« no previous file with comments | « tests_lit/llvm2ice_tests/align-spill-locations.ll ('k') | tests_lit/llvm2ice_tests/ebp_args.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698