Issue 71093
Summary [AArch64] Broken code generated calling a non-streaming function from a streaming function
Labels backend:AArch64
Assignees
Reporter efriedma-quic
    Consider something like the following:

```
#include <arm_sve.h>
#include <assert.h>
void __arm_tpidr2_save() {}
void __arm_tpidr2_restore() {}
svint32_t identity(svint32_t f) {
  return f;
}
__arm_locally_streaming
void f(void) {
 assert(identity(svdup_s32(1))[0] == svdup_s32(1)[0]);
}
int main() {
  f();
}
```

This builds and runs on qemu with the default vector lengths (I think it's 512-bit non-streaming/256-bit streaming), but the assertion fails.  We try to spill/restore across the call, but it doesn't work because the addressing is wrong: the meaning of a "mul vl" addressing mode changes when you smstart/smstop.

I'm not sure if this should be considered a code generation bug, or a missing diagnostic; it's not 100% clear what this construct is supposed to do.  But we shouldn't silently miscompile.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to