Skip to content

Commit 093ebf9

Browse files
committed
GlobalISel: Don't compute known bits for non-integral GEP
llvm-svn: 370392
1 parent f9cdb98 commit 093ebf9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,13 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known,
150150
Known.Zero = KnownZeroOut;
151151
break;
152152
}
153-
// G_GEP is like G_ADD. FIXME: Is this true for all targets?
154-
case TargetOpcode::G_GEP:
153+
case TargetOpcode::G_GEP: {
154+
// G_GEP is like G_ADD. FIXME: Is this true for all targets?
155+
LLT Ty = MRI.getType(MI.getOperand(1).getReg());
156+
if (DL.isNonIntegralAddressSpace(Ty.getAddressSpace()))
157+
break;
158+
LLVM_FALLTHROUGH;
159+
}
155160
case TargetOpcode::G_ADD: {
156161
// Output known-0 bits are known if clear or set in both the low clear bits
157162
// common to both LHS & RHS. For example, 8+(X<<3) is known to have the

0 commit comments

Comments
 (0)