1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/lib/Target/RISCV
Shengchen Kan 88597bc560 [MC][Bugfix] Remove redundant parameter for relaxInstruction
Summary:
Before this patch, `relaxInstruction` takes three arguments, the first
argument refers to the instruction before relaxation and the third
argument is the output instruction after relaxation. There are two quite
strange things:
  1) The first argument's type is `const MCInst &`, the third
  argument's type is `MCInst &`, but they may be aliased to the same
  variable
  2) The backends of ARM, AMDGPU, RISC-V, Hexagon assume that the third
  argument is a fresh uninitialized `MCInst` even if `relaxInstruction`
  may be called like `relaxInstruction(Relaxed, STI, Relaxed)` in a
  loop.

In this patch, we drop the thrid argument, and let `relaxInstruction`
directly modify the given instruction. Also, this patch fixes the bug https://bugs.llvm.org/show_bug.cgi?id=45580, which is introduced by D77851, and
breaks the assumption of ARM, AMDGPU, RISC-V, Hexagon.

Reviewers: Razer6, MaskRay, jyknight, asb, luismarques, enderby, rtaylor, colinl, bcain

Reviewed By: Razer6, MaskRay, bcain

Subscribers: bcain, nickdesaulniers, nathanchance, wuzish, annita.zhang, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, tpr, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78364
2020-04-21 11:06:55 +08:00
..
AsmParser [RISCV][AsmParser] Implement .option (no)pic 2020-04-17 12:08:30 +00:00
Disassembler [RISCV] Add MC layer support for proposed Bit Manipulation extension (version 0.92) 2020-04-09 18:04:22 +01:00
MCTargetDesc [MC][Bugfix] Remove redundant parameter for relaxInstruction 2020-04-21 11:06:55 +08:00
TargetInfo
Utils
CMakeLists.txt
LLVMBuild.txt
RISCV.h
RISCV.td [RISCV] Add MC layer support for proposed Bit Manipulation extension (version 0.92) 2020-04-09 18:04:22 +01:00
RISCVAsmPrinter.cpp [RISCV] ELF attribute section for RISC-V. 2020-03-31 16:16:19 +08:00
RISCVCallingConv.td
RISCVCallLowering.cpp
RISCVCallLowering.h
RISCVExpandPseudoInsts.cpp
RISCVFrameLowering.cpp CodeGen: Use Register in TargetFrameLowering 2020-04-07 17:07:44 -04:00
RISCVFrameLowering.h CodeGen: Use Register in TargetFrameLowering 2020-04-07 17:07:44 -04:00
RISCVInstrFormats.td
RISCVInstrFormatsC.td
RISCVInstrInfo.cpp
RISCVInstrInfo.h
RISCVInstrInfo.td [RISCV] Add MC layer support for proposed Bit Manipulation extension (version 0.92) 2020-04-09 18:04:22 +01:00
RISCVInstrInfoA.td
RISCVInstrInfoB.td [RISCV] Add MC layer support for proposed Bit Manipulation extension (version 0.92) 2020-04-09 18:04:22 +01:00
RISCVInstrInfoC.td
RISCVInstrInfoD.td [RISCV] Select +0.0 immediate using fmv.{w,d}.x / fcvt.d.w 2020-03-20 09:42:24 +00:00
RISCVInstrInfoF.td [RISCV] Select +0.0 immediate using fmv.{w,d}.x / fcvt.d.w 2020-03-20 09:42:24 +00:00
RISCVInstrInfoM.td
RISCVInstructionSelector.cpp
RISCVISelDAGToDAG.cpp [RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp 2020-04-01 11:30:21 +08:00
RISCVISelDAGToDAG.h [RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp 2020-04-01 11:30:21 +08:00
RISCVISelLowering.cpp [CallSite removal][TargetLowering] Replace ImmutableCallSite with CallBase 2020-04-13 13:50:15 -07:00
RISCVISelLowering.h CodeGen: Use Register in TargetLowering 2020-04-08 12:10:58 -04:00
RISCVLegalizerInfo.cpp
RISCVLegalizerInfo.h
RISCVMachineFunctionInfo.h
RISCVMCInstLower.cpp
RISCVMergeBaseOffset.cpp
RISCVRegisterBankInfo.cpp Revert "[TableGen][GlobalISel] Account for HwMode in RegisterBank register sizes" 2020-03-20 11:02:50 +01:00
RISCVRegisterBankInfo.h Revert "[TableGen][GlobalISel] Account for HwMode in RegisterBank register sizes" 2020-03-20 11:02:50 +01:00
RISCVRegisterBanks.td
RISCVRegisterInfo.cpp CodeGen: More conversions to use Register 2020-04-07 18:54:36 -04:00
RISCVRegisterInfo.h CodeGen: More conversions to use Register 2020-04-07 18:54:36 -04:00
RISCVRegisterInfo.td
RISCVSchedRocket32.td [RISCV] Add new SchedRead SchedWrite 2020-03-10 00:12:27 +08:00
RISCVSchedRocket64.td [RISCV] Add new SchedRead SchedWrite 2020-03-10 00:12:27 +08:00
RISCVSchedule.td [RISCV] Add new SchedRead SchedWrite 2020-03-10 00:12:27 +08:00
RISCVSubtarget.cpp Revert "[TableGen][GlobalISel] Account for HwMode in RegisterBank register sizes" 2020-03-20 11:02:50 +01:00
RISCVSubtarget.h [RISCV] Add MC layer support for proposed Bit Manipulation extension (version 0.92) 2020-04-09 18:04:22 +01:00
RISCVSystemOperands.td
RISCVTargetMachine.cpp
RISCVTargetMachine.h
RISCVTargetObjectFile.cpp [X86] Reland D71360 Clean up UseInitArray initialization for X86ELFTargetObjectFile 2020-03-20 21:57:34 -07:00
RISCVTargetObjectFile.h
RISCVTargetTransformInfo.cpp
RISCVTargetTransformInfo.h