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(
93569356 return null;
93579357}
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.
93599361fn isByRef(ty: Type) bool {
93609362 // For tuples and structs, if there are more than this many non-void
93619363 // 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
93649364 const max_fields_byval = 0;
93659365
93669366 switch (ty.zigTypeTag()) {
......@@ -9421,10 +9421,6 @@ fn isByRef(ty: Type) bool {
94219421 return false;
94229422 }
94239423 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);
94289424 },
94299425 .Optional => {
94309426 var buf: Type.Payload.ElemType = undefined;
......@@ -9436,10 +9432,6 @@ fn isByRef(ty: Type) bool {
94369432 return false;
94379433 }
94389434 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);
94439435 },
94449436 }
94459437}