Skip to content

[SPIRV] Add support for OpCopyMemory - #1100

Open
hernanponcedeleon wants to merge 1 commit into
developmentfrom
OpCopyMemory
Open

hernanponcedeleon wants to merge 1 commit into
developmentfrom
OpCopyMemory

Conversation

@hernanponcedeleon

Copy link
Copy Markdown
Owner

Since OpCopyMemory makes use of memory operands, it plays a role from the point of view of the memory mode. Intuitively, I think it should not be any different than a program that explicity "chunks" the whole copy as a sequence of loads/stores as the implementation is doing, but TBH I have not thought very hard about possible problems from the memory model side (I mostly focused on validating the syntax restictions). @natgavrilenko let me know if you see any memory model problem.

Comment on lines +171 to +177
if (type instanceof AggregateType aggregateType) {
return aggregateType.getFields().get(index).type();
}
return Set.of();
if (type instanceof ArrayType arrayType) {
return arrayType.getElementType();
}
throw new IllegalArgumentException("Cannot index memory access type %s".formatted(type));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We have ExpressionHelper.extractType which does the same.
Maybe we should move it to TypeFactory though.

@github-actions

Copy link
Copy Markdown

Performance comparison

Linux x64

Benchmark details

Memory model: vmm

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/cna.c 11.827 ± 1.063 s 11.408 ± 0.625 s ➖ +3.3% [-29.4%, +35.9%] UNKNOWN
benchmarks/locks/mutex_musl.c 22.756 ± 1.041 s 22.270 ± 0.921 s ➖ +2.1% [-2.3%, +6.5%] UNKNOWN
benchmarks/lfds/dglm.c 17.992 ± 0.714 s 18.409 ± 0.693 s ➖ -2.4% [-20.1%, +15.4%] UNKNOWN
benchmarks/lfds/ms.c 35.152 ± 2.215 s 35.487 ± 4.578 s ➖ -0.7% [-43.0%, +41.5%] UNKNOWN
benchmarks/lfds/treiber.c 9.576 ± 0.161 s 9.541 ± 0.266 s ➖ +0.3% [-24.5%, +25.2%] UNKNOWN
benchmarks/lfds/safe_stack.c 5.108 ± 0.067 s 5.160 ± 0.241 s ➖ -1.0% [-25.4%, +23.4%] UNKNOWN
benchmarks/challenging/cna.c 34.519 ± 2.908 s 33.068 ± 0.903 s ➖ +3.9% [-28.7%, +36.5%] UNKNOWN

Memory model: aarch64

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/linuxrwlock.c 5.777 ± 0.191 s 5.682 ± 0.272 s ➖ +1.5% [-35.0%, +38.1%] UNKNOWN
benchmarks/challenging/cna.c 11.808 ± 0.966 s 10.806 ± 1.734 s ➖ +7.2% [-125.1%, +139.5%] UNKNOWN
benchmarks/challenging/wsq.c 5.840 ± 0.081 s 5.829 ± 0.199 s ➖ +0.2% [-21.3%, +21.6%] UNKNOWN

Memory model: power

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/linuxrwlock.c 14.489 ± 0.439 s 14.484 ± 0.277 s ➖ +0.0% [-6.4%, +6.5%] UNKNOWN
benchmarks/locks/mutex_musl.c 12.511 ± 2.179 s 13.100 ± 1.837 s ➖ -5.5% [-77.3%, +66.4%] UNKNOWN
benchmarks/lfds/ms.c 18.684 ± 1.780 s 17.767 ± 1.151 s ➖ +4.6% [-36.0%, +45.1%] UNKNOWN
benchmarks/lfds/treiber.c 11.918 ± 0.355 s 11.676 ± 0.497 s ➖ +2.1% [-6.3%, +10.4%] UNKNOWN

Total

Benchmarks Base branch PR branch Improvement (99% CI)
All reported benchmarks 217.956 ± 5.485 s 214.688 ± 5.719 s ➖ +1.5% [-8.4%, +11.4%]

4 benchmark(s) omitted because both averages were below 5 seconds.

macOS ARM64

Benchmark details

Memory model: vmm

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/cna.c 14.809 ± 0.570 s 17.128 ± 0.673 s ❌ -15.7% [-26.0%, -5.4%] UNKNOWN
benchmarks/locks/mutex_musl.c 25.315 ± 0.312 s 25.503 ± 0.951 s ➖ -0.7% [-19.9%, +18.4%] UNKNOWN
benchmarks/lfds/dglm.c 36.675 ± 1.802 s 36.666 ± 3.691 s ➖ +0.2% [-35.6%, +36.0%] UNKNOWN
benchmarks/lfds/ms.c 65.000 ± 8.660 s 73.667 ± 6.506 s ➖ -13.9% [-62.9%, +35.1%] UNKNOWN
benchmarks/lfds/treiber.c 18.556 ± 0.946 s 16.059 ± 1.655 s ➖ +13.1% [-56.9%, +83.1%] UNKNOWN
benchmarks/lfds/safe_stack.c 12.109 ± 0.309 s 15.073 ± 0.096 s ❌ -24.5% [-45.5%, -3.6%] UNKNOWN
benchmarks/challenging/cna.c 41.200 ± 4.420 s 42.053 ± 5.365 s ➖ -2.3% [-61.1%, +56.5%] UNKNOWN

Memory model: aarch64

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/linuxrwlock.c 11.130 ± 0.694 s 15.413 ± 0.407 s ➖ -39.0% [-109.4%, +31.4%] UNKNOWN
benchmarks/locks/mutex_musl.c 9.247 ± 0.222 s 9.614 ± 0.575 s ➖ -3.9% [-29.4%, +21.5%] UNKNOWN
benchmarks/lfds/dglm.c 9.381 ± 0.133 s 8.690 ± 0.062 s ➖ +7.3% [-2.3%, +17.0%] PASS
benchmarks/lfds/ms.c 10.689 ± 0.587 s 11.307 ± 0.018 s ➖ -6.0% [-37.8%, +25.8%] UNKNOWN
benchmarks/challenging/cna.c 35.113 ± 3.407 s 36.059 ± 4.488 s ➖ -3.6% [-108.5%, +101.4%] UNKNOWN
benchmarks/challenging/wsq.c 20.806 ± 1.951 s 17.845 ± 3.040 s ➖ +14.2% [-60.9%, +89.3%] UNKNOWN

Memory model: power

Benchmark Base branch PR branch Improvement (99% CI) Result
benchmarks/locks/linuxrwlock.c 42.640 ± 4.958 s 34.601 ± 2.487 s ➖ +18.0% [-52.4%, +88.4%] UNKNOWN
benchmarks/locks/mutex_musl.c 23.973 ± 0.977 s 24.184 ± 2.985 s ➖ -1.1% [-82.5%, +80.3%] UNKNOWN
benchmarks/lfds/dglm.c 8.432 ± 0.039 s 8.829 ± 0.139 s ➖ -4.7% [-12.9%, +3.5%] UNKNOWN
benchmarks/lfds/ms.c 39.588 ± 1.259 s 38.062 ± 0.466 s ➖ +3.8% [-10.2%, +17.8%] UNKNOWN
benchmarks/lfds/treiber.c 24.894 ± 1.927 s 22.640 ± 1.144 s ➖ +8.8% [-21.9%, +39.6%] UNKNOWN

Total

Benchmarks Base branch PR branch Improvement (99% CI)
All reported benchmarks 449.555 ± 16.738 s 453.392 ± 9.093 s ➖ -0.9% [-19.6%, +17.8%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants