[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-22 Thread Volodymyr Sapsai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC323156: Reland [CodeGen] Fix crash when a function taking transparent union is… (authored by vsapsai, committed by ). Changed prior to commit: https://reviews.llvm.org/D41311?vs=130038=130964#toc

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-22 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM. https://reviews.llvm.org/D41311 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-16 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 130038. vsapsai added a comment. - Try another approach for the fix. It has broader impact but semantically seems to be more correct. Also I think `hasScalarEvaluationKind` should use `Arg->getType()` everywhere as it matches `EmitParmDecl` behaviour.

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-10 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2321 + ArgI.getCoerceToType() == + ConvertType(isPromoted ? Ty : Arg->getType()) && ArgI.getDirectOffset() == 0) { ahatanak wrote: > Maybe a comment

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2321 + ArgI.getCoerceToType() == + ConvertType(isPromoted ? Ty : Arg->getType()) && ArgI.getDirectOffset() == 0) { Maybe a comment explaining why different

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. It doesn't look like this patch would break IRGen for functions that receive fp16 types. fp16 is passed as i32 or float (without promotion) on ARM and as half on ARM64. It should work fine. https://reviews.llvm.org/D41311

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-04 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a subscriber: ahatanak. vsapsai added a comment. Add Akira as __fp16 expert to make sure I don't break some edge cases. https://reviews.llvm.org/D41311 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-04 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 128643. vsapsai added a comment. - Fix using CreateCoercedStore for promoted float parameters. For promoted parameters double -> float conversion should use fptrunc, not casting through memory preserving bits. Tried to change CreateCoercedStore to do

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2018-01-04 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai reopened this revision. vsapsai added a comment. This revision is now accepted and ready to land. The fix wasn't entirely correct and was reverted in r321306 as it caused test failures FAIL: imp.execution_time FAIL: 2007-01-04-KNR-Args.execution_time FAIL: sse_expandfft.execution_time

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2017-12-21 Thread Volodymyr Sapsai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC321296: [CodeGen] Fix crash when a function taking transparent union is redeclared. (authored by vsapsai, committed by ). Changed prior to commit: https://reviews.llvm.org/D41311?vs=127779=127923#toc

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2017-12-20 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Okay, I think that's reasonable enough. LGTM. https://reviews.llvm.org/D41311 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2017-12-20 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 127779. vsapsai added a comment. - Address review comment, compare ArgI type with Arg type. Update tests to account for coerced store when types don't match. https://reviews.llvm.org/D41311 Files: clang/lib/CodeGen/CGCall.cpp

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2017-12-20 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2321 + !isa(ConvertType(Arg->getType())) && ArgI.getCoerceToType() == ConvertType(Ty) && ArgI.getDirectOffset() == 0) { vsapsai wrote: > rjmccall wrote: > > I

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2017-12-19 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2321 + !isa(ConvertType(Arg->getType())) && ArgI.getCoerceToType() == ConvertType(Ty) && ArgI.getDirectOffset() == 0) { rjmccall wrote: > I think the right fix

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2017-12-15 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2321 + !isa(ConvertType(Arg->getType())) && ArgI.getCoerceToType() == ConvertType(Ty) && ArgI.getDirectOffset() == 0) { I think the right fix is to change the

[PATCH] D41311: [CodeGen] Fix crash when a function taking transparent union is redeclared.

2017-12-15 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai created this revision. vsapsai added reviewers: rjmccall, rafael. Herald added subscribers: kristof.beyls, aemerson. When a function taking transparent union is declared as taking one of union members earlier in the translation unit, clang would hit an "Invalid cast" assertion during