This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel][InlineAsm][X86]Fallback on DAG ISel when lowering inline assembly
AbandonedPublic

Authored by mingmingl on Apr 25 2023, 3:49 PM.

Details

Summary

Currently inline assembly lowering reports error as shown in https://gcc.godbolt.org/z/Kdx7e3n9M

Diff Detail

Event Timeline

mingmingl created this revision.Apr 25 2023, 3:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 3:49 PM
mingmingl requested review of this revision.Apr 25 2023, 3:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 3:49 PM
mingmingl updated this revision to Diff 516992.Apr 25 2023, 5:12 PM

undo the change in CodeGen/GlobalISel/IRTranslator.cpp as they are not relevant in this patch (the call to fallback ) in IRTranslator::translate will return false so translateInlineAsm won't be executed.

arsenm requested changes to this revision.Apr 25 2023, 6:39 PM

I don't understand why this needs to be special cased. The regular fallback seems to work expected as-is.

This revision now requires changes to proceed.Apr 25 2023, 6:39 PM
mingmingl abandoned this revision.Apr 25 2023, 9:01 PM

https://gcc.godbolt.org/z/vq4nGG793 shows setting global-isel-abort to DisableWithDiag indeed works.

Thinking back what I have in mind when writing this patch, I misunderstood how I shall use fallBackToDAGISel (thought the fallback path would also call this method )-> in fact, when IRTranslator handles translation error, it sets properties on machine-function; and let codegen pass builder to decide whether to restore machine function and falls back to selection-dag-based ISel (decided by -global-isel-abort mode)

https://gcc.godbolt.org/z/vq4nGG793 shows setting global-isel-abort to DisableWithDiag indeed works.

Thinking back what I have in mind when writing this patch, I misunderstood how I shall use fallBackToDAGISel (thought the fallback path would also call this method )-> in fact, when IRTranslator handles translation error, it sets properties on machine-function; and let codegen pass builder to decide whether to restore machine function and falls back to selection-dag-based ISel (decided by -global-isel-abort mode)

IIRC the only reason that exists was for a compile time hack for common cases that would fall back.