[llvm-commits] [llvm] r126930 - /llvm/trunk/lib/Target/ARM/README.txt

Bob Wilson bob.wilson at apple.com
Wed Mar 2 22:39:09 PST 2011


Author: bwilson
Date: Thu Mar  3 00:39:09 2011
New Revision: 126930

URL: http://llvm.org/viewvc/llvm-project?rev=126930&view=rev
Log:
Add a readme entry for the redundant movw issue for pr9370.

Modified:
    llvm/trunk/lib/Target/ARM/README.txt

Modified: llvm/trunk/lib/Target/ARM/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/README.txt?rev=126930&r1=126929&r2=126930&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/README.txt (original)
+++ llvm/trunk/lib/Target/ARM/README.txt Thu Mar  3 00:39:09 2011
@@ -657,3 +657,27 @@
 
 //===---------------------------------------------------------------------===//
 
+When loading immediate constants with movt/movw, if there are multiple
+constants needed with the same low 16 bits, and those values are not live at
+the same time, it would be possible to use a single movw instruction, followed
+by multiple movt instructions to rewrite the high bits to different values.
+For example:
+
+  volatile store i32 -1, i32* inttoptr (i32 1342210076 to i32*), align 4,
+  !tbaa
+!0
+  volatile store i32 -1, i32* inttoptr (i32 1342341148 to i32*), align 4,
+  !tbaa
+!0
+
+is compiled and optimized to:
+
+    movw    r0, #32796
+    mov.w    r1, #-1
+    movt    r0, #20480
+    str    r1, [r0]
+    movw    r0, #32796    @ <= this MOVW is not needed, value is there already
+    movt    r0, #20482
+    str    r1, [r0]
+
+//===---------------------------------------------------------------------===//





More information about the llvm-commits mailing list