This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAGBuilder] Let asm constraint "i" accept an undef operand.
AbandonedPublic

Authored by jonpa on Oct 24 2020, 1:55 AM.

Details

Summary

Make LowerAsmOperandForConstraint() accept an undef operand for the "i" constraint.

Diff Detail

Event Timeline

jonpa created this revision.Oct 24 2020, 1:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2020, 1:55 AM
jonpa requested review of this revision.Oct 24 2020, 1:55 AM
nickdesaulniers requested changes to this revision.EditedOct 26 2020, 12:40 PM

Interesting, did this come from actual C code? It looks to me like GCC and Clang both currently reject such input:

void foo(void) {
    int x;
    asm volatile (""::"i"(x));
}

Why should we allow that? Seems more indicative of a bug in the source code? Or do you have a different test case that more clearly illuminates the issue in LLVM?

llvm/test/CodeGen/SystemZ/asm-20.ll
3

Probably don't need to reorder these?

This revision now requires changes to proceed.Oct 26 2020, 12:40 PM
jonpa abandoned this revision.Oct 27 2020, 7:38 AM

Thanks for review, but as you suspected this test case did not reflect the true problem. A new patch is suggested at: https://reviews.llvm.org/D90231.