Remove some redundant code from r290372 and improve a comment.

llvm-svn: 365741
This commit is contained in:
Jay Foad 2019-07-11 08:49:52 +00:00
parent 85ad78b1cf
commit c1b7db9eda
1 changed files with 3 additions and 5 deletions

View File

@ -3655,13 +3655,11 @@ SDValue AMDGPUTargetLowering::performSelectCombine(SDNode *N,
if (Cond.hasOneUse()) { // TODO: Look for multiple select uses.
SelectionDAG &DAG = DCI.DAG;
if ((DAG.isConstantValueOfAnyType(True) ||
DAG.isConstantValueOfAnyType(True)) &&
(!DAG.isConstantValueOfAnyType(False) &&
!DAG.isConstantValueOfAnyType(False))) {
if (DAG.isConstantValueOfAnyType(True) &&
!DAG.isConstantValueOfAnyType(False)) {
// Swap cmp + select pair to move constant to false input.
// This will allow using VOPC cndmasks more often.
// select (setcc x, y), k, x -> select (setcc y, x) x, x
// select (setcc x, y), k, x -> select (setccinv x, y), x, k
SDLoc SL(N);
ISD::CondCode NewCC = getSetCCInverse(cast<CondCodeSDNode>(CC)->get(),