[all-commits] [llvm/llvm-project] 734881: [Hexagon] Fix range checks for immediate operands
Krzysztof Parzyszek via All-commits
all-commits at lists.llvm.org
Mon Jun 19 08:23:01 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 734881a6d546c6065a4aa43c3d876337b8b2a263
https://github.com/llvm/llvm-project/commit/734881a6d546c6065a4aa43c3d876337b8b2a263
Author: Krzysztof Parzyszek <kparzysz at quicinc.com>
Date: 2023-06-19 (Mon, 19 Jun 2023)
Changed paths:
M llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
M llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp
A llvm/test/CodeGen/Hexagon/imm-range-check.ll
Log Message:
-----------
[Hexagon] Fix range checks for immediate operands
The output assembly (textual) contains the instruction
r29 = add(r29,#4294967136)
The value 4294967136 is -160 when interpreted as a signed 32-bit
integer, so it fits in the range of the immediate operand without
a constant extender. The range check in HexagonInstrInfo was putting
the operand value into an int variable, reporting no need for an
extender. This resulted in a packet with 4 instructions, including
the "add". The corresponding check in HexagonMCInstrInfo was using
an int64_t variable, causing the range check to fail, and an extender
to be emitted when lowering to MCInst, resulting in a packet with
too many instructions.
More information about the All-commits
mailing list