This is an archive of the discontinued LLVM Phabricator instance.

[X86][MS-InlineAsm] Make the constraint *m to be simple place holder
ClosedPublic

Authored by pengfei on Dec 7 2021, 1:11 AM.

Details

Summary

D113096 solved the "undefined reference to xxx" issue by adding
constraint *m for the global var. But it has strong side effect due to
the symbol in the assembly being replaced with constraint variable.
This leads to some lowering fails. https://godbolt.org/z/h3nWoerPe

This patch fix the problem by use the constraint *m as place holder
rather than real constraint. It has negligible effect for the existing
code generation.

Diff Detail

Event Timeline

pengfei created this revision.Dec 7 2021, 1:11 AM
pengfei requested review of this revision.Dec 7 2021, 1:11 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 7 2021, 1:11 AM
pengfei edited the summary of this revision. (Show Details)Dec 7 2021, 1:12 AM
skan added inline comments.Dec 9 2021, 3:16 AM
clang/test/CodeGen/ms-inline-asm-functions.c
42

This change is strange here. Others looks good to me.

pengfei added inline comments.Dec 9 2021, 4:08 AM
clang/test/CodeGen/ms-inline-asm-functions.c
42

Yeah, but we can't roll back all the constraint added D113096 unless we add a separate flag to record it.
In fact, using the symbol won't result in any functionality issue. And in this case, I checked the built binary is the same as the one before this patch.

skan accepted this revision.Dec 9 2021, 6:45 AM

LGTM

This revision is now accepted and ready to land.Dec 9 2021, 6:45 AM

Thanks for the review!