File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -592,9 +592,7 @@ SILCloner<ImplClass>::getMappedValue(SILValue Value) {
592592 // If we have undef, just remap the type.
593593 if (auto *U = dyn_cast<SILUndef>(Value)) {
594594 auto type = getOpType (U->getType ());
595- ValueBase *undef =
596- (type == U->getType () ? U : SILUndef::get (Builder.getFunction (), type));
597- return SILValue (undef);
595+ return SILUndef::get (Builder.getFunction (), type);
598596 }
599597
600598 llvm_unreachable (" Unmapped value while cloning?" );
Original file line number Diff line number Diff line change @@ -1263,6 +1263,10 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
12631263 " instruction isn't dominated by its bb argument operand" );
12641264 }
12651265
1266+ if (auto *undef = dyn_cast<SILUndef>(operand.get ())) {
1267+ require (undef->getParent () == BB->getParent (), " SILUndef in wrong function" );
1268+ }
1269+
12661270 require (operand.getUser () == I,
12671271 " instruction's operand's owner isn't the instruction" );
12681272 require (isOperandInValueUses (&operand), " operand value isn't used by operand" );
You can’t perform that action at this time.
0 commit comments