Before this patch foldBitCastBitwiseLogic limite the destination
must have an integer element type.
But we can still eliminate one bitcast by doing the logic op
in the type of the input that has an integer element type.
Paths
| Differential D126184
[InstCombine] bitcast(logic(bitcast(X), bitcast(Y))) --> bitcast'(logic(bitcast'(X), Y)) ClosedPublic Authored by Chenbing.Zheng on May 22 2022, 11:51 PM.
Details Summary Before this patch foldBitCastBitwiseLogic limite the destination But we can still eliminate one bitcast by doing the logic op
Diff Detail
Event TimelineComment Actions This seems fine, but we should improve the tests.
This revision is now accepted and ready to land.May 25 2022, 4:53 AM This revision was landed with ongoing or failed builds.May 25 2022, 8:04 PM Closed by commit rG41aab93afc23: [InstCombine] bitcast(logic(bitcast(X), bitcast(Y))) -> bitcast'(logic(bitcast'… (authored by Chenbing.Zheng). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 431290 llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/bitcast-inseltpoison.ll
llvm/test/Transforms/InstCombine/bitcast.ll
|
This is exactly the same test as the one in the earlier file? We should change it to provide more coverage. Vary the types, commute the operands, use xor, etc.
If we do not have (negative) tests with extra uses, please add those too.