From: Nirav Dave Date: Thu, 31 Jan 2019 19:58:34 +0000 (+0000) Subject: [DAG][SystemZ] Define unwrapAddress for PCREL_WRAPPER. X-Git-Tag: llvmorg-10-init~13131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b792299d8326773eea64611a471708cd2b622976;p=platform%2Fupstream%2Fllvm.git [DAG][SystemZ] Define unwrapAddress for PCREL_WRAPPER. Summary: Like with X86, this allows better DAG-level alias analysis and alignment inference for wrapped addresses. Reviewers: jonpa, uweigand Reviewed By: uweigand Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D57407 llvm-svn: 352786 --- diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp index 5a59a33..0f02312 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -5775,6 +5775,12 @@ SDValue SystemZTargetLowering::combineIntDIVREM( return SDValue(); } +SDValue SystemZTargetLowering::unwrapAddress(SDValue N) const { + if (N->getOpcode() == SystemZISD::PCREL_WRAPPER) + return N->getOperand(0); + return N; +} + SDValue SystemZTargetLowering::PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const { switch(N->getOpcode()) { diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.h b/llvm/lib/Target/SystemZ/SystemZISelLowering.h index e456a5c..cd0e4c3 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.h +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.h @@ -598,6 +598,8 @@ private: SDValue combineGET_CCMASK(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineIntDIVREM(SDNode *N, DAGCombinerInfo &DCI) const; + SDValue unwrapAddress(SDValue N) const override; + // If the last instruction before MBBI in MBB was some form of COMPARE, // try to replace it with a COMPARE AND BRANCH just before MBBI. // CCMask and Target are the BRC-like operands for the branch.