[llvm] r371465 - [GlobalISel]: Fix a bug where we could dereference None
Aditya Nandakumar via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 9 15:51:41 PDT 2019
Author: aditya_nandakumar
Date: Mon Sep 9 15:51:41 2019
New Revision: 371465
URL: http://llvm.org/viewvc/llvm-project?rev=371465&view=rev
Log:
[GlobalISel]: Fix a bug where we could dereference None
getConstantVRegVal returns None when dealing with constants > 64 bits.
Don't assume we always have a value in GISelKnownBits.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/GISelKnownBits.cpp?rev=371465&r1=371464&r2=371465&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/GISelKnownBits.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/GISelKnownBits.cpp Mon Sep 9 15:51:41 2019
@@ -140,6 +140,8 @@ void GISelKnownBits::computeKnownBitsImp
}
case TargetOpcode::G_CONSTANT: {
auto CstVal = getConstantVRegVal(R, MRI);
+ if (!CstVal)
+ break;
Known.One = *CstVal;
Known.Zero = ~Known.One;
break;
More information about the llvm-commits
mailing list