Skip to content

Check Race Condition for TGSM - #48

Merged
Xiang Li (python3kgae) merged 3 commits into
microsoft:dxil-v1.0from
python3kgae:race_cond2
Jan 31, 2017
Merged

Xiang Li (python3kgae) merged 3 commits into
microsoft:dxil-v1.0from
python3kgae:race_cond2

Conversation

@python3kgae

Copy link
Copy Markdown
Contributor

No description provided.

@msftclas

Hi Xiang Li (@python3kgae), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Xiang Li). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@dmpots David Peixotto (dmpots) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think your check is not sufficient to detect the race conditions. Checking if the block post-dominates the entry will only catch the cases where the store is not protected by an if. We could still have cases like

if (TID != 0) GI[0] = TID;

where the store is under a conditional, but many threads are writing to the shared memory.

I suppose this patch brings us closer to what the d3d compiler does, which is a good thing.

Comment thread lib/HLSL/DxilValidation.cpp Outdated
CollectFixAddressAccess(GEP, fixAddrTGSMList);
}
}
if (isa<StoreInst>(U))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

else if (isa store) {
}

static void
ValidateTGSMRaceCondition(std::vector<Instruction *> &fixAddrTGSMList,
ValidationContext &ValCtx) {
for (auto &F : ValCtx.DxilMod.GetModule()->functions()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is computing post-dom for all functions even those that may not have any instructions in the list. It seems like it would be better to only compute dom tree for those functions that have instructions we need to check.

@python3kgae
Xiang Li (python3kgae) merged commit cf6f8be into microsoft:dxil-v1.0 Jan 31, 2017
@python3kgae
Xiang Li (python3kgae) deleted the race_cond2 branch January 31, 2017 00:09
Lei Zhang (antiagainst) pushed a commit to antiagainst/DirectXShaderCompiler that referenced this pull request Apr 26, 2017
* [spirv] Add debug name for functions.
Lei Zhang (antiagainst) pushed a commit to antiagainst/DirectXShaderCompiler that referenced this pull request May 7, 2017
* [spirv] Add debug name for functions.
Lei Zhang (antiagainst) pushed a commit to antiagainst/DirectXShaderCompiler that referenced this pull request Jun 6, 2017
* [spirv] Add debug name for functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants