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

Unified Diff: tests_lit/llvm2ice_tests/mips-address-mode-opt.ll

Issue 2313293002: [SubZero] Implement address optimization for MIPS (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 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 | « src/IceTargetLoweringMIPS32.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/mips-address-mode-opt.ll
diff --git a/tests_lit/llvm2ice_tests/mips-address-mode-opt.ll b/tests_lit/llvm2ice_tests/mips-address-mode-opt.ll
new file mode 100644
index 0000000000000000000000000000000000000000..1cb53c1eaad828bf90c4007de76cab8497d7f4dd
--- /dev/null
+++ b/tests_lit/llvm2ice_tests/mips-address-mode-opt.ll
@@ -0,0 +1,44 @@
+; This file checks support for address mode optimization.
+; This test file is same as address-mode-opt.ll however the functions in this
+; file are relevant to MIPS only.
+
+; RUN: %if --need=target_MIPS32 --need=allow_dump \
+; RUN: --command %p2i --filetype=asm --assemble --disassemble \
+; RUN: --target mips32 -i %s --args -O2 --skip-unimplemented \
+; RUN: -allow-externally-defined-symbols \
+; RUN: | %if --need=target_MIPS32 --need=allow_dump \
+; RUN: --command FileCheck --check-prefix MIPS32 %s
+
+define internal float @load_arg_plus_offset(float* %arg) {
+entry:
+ %arg.int = ptrtoint float* %arg to i32
+ %addr.int = add i32 %arg.int, 16
+ %addr.ptr = inttoptr i32 %addr.int to float*
+ %addr.load = load float, float* %addr.ptr, align 4
+ ret float %addr.load
+}
+; MIPS32-LABEL: load_arg_plus_offset
+; MIPS32: lwc1 $f0,16(a0)
+
+define internal float @load_arg_minus_offset(float* %arg) {
+entry:
+ %arg.int = ptrtoint float* %arg to i32
+ %addr.int = sub i32 %arg.int, 16
+ %addr.ptr = inttoptr i32 %addr.int to float*
+ %addr.load = load float, float* %addr.ptr, align 4
+ ret float %addr.load
+}
+; MIPS32-LABEL: load_arg_minus_offset
+; MIPS32 lwc1 $f0,-16(a0)
+
+define internal float @address_mode_opt_chaining(float* %arg) {
+entry:
+ %arg.int = ptrtoint float* %arg to i32
+ %addr1.int = add i32 12, %arg.int
+ %addr2.int = sub i32 %addr1.int, 4
+ %addr2.ptr = inttoptr i32 %addr2.int to float*
+ %addr2.load = load float, float* %addr2.ptr, align 4
+ ret float %addr2.load
+}
+; MIPS32-LABEL: address_mode_opt_chaining
+; MIPS32 lwc1 $f0,8(a0)
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698