Add CalledValuePropagation pass
authorMatthew Simpson <mssimpso@codeaurora.org>
Wed, 25 Oct 2017 13:40:08 +0000 (13:40 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Wed, 25 Oct 2017 13:40:08 +0000 (13:40 +0000)
commitcb58558c2f680199ae7d9085c5f58d5e127e6f57
tree460a2ada335c943a548094a25f65209bbaec4dd8
parent7af3edc4f4f19f0b216378b8e8c8677ce8dbafa2
Add CalledValuePropagation pass

This patch adds a new pass for attaching !callees metadata to indirect call
sites. The pass propagates values to call sites by performing an IPSCCP-like
analysis using the generic sparse propagation solver. For indirect call sites
having a small set of possible callees, the attached metadata indicates what
those callees are. The metadata can be used to facilitate optimizations like
intersecting the function attributes of the possible callees, refining the call
graph, performing indirect call promotion, etc.

Differential Revision: https://reviews.llvm.org/D37355

llvm-svn: 316576
17 files changed:
llvm/include/llvm-c/Transforms/IPO.h
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/LinkAllPasses.h
llvm/include/llvm/Transforms/IPO.h
llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h [new file with mode: 0644]
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/IPO/CMakeLists.txt
llvm/lib/Transforms/IPO/CalledValuePropagation.cpp [new file with mode: 0644]
llvm/lib/Transforms/IPO/IPO.cpp
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/test/Other/new-pm-defaults.ll
llvm/test/Other/new-pm-lto-defaults.ll
llvm/test/Other/new-pm-thinlto-defaults.ll
llvm/test/Transforms/CalledValuePropagation/simple-arguments.ll [new file with mode: 0644]
llvm/test/Transforms/CalledValuePropagation/simple-memory.ll [new file with mode: 0644]
llvm/test/Transforms/CalledValuePropagation/simple-select.ll [new file with mode: 0644]