From: Simon Pilgrim Date: Sun, 22 Sep 2019 21:01:13 +0000 (+0000) Subject: [AMDGPU] isSDNodeAlwaysUniform - silence static analyzer dyn_cast null... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae38ef995f29a4bc54d7511892007890dbd0741c;p=llvm [AMDGPU] isSDNodeAlwaysUniform - silence static analyzer dyn_cast null dereference warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast directly and if not assert will fire for us. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372528 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/lib/Target/AMDGPU/AMDGPUISelLowering.cpp index c24ea043fc3..203cc672b62 100644 --- a/lib/Target/AMDGPU/AMDGPUISelLowering.cpp +++ b/lib/Target/AMDGPU/AMDGPUISelLowering.cpp @@ -718,9 +718,8 @@ bool AMDGPUTargetLowering::isSDNodeAlwaysUniform(const SDNode * N) const { break; case ISD::LOAD: { - const LoadSDNode * L = dyn_cast(N); - if (L->getMemOperand()->getAddrSpace() - == AMDGPUAS::CONSTANT_ADDRESS_32BIT) + if (cast(N)->getMemOperand()->getAddrSpace() == + AMDGPUAS::CONSTANT_ADDRESS_32BIT) return true; return false; }