Page MenuHomePhabricator

[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.
ClosedPublic

Authored by tra on Sep 22 2017, 2:22 PM.

Event Timeline

tra created this revision.Sep 22 2017, 2:22 PM
jlebar added inline comments.Sep 25 2017, 11:24 AM
clang/include/clang/Basic/BuiltinsNVPTX.def
419 ↗(On Diff #116578)

Nit, non-restrictive "which" should get a comma. :)

clang/lib/CodeGen/CGBuiltin.cpp
9603 ↗(On Diff #116578)

Doing sext i1 -> i32 is going to cause us to store 0 or -1 in the pred (right?). The CUDA docs say

Predicate pred is set to true if all threads in mask have the same value of value; otherwise the predicate is set to false.

I'd guess that "true" probably means 1 (i.e. uext i1 -> i32) rather than -1, although, I guess we have to check.

tra updated this revision to Diff 116578.Sep 25 2017, 11:30 AM
tra marked an inline comment as done.

Addressed Justin's comments.

clang/lib/CodeGen/CGBuiltin.cpp
9603 ↗(On Diff #116578)

Right. It should've been ZExt. In similar places CUDA headers use "selp %r1, 1, 0, %p".

jlebar accepted this revision.Sep 25 2017, 11:46 AM
This revision is now accepted and ready to land.Sep 25 2017, 11:46 AM
This revision was automatically updated to reflect the committed changes.
tra reopened this revision.Sep 25 2017, 8:47 PM
tra added inline comments.
llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
716

I've unintentionally killed return true; here and that's what broke the texture tests. I'm not sure yet why my local tests worked.

This revision is now accepted and ready to land.Sep 25 2017, 8:47 PM
tra updated this revision to Diff 116674.Sep 26 2017, 9:14 AM

Added missing return. Tests pass now.

tra closed this revision.Sep 26 2017, 10:39 AM

Landed with fix in r314223.