Skip to content

Commit a701802

Browse files
fda0igcbot
authored andcommitted
Remove redundant null check
Remove null check on a value that cannot be null.
1 parent 1cf998d commit a701802

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

visa/VISAKernelImpl.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,13 +2197,8 @@ int VISAKernelImpl::CreateVISASrcOperand(
21972197
cisa_opnd = static_cast<VISA_VectorOpnd *>(getOpndFromPool());
21982198
if (IS_GEN_BOTH_PATH) {
21992199
G4_Declare *dcl = cisa_decl->genVar.dcl;
2200-
#if START_ASSERT_CHECK
2201-
if (dcl == nullptr) {
2202-
vASSERT(false);
2203-
return VISA_FAILURE;
2204-
}
2205-
#endif
2206-
G4_Declare *aliasDcl = dcl ? dcl->getRootDeclare() : nullptr;
2200+
vASSERT(dcl != nullptr);
2201+
G4_Declare *aliasDcl = dcl->getRootDeclare();
22072202

22082203
// replace vISA %null variable with a null src to avoid confusing later
22092204
// passes

0 commit comments

Comments
 (0)