[NaryReassociate] allow candidate to have a different type
authorJingyue Wu <jingyue@google.com>
Fri, 18 Dec 2015 21:36:30 +0000 (21:36 +0000)
committerJingyue Wu <jingyue@google.com>
Fri, 18 Dec 2015 21:36:30 +0000 (21:36 +0000)
commit8ed8b4f3b1b0c5cc51008afeb88514cb307a8e83
tree7fa3da8a2d0d4be99812adfdab4e52b538faf9fc
parenta4c2a53b4bea34190608c04a1474cdc638c7a478
[NaryReassociate] allow candidate to have a different type

Summary:
If Candiadte may have a different type from GEP, we should bitcast or
pointer cast it to GEP's type so that the later RAUW doesn't complain.

Added a test in nary-gep.ll

Reviewers: tra, meheff

Subscribers: mcrosier, llvm-commits, jholewinski

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

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