]> granicus.if.org Git - llvm/commitdiff
GlobalISel: Don't compute known bits for non-integral GEP
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 29 Aug 2019 17:55:05 +0000 (17:55 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 29 Aug 2019 17:55:05 +0000 (17:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370392 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/GlobalISel/GISelKnownBits.cpp

index 0870aa3812fe9b91b938e2cd383ca1b128e4b932..057a32fd1d5aa941af801c4f4fc448ed1acf067a 100644 (file)
@@ -150,8 +150,13 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known,
     Known.Zero = KnownZeroOut;
     break;
   }
-  // G_GEP is like G_ADD. FIXME: Is this true for all targets?
-  case TargetOpcode::G_GEP:
+  case TargetOpcode::G_GEP: {
+    // G_GEP is like G_ADD. FIXME: Is this true for all targets?
+    LLT Ty = MRI.getType(MI.getOperand(1).getReg());
+    if (DL.isNonIntegralAddressSpace(Ty.getAddressSpace()))
+      break;
+    LLVM_FALLTHROUGH;
+  }
   case TargetOpcode::G_ADD: {
     // Output known-0 bits are known if clear or set in both the low clear bits
     // common to both LHS & RHS.  For example, 8+(X<<3) is known to have the