[PATCH] Fix a mergefunc crash caused by bitcasting intrinsics
Björn Steinbrink
bsteinbr at gmail.com
Wed Apr 23 01:06:37 PDT 2014
Yeah, that's what I meant earlier. The result would look like this:
if (!C1->getType()->canLosslesslyBitCastTo(C2->getType()))
return false;
Constant *C3 = ConstantExpr::getBitCast(const_cast<Constant*>(C2), C1->getType());
bool result = C1 == C3;
if (C3->use_empty())
C3->destroyConstant();
return result;
But I wonder if we really want that. Compared to the other patch, this means that we still create pointless bitcasts for functions, i.e. it's more expensive. And even if we apply both patches, that would mean that we would possibly create and destroy the same constant over and over again, each time the same V2 function is passed to enumerate again.
Which version do you prefer?
http://reviews.llvm.org/D3437
REPLY HANDLER ACTIONS
Reply to comment, or !reject, !abandon, !reclaim, !resign, !rethink, !unsubscribe.
More information about the llvm-commits
mailing list