llvm / llvm/offload-test-suite

`AddUint64` generating unsupported instruction for Metal

Open
#344 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18
Forks
39
Avg merge
2d 18h
Merged PRs (30d)
40

Description

```hlsl
StructuredBuffer In : register(t0);
RWStructuredBuffer Out : register(u1);

[numthreads(1,1,1)]
void main() {
Out[0] = AddUint64(In[0], In[0]);
uint4 Tmp = {AddUint64(In[1].xy, In[1].xy), AddUint64(In[1].zw, In[1].zw)};
Out[1] = Tmp;
uint4 Tmp2 = {AddUint64(In[2].xy, In[2].xy), AddUint64(In[2].zw, In[2].zw)};
Out[2] = Tmp2;
uint4 Tmp3 = {AddUint64(uint2(0xffffffff, 0xffffffff), uint2(1, 0)), AddUint64(uint2(1, 256), uint2(1, 256))};
Out[3] = Tmp3;
}
```
Error message:
```
/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/Feature/HLSLLib/adduint64.test /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/adduint64.test.tmp # RUN: at line 74
+ /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/Feature/HLSLLib/adduint64.test /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/adduint64.test.tmp
/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/clang-dxc -metal --dxv-path=/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/adduint64.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/adduint64.test.tmp/source.hlsl # RUN: at line 75
+ /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/clang-dxc -metal --dxv-path=/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/adduint64.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/adduint64.test.tmp/source.hlsl
IR contains unsupported instruction: "dx.op.binaryWithCarryOrBorrow.i32".
Compilation failed
clang-dxc: error: metal-shaderconverter command failed with exit code 5 (use -v to see invocation)
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with OffloadTest/test/Feature/HLSLLib/adduint64.test and reproduce the Metal configuration using the clang-dxc command shown in the report. Trace the generated dx.op.binaryWithCarryOrBorrow.i32 instruction and identify why Metal rejects it. Done means the test compiles successfully for Metal without the unsupported-instruction error.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.