[NaryReassociate] Run EarlyCSE after NaryReassociate
authorJingyue Wu <jingyue@google.com>
Thu, 28 May 2015 04:56:52 +0000 (04:56 +0000)
committerJingyue Wu <jingyue@google.com>
Thu, 28 May 2015 04:56:52 +0000 (04:56 +0000)
commit4977e92629c117182240a0cd7a56067fefed8574
tree6de2481194a8b490ca942df97aaa394df660b512
parent9dacaea1a11e46f533aa8dad6a0c28ea4690e630
[NaryReassociate] Run EarlyCSE after NaryReassociate

Summary:
This patch made two improvements to NaryReassociate and the NVPTX pipeline

1. Run EarlyCSE/GVN after NaryReassociate to get rid of redundant common
expressions.

2. When adding an instruction to SeenExprs, maps both the SCEV before and after
reassociation to that instruction.

Test Plan: updated @reassociate_gep_nsw in nary-gep.ll

Reviewers: meheff, broune

Reviewed By: broune

Subscribers: dberlin, jholewinski, llvm-commits

Differential Revision: http://reviews.llvm.org/D9947

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238396 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/NVPTX/NVPTXTargetMachine.cpp
lib/Transforms/Scalar/NaryReassociate.cpp
test/Transforms/NaryReassociate/NVPTX/nary-gep.ll