diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-21 22:22:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-21 22:22:01 +0000 |
commit | dc7cc350889acf51bd1aa9a6b0165f0b7dde6912 (patch) | |
tree | 92b768779816cded76081062aa519bba9752e622 /llvm/lib/CodeGen/MachineCodeEmitter.cpp | |
parent | be8bb804c5529128efb3fe60c401ff46ed96fb2d (diff) | |
download | llvm-dc7cc350889acf51bd1aa9a6b0165f0b7dde6912.zip llvm-dc7cc350889acf51bd1aa9a6b0165f0b7dde6912.tar.gz llvm-dc7cc350889acf51bd1aa9a6b0165f0b7dde6912.tar.bz2 |
Implement a fixme. The helps loops that have induction variables of different
types in them. Instead of creating an induction variable for all types, it
creates a single induction variable and casts to the other sizes. This generates
this code:
no_exit: ; preds = %entry, %no_exit
%indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=4]
*** %j.0.0 = cast uint %indvar to short ; <short> [#uses=1]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%tmp.7 = getelementptr short* %P, uint %indvar ; <short*> [#uses=1]
store short %j.0.0, short* %tmp.7
%inc.0 = add int %indvar, 1 ; <int> [#uses=2]
%tmp.2 = setlt int %inc.0, %N ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
br bool %tmp.2, label %no_exit, label %loopexit
instead of:
no_exit: ; preds = %entry, %no_exit
%indvar = phi ushort [ %indvar.next, %no_exit ], [ 0, %entry ] ; <ushort> [#uses=2]
*** %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=3]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%indvar = cast ushort %indvar to short ; <short> [#uses=1]
%tmp.7 = getelementptr short* %P, uint %indvar ; <short*> [#uses=1]
store short %indvar, short* %tmp.7
%inc.0 = add int %indvar, 1 ; <int> [#uses=2]
%tmp.2 = setlt int %inc.0, %N ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1
*** %indvar.next = add ushort %indvar, 1
br bool %tmp.2, label %no_exit, label %loopexit
This is an improvement in register pressure, but probably doesn't happen that
often.
The more important fix will be to get rid of the redundant add.
llvm-svn: 13101
Diffstat (limited to 'llvm/lib/CodeGen/MachineCodeEmitter.cpp')
0 files changed, 0 insertions, 0 deletions