[llvm] 0e55823 - LoongArch: Remove unneeded VK_None check

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 21:53:42 PDT 2025


Author: Fangrui Song
Date: 2025-06-27T21:53:37-07:00
New Revision: 0e558239b82562b778285e7a9351dfe9ebd0b3e4

URL: https://github.com/llvm/llvm-project/commit/0e558239b82562b778285e7a9351dfe9ebd0b3e4
DIFF: https://github.com/llvm/llvm-project/commit/0e558239b82562b778285e7a9351dfe9ebd0b3e4.diff

LOG: LoongArch: Remove unneeded VK_None check

Expressions with relocation specifier are encoded as MCSpecifierExpr,
so MCSymbolRefExpr expressions have no specifier.

Added: 
    

Modified: 
    llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp
index ba891ebebdbe3..5ad550e380380 100644
--- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp
+++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp
@@ -167,9 +167,7 @@ LoongArchMCCodeEmitter::getExprOpValue(const MCInst &MI, const MCOperand &MO,
       RelaxCandidate = true;
       break;
     }
-  } else if (Kind == MCExpr::SymbolRef &&
-             cast<MCSymbolRefExpr>(Expr)->getKind() ==
-                 MCSymbolRefExpr::VK_None) {
+  } else if (Kind == MCExpr::SymbolRef) {
     switch (MI.getOpcode()) {
     default:
       break;


        


More information about the llvm-commits mailing list