[llvm] d955497 - [RISCV] Simplify lowerGlobalAddress. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 17 15:42:50 PDT 2022


Author: Fangrui Song
Date: 2022-07-17T15:42:45-07:00
New Revision: d95549711255b459dc192631a05e4460cb7e046a

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

LOG: [RISCV] Simplify lowerGlobalAddress. NFC

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index 382dbb97c728..abab23dc36b9 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -3707,10 +3707,7 @@ SDValue RISCVTargetLowering::lowerGlobalAddress(SDValue Op,
   SDLoc DL(Op);
   GlobalAddressSDNode *N = cast<GlobalAddressSDNode>(Op);
   assert(N->getOffset() == 0 && "unexpected offset in global node");
-
-  const GlobalValue *GV = N->getGlobal();
-  bool IsLocal = getTargetMachine().shouldAssumeDSOLocal(*GV->getParent(), GV);
-  return getAddr(N, DAG, IsLocal);
+  return getAddr(N, DAG, N->getGlobal()->isDSOLocal());
 }
 
 SDValue RISCVTargetLowering::lowerBlockAddress(SDValue Op,


        


More information about the llvm-commits mailing list