summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-18 07:22:02 +0000
committerChris Lattner <sabre@nondot.org>2005-09-18 07:22:02 +0000
commitb4b2530a1a89a80b0e6334c3a9f98ac1d6fbe8dc (patch)
tree33d5f04eb3bcef64e70b941178ee1f6b962bc461 /llvm/lib/Transforms/Utils/Local.cpp
parent797dee77053e4bbf0b95ae02ab725b279cf817ef (diff)
downloadbcm5719-llvm-b4b2530a1a89a80b0e6334c3a9f98ac1d6fbe8dc.tar.gz
bcm5719-llvm-b4b2530a1a89a80b0e6334c3a9f98ac1d6fbe8dc.zip
Refactor this code a bit and make it more general. This now compiles:
struct S { unsigned int i : 6, j : 11, k : 15; } b; void plus2 (unsigned int x) { b.j += x; } To: _plus2: lis r2, ha16(L_b$non_lazy_ptr) lwz r2, lo16(L_b$non_lazy_ptr)(r2) lwz r4, 0(r2) slwi r3, r3, 6 add r3, r4, r3 rlwimi r3, r4, 0, 26, 14 stw r3, 0(r2) blr instead of: _plus2: lis r2, ha16(L_b$non_lazy_ptr) lwz r2, lo16(L_b$non_lazy_ptr)(r2) lwz r4, 0(r2) rlwinm r5, r4, 26, 21, 31 add r3, r5, r3 rlwimi r4, r3, 6, 15, 25 stw r4, 0(r2) blr by eliminating an 'and'. I'm pretty sure this is as small as we can go :) llvm-svn: 23386
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud