authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-19 11:31:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-19 11:31:37-07:00
logfe8c3ffeb1c6cfb1cc0b7a81e433add3c57b2337
treedeb8a54263d2b2fe565634477859e9b15cf95b7b
parent74fb65fb424a0fbb2eb00109fe4cee17aa2646c2

LLVM: change commentary on isByRef

This branch originally started out as a potential workaround to address #11450. It did not solve that problem, however, it did end up fixing #11498!

1 files changed, 2 insertions(+), 10 deletions(-)

src/codegen/llvm.zig+2-10
...@@ -9356,11 +9356,11 @@ fn ccAbiPromoteInt(...@@ -9356,11 +9356,11 @@ fn ccAbiPromoteInt(
9356 return null;9356 return null;
9357}9357}
93589358
9359/// This is the one source of truth for whether a type is passed around as an LLVM pointer,
9360/// or as an LLVM value.
9359fn isByRef(ty: Type) bool {9361fn isByRef(ty: Type) bool {
9360 // For tuples and structs, if there are more than this many non-void9362 // For tuples and structs, if there are more than this many non-void
9361 // fields, then we make it byref, otherwise byval.9363 // fields, then we make it byref, otherwise byval.
9362 // TODO we actually want to set this to 2, however it is tripping an LLVM 14 regression:
9363 // https://github.com/llvm/llvm-project/issues/56585
9364 const max_fields_byval = 0;9364 const max_fields_byval = 0;
93659365
9366 switch (ty.zigTypeTag()) {9366 switch (ty.zigTypeTag()) {
...@@ -9421,10 +9421,6 @@ fn isByRef(ty: Type) bool {...@@ -9421,10 +9421,6 @@ fn isByRef(ty: Type) bool {
9421 return false;9421 return false;
9422 }9422 }
9423 return true;9423 return true;
9424 // TODO we actually want this logic:
9425 // however it is tripping an LLVM 14 regression:
9426 // https://github.com/llvm/llvm-project/issues/56585
9427 //return isByRef(payload_ty);
9428 },9424 },
9429 .Optional => {9425 .Optional => {
9430 var buf: Type.Payload.ElemType = undefined;9426 var buf: Type.Payload.ElemType = undefined;
...@@ -9436,10 +9432,6 @@ fn isByRef(ty: Type) bool {...@@ -9436,10 +9432,6 @@ fn isByRef(ty: Type) bool {
9436 return false;9432 return false;
9437 }9433 }
9438 return true;9434 return true;
9439 // TODO we actually want this logic:
9440 // however it is tripping an LLVM 14 regression:
9441 // https://github.com/llvm/llvm-project/issues/56585
9442 //return isByRef(payload_ty);
9443 },9435 },
9444 }9436 }
9445}9437}