Only single and double FP immediates are correctly printed by MachineInstr::print() during debug output. Half float type goes to APFloat::convertToDouble() and hits assertion it is not a double semantics. This diff prints half machine operands correctly.
Diff Detail
Event Timeline
Please include a test case (you'll need to put '; REQUIRES: asserts' in it if you're checking debug output. Maybe, however, you can get the same problem if you use MIR, in which case that would be better.
MachineInstr.cpp | ||
---|---|---|
379 ↗ | (On Diff #46847) | unused -> Unused |
The testcase is simple:
; RUN: llc -march=hsail -print-after=dead-mi-elimination < %s 2>&1 | FileCheck %s
; CHECK: half 4.000000e+00
define half @half_const(half %in) {
entry:
%add = fadd half %in, 0xH4400 ret half %add
}
Though I found no backend in the trunk where a half immediate survives instruction selection and present as machine operand, thus I do not see what to put into -march for testing.
Ah, okay. In that case, with unused capatilized to match project coding conventions, this LGTM. Just mention in the commit message that we can't (yet) hit this with any in-tree target.
lib/CodeGen/MachineInstr.cpp | ||
---|---|---|
375–384 | Please consistently use braces. |
Please consistently use braces.