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)
commit840257a49c26c5c7d66ee17eeaaf5a43fad0b9da
treeeda3b865cc17c5c710a5b6e8fe79d62e24a2b9e4
parent5b02a19f909bf7610c629ac1f16e79bd88a3d442
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.

llvm-svn: 221203
llvm/include/llvm/Analysis/AliasSetTracker.h
llvm/lib/Analysis/AliasSetTracker.cpp
llvm/lib/Transforms/Scalar/LoadCombine.cpp
llvm/test/Transforms/LoadCombine/load-combine-aa.ll [new file with mode: 0644]
llvm/test/Transforms/LoadCombine/load-combine-assume.ll [new file with mode: 0644]