[all-commits] [llvm/llvm-project] 3783d3: [X86] Don't match x87 register inline asm constrai...

topperc via All-commits all-commits at lists.llvm.org
Thu Sep 17 11:27:36 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3783d3bc7b3dd966ac3b9436b73f16f855d12ff2
      https://github.com/llvm/llvm-project/commit/3783d3bc7b3dd966ac3b9436b73f16f855d12ff2
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-09-17 (Thu, 17 Sep 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    A llvm/test/CodeGen/X86/asm-reject-x87-int.ll

  Log Message:
  -----------
  [X86] Don't match x87 register inline asm constraints unless the VT is floating point or its a clobber

The register class picked will be the RFP80 register class which has a f80 VT. The code in SelectionDAGBuilder that generates copies around inline assembly doesn't know how to handle an integer and floating point type of different bit widths.

The test case is derived from this https://godbolt.org/z/sEa659 which gcc accepts but clang crashes on. This patch just gives a more graceful error. I'm not sure if the single element struct case is special in gcc. Adding another field to the struct makes gcc reject it. If we want to support this correctly I think we need a change in the frontend to give us the true element type. Right now the frontend just realizes the constraint can take a memory argument so creates an integer type of the same size and bitcasts.

Differential Revision: https://reviews.llvm.org/D87485




More information about the All-commits mailing list