Templatize parts of VNCoercion, and add constant-only versions of the functions to...
authorDaniel Berlin <dberlin@dberlin.org>
Mon, 20 Mar 2017 16:08:29 +0000 (16:08 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Mon, 20 Mar 2017 16:08:29 +0000 (16:08 +0000)
commit12883b1673731839303444ad04984cf81dab396c
tree31690f9605bb83368614cd2b45456ad83d3a036e
parent6b42b3b7a3577d3d61a6d7552f147b6d2afef737
Templatize parts of VNCoercion, and add constant-only versions of the functions to be used in NewGVN.
NFCI.

Summary:
This is ground work for the changes to enable coercion in NewGVN.
GVN doesn't care if they end up constant because it eliminates as it goes.
NewGVN cares.

IRBuilder and ConstantFolder deliberately present the same interface,
so we use this to our advantage to templatize our functions to make
them either constant only or not.

Reviewers: davide

Subscribers: llvm-commits, Prazek

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

llvm-svn: 298262
llvm/include/llvm/Transforms/Utils/VNCoercion.h
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/lib/Transforms/Utils/VNCoercion.cpp