OSDN Git Service

Use AA in LoadCombine
authorHal Finkel <hfinkel@anl.gov>
Mon, 3 Nov 2014 23:19:16 +0000 (23:19 +0000)
committerHal Finkel <hfinkel@anl.gov>
Mon, 3 Nov 2014 23:19:16 +0000 (23:19 +0000)
commitcd9acde7f39a8fc268a5cdd79d6f3035f247db97
tree971ac3e12969849369c7578c2f54b6a35825a155
parent42090c633f2b0fc00844f05cfe1da736a65a8790
Use AA in LoadCombine

LoadCombine can be smarter about aborting when a writing instruction is
encountered, instead of aborting upon encountering any writing instruction, use
an AliasSetTracker, and only abort when encountering some write that might
alias with the loads that could potentially be combined.

This was originally motivated by comments made (and a test case provided) by
David Majnemer in response to PR21448. It turned out that LoadCombine was not
responsible for that PR, but LoadCombine should also be improved so that
unrelated stores (and @llvm.assume) don't interrupt load combining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221203 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/AliasSetTracker.h
lib/Analysis/AliasSetTracker.cpp
lib/Transforms/Scalar/LoadCombine.cpp
test/Transforms/LoadCombine/load-combine-aa.ll [new file with mode: 0644]
test/Transforms/LoadCombine/load-combine-assume.ll [new file with mode: 0644]