[llvm] [Xtensa] Lower GlobalAddress/BlockAddress/JumpTable (PR #95256)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 08:25:25 PDT 2024


================
@@ -519,6 +537,87 @@ SDValue XtensaTargetLowering::LowerImmediate(SDValue Op,
   return Op;
 }
 
+SDValue XtensaTargetLowering::LowerGlobalAddress(SDValue Op,
+                                                 SelectionDAG &DAG) const {
+  const GlobalAddressSDNode *G = cast<GlobalAddressSDNode>(Op);
+  SDLoc DL(Op);
+  auto PtrVt = getPointerTy(DAG.getDataLayout());
----------------
arsenm wrote:

Use the type of the incoming value instead of guessing it's an address space 0 pointer. You should hardly ever need getPointerTy 

https://github.com/llvm/llvm-project/pull/95256


More information about the llvm-commits mailing list