[clang] [llvm] [LLVM][IR] Use splat syntax when printing Constant[Data]Vector. (PR #112548)

Christian Ulmann via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 05:39:14 PST 2024


Dinistro wrote:

I stumbled over this change while trying to integrate LLVM head into our downstream project. Is there any way to enforce that this still prints textual IR in the old format, i.e., without "splat"? I found the following flags, but they do not seem to provide the expected behavior.

```
--use-constant-int-for-fixed-length-splat
--use-constant-fp-for-fixed-length-splat
--use-constant-int-for-scalable-splat
--use-constant-fp-for-scalable-splat
```

What I would require is some way of forcing `opt` to roundtrip on the following IR file **without** transforming this to splat syntax:

```
define <2 x double> @test(<2 x double> %in) {
  %res = fmul <2 x double> %in, <double 3.000000e+00, double 3.000000e+00>
  ret <2 x double> %res
}
```

Ofc., we can find other kinds of workarounds, but I wanted to first to confirm that this is indeed expected behavior or not.

https://github.com/llvm/llvm-project/pull/112548


More information about the llvm-commits mailing list