Open
Description
The example below will generate a call to an intrinsic @llvm.invariant.start.p0
it indicate that the variable will not change after it is initialized. However, this seems to hinder optimizations. The store to the variable is still present after optimizations. See https://godbolt.org/z/fT39qoafr.
RWBuffer<int> b : register(u0);
int foo() { return 20; }
static const int c = foo();
[numthreads(1,1,1)]
void main() {
b[0] = c;
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status