[llvm] 01136c0 - [X86][NFC] Run clang-format on cb26730aaa8b, fix typo and remove redundant else

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 20 21:12:56 PDT 2022


Author: Shengchen Kan
Date: 2022-03-21T12:08:10+08:00
New Revision: 01136c0530e2060927f094777664d94185f29c87

URL: https://github.com/llvm/llvm-project/commit/01136c0530e2060927f094777664d94185f29c87
DIFF: https://github.com/llvm/llvm-project/commit/01136c0530e2060927f094777664d94185f29c87.diff

LOG: [X86][NFC] Run clang-format on cb26730aaa8b, fix typo and remove redundant else

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86InstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 13a52f9406617..98ed40b8b4c21 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -2590,7 +2590,7 @@ int X86::getCondNoFromDesc(const MCInstrDesc &MCID, bool SkipDefs) {
     return -1;
   unsigned NumOperands = MCID.getNumOperands();
   unsigned NumDefs = MCID.getNumDefs();
-  // Assume that condtion code is always the last operand
+  // Assume that condition code is always the last operand
   unsigned CondNo = NumOperands - 1;
   if (SkipDefs)
     return CondNo - NumDefs;
@@ -2602,21 +2602,23 @@ X86::CondCode X86::getCondFromMI(const MachineInstr &MI) {
   int CondNo = getCondNoFromDesc(MCID);
   if (CondNo == -1)
     return X86::COND_INVALID;
-  else
-    return static_cast<X86::CondCode>(
-        MI.getOperand(static_cast<unsigned>(CondNo)).getImm());
+  return static_cast<X86::CondCode>(
+      MI.getOperand(static_cast<unsigned>(CondNo)).getImm());
 }
 
 X86::CondCode X86::getCondFromBranch(const MachineInstr &MI) {
-  return X86::isJCC(MI.getOpcode()) ? X86::getCondFromMI(MI) : X86::COND_INVALID;
+  return X86::isJCC(MI.getOpcode()) ? X86::getCondFromMI(MI)
+                                    : X86::COND_INVALID;
 }
 
 X86::CondCode X86::getCondFromSETCC(const MachineInstr &MI) {
-  return X86::isSETCC(MI.getOpcode()) ? X86::getCondFromMI(MI) : X86::COND_INVALID;
+  return X86::isSETCC(MI.getOpcode()) ? X86::getCondFromMI(MI)
+                                      : X86::COND_INVALID;
 }
 
 X86::CondCode X86::getCondFromCMov(const MachineInstr &MI) {
-  return X86::isCMOVCC(MI.getOpcode()) ? X86::getCondFromMI(MI) : X86::COND_INVALID;
+  return X86::isCMOVCC(MI.getOpcode()) ? X86::getCondFromMI(MI)
+                                       : X86::COND_INVALID;
 }
 
 /// Return the inverse of the specified condition,


        


More information about the llvm-commits mailing list