Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mips][FastISel] Allow computation of addresses from constant express…
…ions. Summary: Try to compute addresses when the offset from a memory location is a constant expression. Based on a patch by Reed Kotler. Test Plan: Passes test-suite for -O0/O2 and mips 32 r1/r2 Reviewers: rkotler, dsanders Subscribers: llvm-commits, aemerson, rfuhler Differential Revision: http://reviews.llvm.org/D6767 llvm-svn: 237117
- Loading branch information
Vasileios Kalintiris
authored and
Vasileios Kalintiris
committed
May 12, 2015
1 parent
90476a5
commit 32cd69a
Showing
2 changed files
with
22 additions
and
2 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,18 @@ | ||
; RUN: llc -march=mipsel -mcpu=mips32 -relocation-model=pic \ | ||
; RUN: -fast-isel=true -mips-fast-isel -fast-isel-abort=1 < %s | FileCheck %s | ||
; RUN: llc -march=mipsel -mcpu=mips32r2 -relocation-model=pic \ | ||
; RUN: -fast-isel=true -mips-fast-isel -fast-isel-abort=1 < %s | FileCheck %s | ||
|
||
@ARR = external global [10 x i32], align 4 | ||
|
||
define void @foo() { | ||
; CHECK-LABEL: foo | ||
|
||
; CHECK-DAG: lw $[[ARR:[0-9]+]], %got(ARR)({{.*}}) | ||
; CHECK-DAG: addiu $[[T0:[0-9]+]], $zero, 12345 | ||
; CHECK: sw $[[T0]], 8($[[ARR]]) | ||
|
||
entry: | ||
store i32 12345, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @ARR, i32 0, i32 2), align 4 | ||
ret void | ||
} |