| commit | dded061f8524ed65304d04b315aa3b52f5947aff | [log] [tgz] |
|---|---|---|
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | Sat Aug 18 21:25:22 2012 +0000 |
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | Sat Aug 18 21:25:22 2012 +0000 |
| tree | 55dc056641a744d240e0614289b3637f45e21267 | |
| parent | aab43dbfbbac19cc51c22f2a09aba5d33919a7bb [diff] |
Also combine zext/sext into selects for ARM.
This turns common i1 patterns into predicated instructions:
(add (zext cc), x) -> (select cc (add x, 1), x)
(add (sext cc), x) -> (select cc (add x, -1), x)
For a function like:
unsigned f(unsigned s, int x) {
return s + (x>0);
}
We now produce:
cmp r1, #0
it gt
addgt.w r0, r0, #1
Instead of:
movs r2, #0
cmp r1, #0
it gt
movgt r2, #1
add r0, r2
llvm-svn: 162177