Skip to content

Commit 208257f

Browse files
committed
[CoroElide] Remove unnecessary bitcast (NFCI)
No longer needed with opaque pointers.
1 parent 01ee03c commit 208257f

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

llvm/lib/Transforms/Coroutines/CoroElide.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,6 @@ class CoroIdElider {
8181
// provided constant.
8282
static void replaceWithConstant(Constant *Value,
8383
SmallVectorImpl<CoroSubFnInst *> &Users) {
84-
if (Users.empty())
85-
return;
86-
87-
// See if we need to bitcast the constant to match the type of the intrinsic
88-
// being replaced. Note: All coro.subfn.addr intrinsics return the same type,
89-
// so we only need to examine the type of the first one in the list.
90-
Type *IntrTy = Users.front()->getType();
91-
Type *ValueTy = Value->getType();
92-
if (ValueTy != IntrTy) {
93-
// May need to tweak the function type to match the type expected at the
94-
// use site.
95-
assert(ValueTy->isPointerTy() && IntrTy->isPointerTy());
96-
Value = ConstantExpr::getBitCast(Value, IntrTy);
97-
}
98-
99-
// Now the value type matches the type of the intrinsic. Replace them all!
10084
for (CoroSubFnInst *I : Users)
10185
replaceAndRecursivelySimplify(I, Value);
10286
}

0 commit comments

Comments
 (0)