diff options
author | Robert Konicar <xkonicar@fi.muni.cz> | 2025-03-03 10:14:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-03 10:14:33 +0100 |
commit | 59f407020ea60d46af974563e4b87b8d9f188802 (patch) | |
tree | eff8bf0198ea17fc6f12dcb2660eb83e4958f47e /llvm/lib/CodeGen/CodeGen.cpp | |
parent | cb113a78126ad54109738c298794ff2293a47b37 (diff) | |
download | llvm-59f407020ea60d46af974563e4b87b8d9f188802.zip llvm-59f407020ea60d46af974563e4b87b8d9f188802.tar.gz llvm-59f407020ea60d46af974563e4b87b8d9f188802.tar.bz2 |
[MLIR] Fix printing of switch case for negative value (#129266)
This patch fixes the printer for the `llvm.switch` operation with
negative values in a case.
The previous behaviour printed the value as an unsigned integer, as the
`getLimitedValue()` returns unsigned value. This caused the roundtrip to
fail (assertion in `APInt`), as the printed unsigned integer could not
be parsed into the same amount of bits in a signed integer.
I don't see a good reason for keeping any restriction on the printed
value, as LLVMIR `switch` afaik does not have a limit on the bitwidth of
the values and `APInt` handles printing just fine.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
0 files changed, 0 insertions, 0 deletions