Skip to content

Commit 5dc8c0d

Browse files
committed
[IR] Remove remaining unnecessary bitcasts
1 parent be160bb commit 5dc8c0d

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9005,11 +9005,6 @@ static SDValue getMemCmpLoad(const Value *PtrVal, MVT LoadVT,
90059005
Type::getIntNTy(PtrVal->getContext(), LoadVT.getScalarSizeInBits());
90069006
if (LoadVT.isVector())
90079007
LoadTy = FixedVectorType::get(LoadTy, LoadVT.getVectorNumElements());
9008-
9009-
LoadInput =
9010-
ConstantExpr::getBitCast(const_cast<Constant *>(LoadInput),
9011-
PointerType::getUnqual(LoadTy->getContext()));
9012-
90139008
if (const Constant *LoadCst =
90149009
ConstantFoldLoadFromConstPtr(const_cast<Constant *>(LoadInput),
90159010
LoadTy, Builder.DAG.getDataLayout()))

llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,9 +1762,6 @@ void ObjCARCOpt::MoveCalls(Value *Arg, RRInfo &RetainsToMove,
17621762
DenseMap<Value *, RRInfo> &Releases,
17631763
SmallVectorImpl<Instruction *> &DeadInsts,
17641764
Module *M) {
1765-
Type *ArgTy = Arg->getType();
1766-
Type *ParamTy = PointerType::getUnqual(ArgTy->getContext());
1767-
17681765
LLVM_DEBUG(dbgs() << "== ObjCARCOpt::MoveCalls ==\n");
17691766

17701767
// Insert the new retain and release calls.
@@ -1783,14 +1780,11 @@ void ObjCARCOpt::MoveCalls(Value *Arg, RRInfo &RetainsToMove,
17831780
<< *InsertPt << "\n");
17841781
}
17851782
for (Instruction *InsertPt : RetainsToMove.ReverseInsertPts) {
1786-
Value *MyArg = ArgTy == ParamTy ? Arg
1787-
: new BitCastInst(Arg, ParamTy, "",
1788-
InsertPt->getIterator());
17891783
Function *Decl = EP.get(ARCRuntimeEntryPointKind::Release);
17901784
SmallVector<OperandBundleDef, 1> BundleList;
17911785
addOpBundleForFunclet(InsertPt->getParent(), BundleList);
17921786
CallInst *Call =
1793-
CallInst::Create(Decl, MyArg, BundleList, "", InsertPt->getIterator());
1787+
CallInst::Create(Decl, Arg, BundleList, "", InsertPt->getIterator());
17941788
// Attach a clang.imprecise_release metadata tag, if appropriate.
17951789
if (MDNode *M = ReleasesToMove.ReleaseMetadata)
17961790
Call->setMetadata(MDKindCache.get(ARCMDKindID::ImpreciseRelease), M);

0 commit comments

Comments
 (0)