You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since at the ABI level that's passed as a pointer, I suspect this is more a "how rustc emits stuff" than an LLVM bug -- maybe there's some https://llvm.org/docs/LangRef.html#parameter-attributes we could set that would help. Or maybe the unnecessary double-move in MIR is part of the problem:
fnfoo(_1:[String;100]) -> usize{
debug x => _1;// in scope 0 at /app/example.rs:5:19: 5:20letmut _0:usize;// return place in scope 0 at /app/example.rs:5:40: 5:45letmut _2:[std::string::String;100];// in scope 0 at /app/example.rs:6:9: 6:10bb0:{StorageLive(_2);// scope 0 at /app/example.rs:6:9: 6:10
_2 = move _1;// scope 0 at /app/example.rs:6:9: 6:10
_0 = bar(move _2) -> bb1;// scope 0 at /app/example.rs:6:5: 6:11}bb1:{StorageDead(_2);// scope 0 at /app/example.rs:6:10: 6:11return;// scope 0 at /app/example.rs:7:2: 7:2}}
Context
I was trying various things to see if I could remove some bad behaviour from array's map, which is troublesome enough that it's caveated in the docs, #87609
I had thought this was due to newtypes, as in these bugs
But since it repro'd even without the extra wrappers I figured I'd file a distinct bug.
The text was updated successfully, but these errors were encountered:
scottmcm
added
I-slow
Issue: Problems and improvements with respect to performance of generated code.
C-bug
Category: This is a bug.
labels
Dec 4, 2021
I tried this code: https://rust.godbolt.org/z/j13WbYT6o
I expected to see this happen:
Everything should be already set up on the stack appropriately to just call
bar
immediately on enteringfoo
.Instead, this happened:
It copies the 2400 bytes to stack, then calls
bar
with the pointer to that stack copySince at the ABI level that's passed as a pointer, I suspect this is more a "how rustc emits stuff" than an LLVM bug -- maybe there's some https://llvm.org/docs/LangRef.html#parameter-attributes we could set that would help. Or maybe the unnecessary double-move in MIR is part of the problem:
Context
I was trying various things to see if I could remove some bad behaviour from array's
map
, which is troublesome enough that it's caveated in the docs, #87609I had thought this was due to newtypes, as in these bugs
But since it repro'd even without the extra wrappers I figured I'd file a distinct bug.
The text was updated successfully, but these errors were encountered: