summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2011-03-03 06:39:09 +0000
committerBob Wilson <bob.wilson@apple.com>2011-03-03 06:39:09 +0000
commitacc9e7315c450ca7cffd4a65c65e578211f9d945 (patch)
tree143610201d83da150635521b024df207f662dad2
parent2c11eb333c37edd5b15c1d05394861fdfc0eab90 (diff)
downloadllvm-acc9e7315c450ca7cffd4a65c65e578211f9d945.tar.gz
llvm-acc9e7315c450ca7cffd4a65c65e578211f9d945.tar.bz2
llvm-acc9e7315c450ca7cffd4a65c65e578211f9d945.tar.xz
Add a readme entry for the redundant movw issue for pr9370.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126930 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/README.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Target/ARM/README.txt b/lib/Target/ARM/README.txt
index 9fc3fb92cb..8ba9a27e95 100644
--- a/lib/Target/ARM/README.txt
+++ b/lib/Target/ARM/README.txt
@@ -657,3 +657,27 @@ Note that both "tst" and "moveq" are redundant.
//===---------------------------------------------------------------------===//
+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]
+
+//===---------------------------------------------------------------------===//