[Attributor] ValueSimplify Abstract Attribute
authorHideto Ueno <uenoku.tokotoko@gmail.com>
Sat, 7 Sep 2019 07:03:05 +0000 (07:03 +0000)
committerHideto Ueno <uenoku.tokotoko@gmail.com>
Sat, 7 Sep 2019 07:03:05 +0000 (07:03 +0000)
commitf2b9dc4758e6265c55ad578a56e9a1b27c86e797
tree35944d819d6d96920d733c45a271c6f707870060
parent7faffd544b16f851a632d6b8f93e3c8485ff34bb
[Attributor] ValueSimplify Abstract Attribute

Summary:
This patch introduces initial `AAValueSimplify` which simplifies a value in a context.

example
- (for function returned) If all the return values are the same and constant, then we can replace callsite returned with the constant.
- If an internal function takes the same value(constant) as an argument in the callsite, then we can replace the argument with that constant.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 371291
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/test/Transforms/FunctionAttrs/align.ll
llvm/test/Transforms/FunctionAttrs/noreturn_sync.ll
llvm/test/Transforms/FunctionAttrs/nounwind.ll
llvm/test/Transforms/FunctionAttrs/value-simplify.ll [new file with mode: 0644]