[all-commits] [llvm/llvm-project] 1c68c4: [LoongArch][MC] Modify branch evaluation for MCIns...
ZhaoQi via All-commits
all-commits at lists.llvm.org
Thu Nov 23 00:38:55 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1c68c4c57a65a67963264878bc4646be8b58854c
https://github.com/llvm/llvm-project/commit/1c68c4c57a65a67963264878bc4646be8b58854c
Author: ZhaoQi <zhaoqi01 at loongson.cn>
Date: 2023-11-23 (Thu, 23 Nov 2023)
Changed paths:
M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp
A llvm/test/tools/llvm-objdump/ELF/LoongArch/branches.s
A llvm/test/tools/llvm-objdump/ELF/LoongArch/lit.local.cfg
Log Message:
-----------
[LoongArch][MC] Modify branch evaluation for MCInstrAnalysis (#73205)
Function evaluateBranch() is used to compute target address for a given
branch instruction and return true on success. But target address of
indirect branch cannot be simply added, so rule it out and just return
false.
This patch also add objdump tests which capture the current state of
support for printing branch targets. Without this patch, the result of
"jirl $zero, $a0, 4" is "jirl $zero, $a0, 4 <foo+0x64>". It is obviously
incorrect, because this instruction represents an indirect branch whose
target address depends on both the register value and the imm. After
this patch, it will be right despite loss of details.
More information about the All-commits
mailing list