Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions projects/dxilconv/lib/DxbcConverter/DxbcConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6393,8 +6393,8 @@ void DxbcConverter::EmitGSOutputRegisterStore(unsigned StreamId) {
CompType DxbcValueType = SE.GetCompType();
Type *pDxbcValueType = DxbcValueType.GetLLVMType(m_Ctx);

for (BYTE c = 0; c < SE.GetCols(); c++) {
BYTE Comp = SE.GetStartCol() + c;
for (unsigned int c = 0; c < SE.GetCols(); c++) {
unsigned int Comp = SE.GetStartCol() + c;

Value *pValue;
// 1. Load value from the corresponding temp reg.
Expand Down
3 changes: 2 additions & 1 deletion projects/dxilconv/lib/DxbcConverter/DxbcUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ CMask::CMask(BYTE StartComp, BYTE NumComp) {
(StartComp + NumComp - 1) < DXBC::kAllCompMask,
"otherwise the caller did not check");
m_Mask = 0;
for (BYTE c = StartComp; c < StartComp + NumComp; c++) {
BYTE EndComp = StartComp + NumComp;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems weird to me that the change above is removing the BYTE type but not here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In both scenarios, code ql complain is:

Comparisons between types of different widths in a loop condition can cause the loop to behave unexpectedly.

In this instance:

for (BYTE c = 0; c < SE.GetCols(); c++) {
      BYTE Comp = SE.GetStartCol() + c;

SE.GetCols() returns an unsigned int, and c only usage is in order to calculate Comp which only usage is at function: GetRegIndex, which if you check expects an unsigned int. Since all usages are of unsigned int, I found that it made sense to change the type to unsigned int.

Now, in this scenario:

for (BYTE c = StartComp; c < StartComp + NumComp; c++) {

The issue is being cause because, StartComp + NumComp results in an int, while c is still a byte. Therefore, I found it easier to cast it back to BYTE.

for (BYTE c = StartComp; c < EndComp; c++) {
m_Mask |= (1 << c);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/clang/unittests/HLSLExec/ExecutionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2480,7 +2480,7 @@ TEST_F(ExecutionTest, WaveIntrinsicsTest) {
}

// Waves should cover 4 threads or more.
LogCommentFmt(L"Found %u distinct lane ids: %u", firstLaneIds.size());
LogCommentFmt(L"Found %u distinct lane ids", firstLaneIds.size());
if (!dxbc) {
VERIFY_IS_GREATER_THAN_OR_EQUAL(values.size() / 4, firstLaneIds.size());
}
Expand Down
73 changes: 0 additions & 73 deletions tools/clang/utils/CaptureCmd

This file was deleted.

32 changes: 0 additions & 32 deletions utils/DSAclean.py

This file was deleted.