<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54490>54490</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Spurious "invalid type for inline asm constraint string" when compiling IR with LLC
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          SixthDot
      </td>
    </tr>
</table>

<pre>
    ## description

code containing inline asm and manually compiled in two steps is rejected by LLC.
Happens under linux x86_64.

## IR

```LLVM
; ModuleID = 'asm_exp'
source_filename = "asm_exp"

; Function Attrs: noinline
define i64 @asm_exp.test2() #0 {
entry:
  %0 = call i64 asm "movq $0, $1", "i,=r"(i64 42)
  ret i64 %0
}

attributes #0 = { noinline }
```

## command line

(all version of llc are affected)

```bash
$ llc test.ll --x86-asm-syntax=att --mtriple=x86_64-unknown-linux-gnu
```

## output

> /opt/compiler-explorer/clang-11.0.1/bin/llc: error: /opt/compiler-explorer/clang-11.0.1/bin/llc: <source>:7:17: error: invalid type for  inline asm constraint string
>  %0 = call i64 asm "movq $0, $1", "i,=r"(i64 42)         

## see also

- [test case on compiler explorer](https://godbolt.org/z/dqjKhasrf)      
- #36137, likely the same although the reporter specifies it's related to the `uselistorder` attribute
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVNtuo0gQ_Rr80gJBQ4z9wEMSb7TRZl5mpH2NGiibnml3M31J7P36PQ3GuWi0K60WQV-LqlOnLq3pz03CS7ysJ9dZOXppdJLvkvx2HjvTE-uM9kJqqQ9MaiU1MeGOTOieHYUOQqkzRI6jVNRDgPlXw5yn0THpmKXv1HlctGf29HSfzWp_F-NI2rGge7IMKsOJnTbr53WVvbd-wfb49cPhOp_fp6c_v1yOyjv2xfRB0eOOJSU-XgPiM51GrGYZZ4Lt6HkPlFoc6SLGr2L8gw0ofAi6i3SwW--tS8pb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