GlobalISel: Make special case handling clearer

The special case here is really G_UNMERGE_VALUES, not G_EXTRACT. The
other opcodes can hardcode index 1 like G_EXTRACT.
This commit is contained in:
Matt Arsenault 2020-06-16 11:32:52 -04:00
parent d98a7c3cf4
commit 91bec1d385

View File

@ -812,10 +812,10 @@ private:
case TargetOpcode::G_ZEXT:
case TargetOpcode::G_ANYEXT:
case TargetOpcode::G_SEXT:
case TargetOpcode::G_UNMERGE_VALUES:
return MI.getOperand(MI.getNumOperands() - 1).getReg();
case TargetOpcode::G_EXTRACT:
return MI.getOperand(1).getReg();
case TargetOpcode::G_UNMERGE_VALUES:
return MI.getOperand(MI.getNumOperands() - 1).getReg();
default:
llvm_unreachable("Not a legalization artifact happen");
}