Skip to content

Commit 1e48770

Browse files
committed
Switch code from working on Use* to Value* and replace all uses
1 parent 10e8258 commit 1e48770

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4899,15 +4899,15 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
48994899
// If operand is guaranteed not to be poison, there is no need to add freeze
49004900
// to the operand. So we first find the operand that is not guaranteed to be
49014901
// poison.
4902-
Use *MaybePoisonOperand = nullptr;
4902+
Value *MaybePoisonOperand = nullptr;
49034903
for (Use &U : OrigOpInst->operands()) {
49044904
if (isa<MetadataAsValue>(U.get()) ||
49054905
isGuaranteedNotToBeUndefOrPoison(U.get()) ||
49064906
// Treat identical operands as a single operand.
4907-
(MaybePoisonOperand && MaybePoisonOperand->get() == U.get()))
4907+
(MaybePoisonOperand && MaybePoisonOperand == U.get()))
49084908
continue;
49094909
if (!MaybePoisonOperand)
4910-
MaybePoisonOperand = &U;
4910+
MaybePoisonOperand = U.get();
49114911
else
49124912
return nullptr;
49134913
}
@@ -4919,10 +4919,10 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
49194919
return OrigOp;
49204920

49214921
Builder.SetInsertPoint(OrigOpInst);
4922-
auto *FrozenMaybePoisonOperand = Builder.CreateFreeze(
4923-
MaybePoisonOperand->get(), MaybePoisonOperand->get()->getName() + ".fr");
4922+
Value *FrozenMaybePoisonOperand = Builder.CreateFreeze(
4923+
MaybePoisonOperand, MaybePoisonOperand->getName() + ".fr");
49244924

4925-
replaceUse(*MaybePoisonOperand, FrozenMaybePoisonOperand);
4925+
OrigOpInst->replaceUsesOfWith(MaybePoisonOperand, FrozenMaybePoisonOperand);
49264926
return OrigOp;
49274927
}
49284928

0 commit comments

Comments
 (0)