summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-30 16:08:58 +0000
committerChris Lattner <sabre@nondot.org>2009-07-30 16:08:58 +0000
commitc667b60b93c8da12d79b78fdf20c061a17d0de11 (patch)
tree5ffac1069759c138c057ebb85604de3d5af306d0 /llvm
parent5656e4fcd357ddd11ab84360ae81275e5f0bb3f7 (diff)
downloadbcm5719-llvm-c667b60b93c8da12d79b78fdf20c061a17d0de11.tar.gz
bcm5719-llvm-c667b60b93c8da12d79b78fdf20c061a17d0de11.zip
add a random codegen deficiency.
llvm-svn: 77598
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/ARM/README.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/README.txt b/llvm/lib/Target/ARM/README.txt
index a587a2bf7ea..08435c57ebb 100644
--- a/llvm/lib/Target/ARM/README.txt
+++ b/llvm/lib/Target/ARM/README.txt
@@ -546,3 +546,49 @@ We need to fix constant isel for ARMv6t2 to use MOVT.
Constant island pass should make use of full range SoImm values for LEApcrel.
Be careful though as the last attempt caused infinite looping on lencod.
+
+//===---------------------------------------------------------------------===//
+
+Predication issue. This function:
+
+extern unsigned array[ 128 ];
+int foo( int x ) {
+ int y;
+ y = array[ x & 127 ];
+ if ( x & 128 )
+ y = 123456789 & ( y >> 2 );
+ else
+ y = 123456789 & y;
+ return y;
+}
+
+compiles to:
+
+_foo:
+ and r1, r0, #127
+ ldr r2, LCPI1_0
+ ldr r2, [r2]
+ ldr r1, [r2, +r1, lsl #2]
+ mov r2, r1, lsr #2
+ tst r0, #128
+ moveq r2, r1
+ ldr r0, LCPI1_1
+ and r0, r2, r0
+ bx lr
+
+It would be better to do something like this, to fold the shift into the
+conditional move:
+
+ and r1, r0, #127
+ ldr r2, LCPI1_0
+ ldr r2, [r2]
+ ldr r1, [r2, +r1, lsl #2]
+ tst r0, #128
+ movne r1, r1, lsr #2
+ ldr r0, LCPI1_1
+ and r0, r1, r0
+ bx lr
+
+it saves an instruction and a register.
+
+//===---------------------------------------------------------------------===//
OpenPOWER on IntegriCloud