[InstCombine] bitcast(logic(bitcast(X), bitcast(Y))) -> bitcast'(logic(bitcast'(X...
authorChenbing Zheng <Chenbing.Zheng@streamcomputing.com>
Thu, 26 May 2022 02:16:54 +0000 (10:16 +0800)
committerChenbing Zheng <Chenbing.Zheng@streamcomputing.com>
Thu, 26 May 2022 02:23:44 +0000 (10:23 +0800)
commit41aab93afc23e8f338c3617161e42d7ff54da74b
tree74fdd4ac92449f8cc52e1cf95e4b7a782486d1c3
parentb271488e8b13a2b776c2e80769a192607521687e
[InstCombine] bitcast(logic(bitcast(X), bitcast(Y))) -> bitcast'(logic(bitcast'(X), Y))

This patch break foldBitCastBitwiseLogic limite the destination
must have an integer element type, and eliminate one bitcast by
doing the logic op in the type of the input that has an integer
element type.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D126184
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/bitcast-inseltpoison.ll
llvm/test/Transforms/InstCombine/bitcast.ll