From 61b7de3c39f01a0eeb717f444c86990547752e26 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 15 Apr 2020 14:41:52 -0400 Subject: [PATCH] Remove unreachable code. (#3304) --- source/opt/graphics_robust_access_pass.cpp | 4 ++++ source/opt/ir_context.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/opt/graphics_robust_access_pass.cpp b/source/opt/graphics_robust_access_pass.cpp index 22c979cf3a..db14020db2 100644 --- a/source/opt/graphics_robust_access_pass.cpp +++ b/source/opt/graphics_robust_access_pass.cpp @@ -802,8 +802,11 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( opt::Instruction* image_texel_pointer) { // TODO(dneto): Write tests for this code. // TODO(dneto): Use signed-clamp + (void)(image_texel_pointer); return SPV_SUCCESS; + // Do not compile this code until it is ready to be used. +#if 0 // Example: // %texel_ptr = OpImageTexelPointer %texel_ptr_type %image_ptr %coord // %sample @@ -1035,6 +1038,7 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer( def_use_mgr->AnalyzeInstUse(image_texel_pointer); return SPV_SUCCESS; +#endif } opt::Instruction* GraphicsRobustAccessPass::InsertInst( diff --git a/source/opt/ir_context.cpp b/source/opt/ir_context.cpp index 861ca2caa0..c4378d37bd 100644 --- a/source/opt/ir_context.cpp +++ b/source/opt/ir_context.cpp @@ -272,7 +272,7 @@ bool IRContext::ReplaceAllUsesWithPredicate( bool IRContext::IsConsistent() { #ifndef SPIRV_CHECK_CONTEXT return true; -#endif +#else if (AreAnalysesValid(kAnalysisDefUse)) { analysis::DefUseManager new_def_use(module()); if (*get_def_use_mgr() != new_def_use) { @@ -324,6 +324,7 @@ bool IRContext::IsConsistent() { } } return true; +#endif } void IRContext::ForgetUses(Instruction* inst) {