mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
cab1120454
Summary: Previously, we would erroneously turn %pcrel_lo(label), where label has a %pcrel_hi against a weak symbol, into %pcrel_lo(label + offset), as evaluatePCRelLo would believe the target independent logic was going to fold it. Moreover, even if that were fixed, shouldForceRelocation lacks an MCAsmLayout and thus cannot evaluate the %pcrel_hi fixup to a value and check the symbol, so we would then erroneously constant-fold the %pcrel_lo whilst leaving the %pcrel_hi intact. After D72197, this same sequence also occurs for symbols with global binding, which is triggered in real-world code. Instead, as discussed in D71978, we introduce a new FKF_IsTarget flag to avoid these kinds of issues. All the resolution logic happens in one place, with no coordination required between RISCAsmBackend and RISCVMCExpr to ensure they implement the same logic twice. Although the implementation of %pcrel_hi can be left as target independent, we make it target dependent to ensure that they are handled identically to %pcrel_lo, otherwise we risk one of them being constant folded but the other being preserved. This also allows us to properly support fixup pairs where the instructions are in different fragments. Reviewers: asb, lenary, efriedma Reviewed By: efriedma Subscribers: arichardson, hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73211 |
||
---|---|---|
.. | ||
AsmParser | ||
Disassembler | ||
MCTargetDesc | ||
TargetInfo | ||
Utils | ||
CMakeLists.txt | ||
LLVMBuild.txt | ||
RISCV.h | ||
RISCV.td | ||
RISCVAsmPrinter.cpp | ||
RISCVCallingConv.td | ||
RISCVCallLowering.cpp | ||
RISCVCallLowering.h | ||
RISCVExpandPseudoInsts.cpp | ||
RISCVFrameLowering.cpp | ||
RISCVFrameLowering.h | ||
RISCVInstrFormats.td | ||
RISCVInstrFormatsC.td | ||
RISCVInstrInfo.cpp | ||
RISCVInstrInfo.h | ||
RISCVInstrInfo.td | ||
RISCVInstrInfoA.td | ||
RISCVInstrInfoC.td | ||
RISCVInstrInfoD.td | ||
RISCVInstrInfoF.td | ||
RISCVInstrInfoM.td | ||
RISCVInstructionSelector.cpp | ||
RISCVISelDAGToDAG.cpp | ||
RISCVISelLowering.cpp | ||
RISCVISelLowering.h | ||
RISCVLegalizerInfo.cpp | ||
RISCVLegalizerInfo.h | ||
RISCVMachineFunctionInfo.h | ||
RISCVMCInstLower.cpp | ||
RISCVMergeBaseOffset.cpp | ||
RISCVRegisterBankInfo.cpp | ||
RISCVRegisterBankInfo.h | ||
RISCVRegisterBanks.td | ||
RISCVRegisterInfo.cpp | ||
RISCVRegisterInfo.h | ||
RISCVRegisterInfo.td | ||
RISCVSubtarget.cpp | ||
RISCVSubtarget.h | ||
RISCVSystemOperands.td | ||
RISCVTargetMachine.cpp | ||
RISCVTargetMachine.h | ||
RISCVTargetObjectFile.cpp | ||
RISCVTargetObjectFile.h | ||
RISCVTargetTransformInfo.cpp | ||
RISCVTargetTransformInfo.h |