]> granicus.if.org Git - llvm/commitdiff
[DAG][SystemZ] Define unwrapAddress for PCREL_WRAPPER.
authorNirav Dave <niravd@google.com>
Thu, 31 Jan 2019 19:58:34 +0000 (19:58 +0000)
committerNirav Dave <niravd@google.com>
Thu, 31 Jan 2019 19:58:34 +0000 (19:58 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352786 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h

index 5a59a33d0741b3fcf0216edd3db169fbe8014454..0f02312b779570b834a700bf44ed588a7cc97c57 100644 (file)
@@ -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()) {
index e456a5c32d66691419af3742416dc17764b0ac3b..cd0e4c3468b7819d327920686181d01bb8bfbf09 100644 (file)
@@ -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.