[PATCH] D91288: [AArch64][GlobalISel] NFC: Use CmpInst::isUnsigned instead of static helper

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 09:36:33 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG6c20c1da1e5c: [AArch64][GlobalISel] NFC: Use CmpInst::isUnsigned instead of static helper (authored by paquette).

Changed prior to commit:
  https://reviews.llvm.org/D91288?vs=304602&id=305198#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91288/new/

https://reviews.llvm.org/D91288

Files:
  llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp


Index: llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
===================================================================
--- llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+++ llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
@@ -1089,19 +1089,6 @@
   return &*SelectInst;
 }
 
-/// Returns true if \p P is an unsigned integer comparison predicate.
-static bool isUnsignedICMPPred(const CmpInst::Predicate P) {
-  switch (P) {
-  default:
-    return false;
-  case CmpInst::ICMP_UGT:
-  case CmpInst::ICMP_UGE:
-  case CmpInst::ICMP_ULT:
-  case CmpInst::ICMP_ULE:
-    return true;
-  }
-}
-
 static AArch64CC::CondCode changeICMPPredToAArch64CC(CmpInst::Predicate P) {
   switch (P) {
   default:
@@ -4379,7 +4366,7 @@
   // Produce this if the compare is signed:
   //
   // tst x, y
-  if (!isUnsignedICMPPred(P) && LHSDef &&
+  if (!CmpInst::isUnsigned(P) && LHSDef &&
       LHSDef->getOpcode() == TargetOpcode::G_AND) {
     // Make sure that the RHS is 0.
     auto ValAndVReg = getConstantVRegValWithLookThrough(RHS.getReg(), MRI);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91288.305198.patch
Type: text/x-patch
Size: 1082 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201113/e1922796/attachment.bin>


More information about the llvm-commits mailing list