aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ModuleManager.cpp
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 /clang/lib/Serialization/ModuleManager.cpp
parent5b4f6c6b2870c2bd866d117a4e1fe1e45752cd9b (diff)
downloadllvm-5bf211426515970a0dd08e14a99c010911ff2d96.zip
llvm-5bf211426515970a0dd08e14a99c010911ff2d96.tar.gz
llvm-5bf211426515970a0dd08e14a99c010911ff2d96.tar.bz2
[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 'clang/lib/Serialization/ModuleManager.cpp')
0 files changed, 0 insertions, 0 deletions