@@ -510,20 +510,7 @@ bool llvm::DenseMapInfo<SimpleValue>::isEqual(SimpleValue LHS,
510
510
return true ;
511
511
return false ;
512
512
};
513
- auto canHandleOwnershipConversion = [](const SILInstruction *lhs,
514
- const SILInstruction *rhs) -> bool {
515
- if (!lhs->getFunction ()->hasOwnership ())
516
- return true ;
517
- // TODO: Support MultipleValueInstructionResult in OSSA RAUW utility and
518
- // extend it here as well
519
- if (!isa<SingleValueInstruction>(lhs))
520
- return false ;
521
- return OwnershipFixupContext::canFixUpOwnershipForRAUW (
522
- cast<SingleValueInstruction>(lhs), cast<SingleValueInstruction>(rhs));
523
- };
524
- return LHSI->getKind () == RHSI->getKind () &&
525
- LHSI->isIdenticalTo (RHSI, opCmp) &&
526
- (LHSI == RHSI || canHandleOwnershipConversion (LHSI, RHSI));
513
+ return LHSI->getKind () == RHSI->getKind () && LHSI->isIdenticalTo (RHSI, opCmp);
527
514
}
528
515
529
516
namespace {
@@ -1032,9 +1019,15 @@ bool CSE::processNode(DominanceInfoNode *Node) {
1032
1019
++NumCSE;
1033
1020
continue ;
1034
1021
}
1035
- // Replace SingleValueInstruction using OSSA RAUW here
1036
1022
// TODO: Support MultipleValueInstructionResult in OSSA RAUW utility and
1037
1023
// extend it here as well
1024
+ if (!isa<SingleValueInstruction>(Inst))
1025
+ continue ;
1026
+ if (!OwnershipFixupContext::canFixUpOwnershipForRAUW (
1027
+ cast<SingleValueInstruction>(Inst),
1028
+ cast<SingleValueInstruction>(AvailInst)))
1029
+ continue ;
1030
+ // Replace SingleValueInstruction using OSSA RAUW here
1038
1031
nextI = FixupCtx.replaceAllUsesAndEraseFixingOwnership (
1039
1032
cast<SingleValueInstruction>(Inst),
1040
1033
cast<SingleValueInstruction>(AvailInst));
0 commit comments