Page MenuHomePhabricator

[X86] Extend boolean arguments to inline-asm according to getBooleanType
ClosedPublic

Authored by kparzysz on Apr 3 2019, 9:09 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

kparzysz created this revision.Apr 3 2019, 9:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2019, 9:09 AM
Herald added a subscriber: eraman. · View Herald Transcript

Note that with:

  1. https://reviews.llvm.org/D60208 ("[X86] Extend boolean arguments to

inline-asm according to getBooleanType")

  1. https://reviews.llvm.org/D58260 ("[INLINER] allow inlining of

blockaddresses if sole uses are callbrs")

  1. https://reviews.llvm.org/D56571 ("[RFC prototype] Implementation of

asm-goto support in clang")

I can compile a mainline x86 defconfig Linux kernel and boot it in QEMU.

E5ten added a subscriber: E5ten.Apr 3 2019, 9:57 AM
This revision is now accepted and ready to land.Apr 3 2019, 10:09 AM
This revision was automatically updated to reflect the committed changes.

This looks like the same bug is present in the generic code in llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp as well.

E.g.,

$ echo 'void f() { asm("# TEST: %0" : : "i"((_Bool)255)); }' | arm-none-eabi-gcc -S -o - -xc - | grep TEST
        # TEST: #1
$ echo 'void f() { asm("# TEST: %0" : : "i"((_Bool)255)); }' | build/bin/clang -target arm-none-eabi -S -o - -xc - | grep TEST
        @ TEST: #-1
kees added a subscriber: kees.Apr 3 2019, 11:08 AM

What other target have their own lowering code? (Or, restated, is x86 the only target not using the generic lowering code?)