summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-08-22 19:07:15 +0000
committerJames Molloy <james.molloy@arm.com>2016-08-22 19:07:15 +0000
commit5bf211426515970a0dd08e14a99c010911ff2d96 (patch)
tree5a903edce5acf3d5d11c3ebc52d35e162cb3c622 /llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
parent5b4f6c6b2870c2bd866d117a4e1fe1e45752cd9b (diff)
downloadbcm5719-llvm-5bf211426515970a0dd08e14a99c010911ff2d96.tar.gz
bcm5719-llvm-5bf211426515970a0dd08e14a99c010911ff2d96.zip
[SimplifyCFG] Rewrite SinkThenElseCodeToEnd
[Recommitting now an unrelated assertion in SROA is sorted out] The new version has several advantages: 1) IMSHO it's more readable and neater 2) It handles loads and stores properly 3) It can handle any number of incoming blocks rather than just two. I'll be taking advantage of this in a followup patch. With this change we can now finally sink load-modify-store idioms such as: if (a) return *b += 3; else return *b += 4; => %z = load i32, i32* %y %.sink = select i1 %a, i32 5, i32 7 %b = add i32 %z, %.sink store i32 %b, i32* %y ret i32 %b When this works for switches it'll be even more powerful. Round 4. This time we should handle all instructions correctly, and not replace any operands that need to be constant with variables. This was really hard to determine safely, so the helper function should be put into the Instruction API. I'll do that as a followup. llvm-svn: 279460
Diffstat (limited to 'llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll')
-rw-r--r--llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll b/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
index 79e8e68e2f5..78d3ebf371a 100644
--- a/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
+++ b/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
@@ -106,7 +106,7 @@ if.then:
if.else:
store i32 3, i32* %p, align 4
- %incdec.ptr5 = getelementptr inbounds i32, i32* %p, i32 2
+ %incdec.ptr5 = getelementptr inbounds i32, i32* %p, i32 3
store i32 5, i32* %incdec.ptr1, align 4
store i32 6, i32* %incdec.ptr5, align 4
br label %if.end
OpenPOWER on IntegriCloud