Skip to content

Commit d5cf8dc

Browse files
lukaszgotszaldintelZuul
authored and
Zuul
committed
use IGC_ASSERT in IGC/Compiler
Change-Id: I1a2fb9d672885c9743b328d500fd107be4b65c32
1 parent 187b00e commit d5cf8dc

File tree

191 files changed

+2377
-2459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+2377
-2459
lines changed

IGC/Compiler/ACLPrintfTranslation.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4343
#include "Compiler/Optimizer/OCLBIUtils.h"
4444
#include "Compiler/MetaDataApi/MetaDataApi.h"
4545
#include "Compiler/MetaDataUtilsWrapper.h"
46-
4746
#include "common/LLVMWarningsPush.hpp"
4847
#include <llvm/IR/Module.h>
4948
#include <llvm/IR/Function.h>
5049
#include "common/LLVMWarningsPop.hpp"
50+
#include "Probe/Assertion.h"
5151

5252
using namespace llvm;
5353
using namespace IGC;
@@ -100,7 +100,7 @@ void ACLPrintfTranslation::visitCallInst(llvm::CallInst& CI)
100100
else if (isa<Instruction>(V))
101101
{
102102
Instruction* I = (Instruction*)V;
103-
assert(I->getNumOperands() == 1);
103+
IGC_ASSERT(I->getNumOperands() == 1);
104104
CI.setOperand(1, I->getOperand(0));
105105
}
106106
}

IGC/Compiler/BlendToDiscard.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3333
#include "Compiler/MetaDataUtilsWrapper.h"
3434
#include "common/LLVMUtils.h"
3535
#include "common/IGCIRBuilder.h"
36-
3736
#include "common/LLVMWarningsPush.hpp"
3837
#include "common/LLVMWarningsPop.hpp"
38+
#include "Probe/Assertion.h"
3939

4040
using namespace llvm;
4141
using namespace IGC;
@@ -132,7 +132,7 @@ bool BlendToDiscard::runOnFunction(Function& F)
132132
m_modMD = m_cgCtx->getModuleMetaData();
133133
m_module = F.getParent();
134134

135-
assert(m_cgCtx->type == ShaderType::PIXEL_SHADER);
135+
IGC_ASSERT(m_cgCtx->type == ShaderType::PIXEL_SHADER);
136136

137137
std::vector<int>& blendOpt = m_modMD->psInfo.blendOptimizationMode;
138138
if (!blendOpt.size() || m_cgCtx->m_instrTypes.hasDiscard)
@@ -152,7 +152,7 @@ bool BlendToDiscard::runOnFunction(Function& F)
152152

153153
if (out)
154154
{
155-
assert(isa<ConstantInt>(out->getOperand(4)) &&
155+
IGC_ASSERT(isa<ConstantInt>(out->getOperand(4)) &&
156156
isa<ConstantInt>(out->getOperand(5)));
157157

158158
ShaderOutputType oType = static_cast<ShaderOutputType>(
@@ -401,7 +401,7 @@ bool BlendToDiscard::blendToDiscardMRT(
401401
}
402402

403403
default:
404-
assert(false && "Need to handle more cases");
404+
IGC_ASSERT(false && "Need to handle more cases");
405405
}
406406

407407
if (discardCond)

IGC/Compiler/CISACodeGen/AdvCodeMotion.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
#include <llvm/Transforms/Utils/Local.h>
1313
#include "common/LLVMWarningsPop.hpp"
1414
#include "GenISAIntrinsics/GenIntrinsics.h"
15-
1615
#include "Compiler/CISACodeGen/ShaderCodeGen.hpp"
1716
#include "Compiler/IGCPassSupport.h"
1817
#include "Compiler/MetaDataUtilsWrapper.h"
1918
#include "Compiler/CISACodeGen/AdvCodeMotion.h"
2019
#include "Compiler/CISACodeGen/WIAnalysis.hpp"
20+
#include "Probe/Assertion.h"
2121

2222
using namespace llvm;
2323
using namespace llvm::PatternMatch;
@@ -514,7 +514,7 @@ bool AdvCodeMotion::runOnFunction(Function& F) {
514514
if (!WIS.hasOneDim())
515515
return false;
516516

517-
assert(WIS.LocalSize.X && WIS.EnqueuedLocalSize.X && WIS.GlobalSize.X &&
517+
IGC_ASSERT(WIS.LocalSize.X && WIS.EnqueuedLocalSize.X && WIS.GlobalSize.X &&
518518
WIS.GroupId.X && WIS.GlobalOffset.X && WIS.LocalId.X &&
519519
WIS.GlobalId.X && "Missing necessary work-item settings");
520520

IGC/Compiler/CISACodeGen/AdvMemOpt.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
#include <llvm/Transforms/Utils/Local.h>
1212
#include "common/LLVMWarningsPop.hpp"
1313
#include "GenISAIntrinsics/GenIntrinsics.h"
14-
1514
#include "Compiler/CISACodeGen/ShaderCodeGen.hpp"
1615
#include "Compiler/IGCPassSupport.h"
1716
#include "Compiler/MetaDataUtilsWrapper.h"
1817
#include "Compiler/CISACodeGen/AdvMemOpt.h"
1918
#include "Compiler/CISACodeGen/WIAnalysis.hpp"
19+
#include "Probe/Assertion.h"
2020

2121
using namespace llvm;
2222
using namespace llvm::PatternMatch;
@@ -192,7 +192,7 @@ bool AdvMemOpt::hasMemoryWrite(BasicBlock* BB) const {
192192

193193
bool AdvMemOpt::hasMemoryWrite(BasicBlock* Entry, BasicBlock* Exit) const {
194194
// Entry and Exit must be on line of code.
195-
assert(DT->dominates(Entry, Exit) && PDT->dominates(Exit, Entry));
195+
IGC_ASSERT(DT->dominates(Entry, Exit) && PDT->dominates(Exit, Entry));
196196
RegionSubgraph RSG(Exit);
197197
for (auto SI = po_ext_begin(Entry, RSG),
198198
SE = po_ext_end(Entry, RSG); SI != SE; ++SI)

IGC/Compiler/CISACodeGen/BlockCoalescing.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2727
#include "Compiler/MetaDataApi/MetaDataApi.h"
2828
#include "common/igc_regkeys.hpp"
2929
#include "Compiler/IGCPassSupport.h"
30+
#include "Probe/Assertion.h"
3031

3132
using namespace llvm;
3233
using namespace IGC;
@@ -78,7 +79,7 @@ namespace IGC
7879
if (br->isUnconditional())
7980
{
8081
BasicBlock* succ = br->getSuccessor(0);
81-
assert(succ && "Branch must have a successor!");
82+
IGC_ASSERT(succ && "Branch must have a successor!");
8283
if (block.id >= patternMatch->GetBlockId(succ))
8384
{
8485
if (block.bb->getSinglePredecessor() == nullptr)
@@ -172,7 +173,7 @@ namespace IGC
172173
BasicBlock* block = bb;
173174
while (IsEmptyBlock(block))
174175
{
175-
assert(block->getTerminator()->getNumSuccessors() == 1);
176+
IGC_ASSERT(block->getTerminator()->getNumSuccessors() == 1);
176177
block = block->getTerminator()->getSuccessor(0);
177178
}
178179
return block;
@@ -183,7 +184,7 @@ namespace IGC
183184
BasicBlock* block = bb;
184185
while (IsEmptyBlock(block))
185186
{
186-
assert(block->getTerminator()->getNumSuccessors() == 1);
187+
IGC_ASSERT(block->getTerminator()->getNumSuccessors() == 1);
187188
block = block->getNextNode();
188189
}
189190
return block;

0 commit comments

Comments
 (0)