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.
For Mips 16, add the optimization where the 16 bit form of addiu sp c…
…an be used if the offset fits in 11 bits. This makes use of the fact that the abi requires sp to be 8 byte aligned so the actual offset can fit in 8 bits. It will be shifted left and sign extended before being actually used. The assembler or direct object emitter will shift right the 11 bit signed field by 3 bits. We don't need to deal with that here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175073 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Reed Kotler
committed
Feb 13, 2013
1 parent
f098620
commit 6b9d461
Showing
4 changed files
with
77 additions
and
3 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
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,31 @@ | ||
; RUN: llc -march=mipsel -mcpu=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=16 | ||
|
||
@i = global i32 25, align 4 | ||
@.str = private unnamed_addr constant [5 x i8] c"%i \0A\00", align 1 | ||
|
||
define void @p(i32* %i) nounwind { | ||
entry: | ||
ret void | ||
} | ||
|
||
|
||
define void @foo() nounwind { | ||
entry: | ||
%y = alloca [512 x i32], align 4 | ||
%x = alloca i32, align 8 | ||
%zz = alloca i32, align 4 | ||
%z = alloca i32, align 4 | ||
%0 = load i32* @i, align 4 | ||
%arrayidx = getelementptr inbounds [512 x i32]* %y, i32 0, i32 10 | ||
store i32 %0, i32* %arrayidx, align 4 | ||
%1 = load i32* @i, align 4 | ||
store i32 %1, i32* %x, align 8 | ||
call void @p(i32* %x) | ||
%arrayidx1 = getelementptr inbounds [512 x i32]* %y, i32 0, i32 10 | ||
call void @p(i32* %arrayidx1) | ||
ret void | ||
} | ||
; 16: save $ra, $s0, $s1, 2040 | ||
; 16: addiu $sp, -48 # 16 bit inst | ||
; 16: addiu $sp, 48 # 16 bit inst | ||
; 16: restore $ra, $s0, $s1, 2040 |