This is an archive of the discontinued LLVM Phabricator instance.

[Atomic] Merge alignment information from Decl and from Type when emit atomic expression.
ClosedPublic

Authored by wmi on Aug 30 2017, 2:09 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

wmi created this revision.Aug 30 2017, 2:09 PM
rjmccall added inline comments.Sep 6 2017, 5:11 PM
lib/CodeGen/CGAtomic.cpp
680 ↗(On Diff #113298)

Just use EmitPointerWithAlignment instead of EmitScalarExpr to emit the pointer operand.

wmi updated this revision to Diff 114300.Sep 7 2017, 6:13 PM

Address John's comment.

rjmccall accepted this revision.Sep 7 2017, 6:16 PM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 7 2017, 6:16 PM
This revision was automatically updated to reflect the committed changes.
twoh added a subscriber: twoh.Sep 5 2018, 9:22 AM

Hello, I observed a case where atomic builtin generates libcall when the corresponding sync builtin generates an atomic instruction (https://bugs.llvm.org/show_bug.cgi?id=38846). It seems that the alignment checking for __atomic builtins (line 759 of this patch) results the difference, and wonder if the check is actually necessary. Could anyone please shed some light on understanding this? Thanks!