[EarlyCSE] Remove unnecessary operand swap.

- As min/max are commutative operators, there is no need to swap
  operands. That breaks the convention calculating the hash value.
This commit is contained in:
Michael Liao 2020-09-11 01:58:11 -04:00
parent e45b0708ae
commit f787fe15d8
2 changed files with 1 additions and 2 deletions

View File

@ -199,7 +199,6 @@ static bool matchSelectWithOptionalNotCond(Value *V, Value *&Cond, Value *&A,
case CmpInst::ICMP_SLE:
case CmpInst::ICMP_SGE:
Pred = CmpInst::getInversePredicate(Pred);
std::swap(A, B);
Inversed = true;
break;
default:

View File

@ -1,4 +1,4 @@
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=kaveri -earlycse-debug-hash -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
; GCN-LABEL: {{^}}v_sad_u32_pat1:
; GCN: v_sad_u32 v{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}