llvm-project/llvm/lib/Target/Mips
Matt Arsenault d55d592a92 GlobalISel: Do not set observer of MachineIRBuilder in LegalizerHelper
This fixes double printing of insertion debug messages in the
legalizer.

Try to cleanup usage of observers. Currently the use of observers is
pretty hard to follow and it's not clear what is responsible for
them. Observers are referenced in 3 places:

1. In the MachineFunction
2. In the MachineIRBuilder
3. In the LegalizerHelper

The observers in the MachineFunction and MachineIRBuilder are both
called only on insertions, and are redundant with each other. The
source of the double printing was the same observer was added to both
the MachineFunction, and the MachineIRBuilder. One of these references
needs to be removed. Arguably observers in general should be fully
removed from one or the other, but it may be useful to have a local
observer in the MachineIRBuilder that is not added to the function's
observers. Alternatively, the wrapper observer could manage a local
observer in one place.

The LegalizerHelper only ever calls the observer on changing/changed
instructions, and never insertions. Logically these are two different
types of observers, for changes and for insertions.

Additionally, some places used the GISelObserverWrapper when they only
needed a single observer they could use directly.

Setting the observer in the LegalizerHelper constructor is not
flexible enough if the LegalizerHelper is constructed anywhere outside
the one used by the legalizer. AMDGPU calls the LegalizerHelper in
RegBankSelect, and needs to use a local observer to apply the regbank
to newly created instructions. Currently it accomplishes this by
constructing a local MachineIRBuilder. I'm trying to move the
MachineIRBuilder to be owned/maintained by the RegBankSelect pass
itself, but the locally constructed LegalizerHelper would reset the
observer.

Mips also has a special case use of the LegalizationArtifactCombiner
in applyMappingImpl; I think we do need to run the artifact combiner
during RegBankSelect, but in a more consistent way outside of
applyMappingImpl.
2021-01-13 10:44:31 -05:00
..
AsmParser [MIPS] MipsAsmParser - Pass Twine by const reference instead of by value. NFCI. 2021-01-06 14:22:04 +00:00
Disassembler llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
MCTargetDesc [AsmWriter] Factor out mnemonic generation to accessible getMnemonic. 2020-11-17 09:47:38 +00:00
TargetInfo llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
CMakeLists.txt llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
MSA.txt
MicroMips32r6InstrFormats.td
MicroMips32r6InstrInfo.td
MicroMipsDSPInstrFormats.td
MicroMipsDSPInstrInfo.td
MicroMipsInstrFPU.td
MicroMipsInstrFormats.td [llvm] NFC: Fix trivial typo in rst and td files 2020-04-23 14:26:32 +09:00
MicroMipsInstrInfo.td [llvm] NFC: Fix trivial typo in rst and td files 2020-04-23 14:26:32 +09:00
MicroMipsSizeReduction.cpp [NFC] Silence compiler warning [-Wmissing-braces]. 2020-02-18 10:37:12 -08:00
Mips.h
Mips.td [mips] Rename FeatureMadd4 to FeatureNoMadd4. NFC 2020-07-15 14:39:38 +03:00
Mips16FrameLowering.cpp [MC] Change MCCFIInstruction::createDefCfaOffset to cfiDefCfaOffset which does not negate Offset 2020-05-22 17:07:11 -07:00
Mips16FrameLowering.h ArrayRef'ize restoreCalleeSavedRegisters. NFCI. 2020-02-29 09:50:23 +01:00
Mips16HardFloat.cpp [AsmPrinter] De-capitalize all AsmPrinter::Emit* but EmitInstruction 2020-02-13 17:06:24 -08:00
Mips16HardFloatInfo.cpp
Mips16HardFloatInfo.h
Mips16ISelDAGToDAG.cpp Mips: Don't store MachineFunction in MipsFunctionInfo 2020-06-30 16:08:51 -04:00
Mips16ISelDAGToDAG.h
Mips16ISelLowering.cpp Mips: Don't store MachineFunction in MipsFunctionInfo 2020-06-30 16:08:51 -04:00
Mips16ISelLowering.h
Mips16InstrFormats.td
Mips16InstrInfo.cpp ArrayRef'ize spillCalleeSavedRegisters. NFCI. 2020-02-08 12:19:23 +01:00
Mips16InstrInfo.h [NFC] unsigned->Register in storeRegTo/loadRegFromStack 2020-02-03 14:22:16 +01:00
Mips16InstrInfo.td [llvm] NFC: Fix trivial typo in rst and td files 2020-04-23 14:26:32 +09:00
Mips16RegisterInfo.cpp CodeGen: More conversions to use Register 2020-04-07 18:54:36 -04:00
Mips16RegisterInfo.h [Mips] Remove unused forward declarations. NFC. 2020-04-23 15:02:18 +01:00
Mips32r6InstrFormats.td
Mips32r6InstrInfo.td
Mips64InstrInfo.td [mips] Implement sle/sleu pseudo instructions 2020-03-22 23:34:31 +03:00
Mips64r6InstrInfo.td
MipsAnalyzeImmediate.cpp
MipsAnalyzeImmediate.h
MipsAsmPrinter.cpp [XRay] Change mips to use version 2 sled (PC-relative address) 2020-09-20 17:59:57 -07:00
MipsAsmPrinter.h [AsmPrinter][MCStreamer] De-capitalize EmitInstruction and EmitCFI* 2020-02-13 22:08:55 -08:00
MipsBranchExpansion.cpp [Mips] Make MipsBranchExpansion aware of BBIT family of branch 2020-03-31 09:20:51 +02:00
MipsCCState.cpp [ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers. 2020-04-14 14:11:02 +03:00
MipsCCState.h
MipsCallLowering.cpp [GlobalISel] Base implementation for sret demotion. 2021-01-06 10:30:50 +05:30
MipsCallLowering.h [GlobalISel] Base implementation for sret demotion. 2021-01-06 10:30:50 +05:30
MipsCallingConv.td
MipsCondMov.td
MipsConstantIslandPass.cpp [NFC] Add the getSizeInBytes() interface for MachineConstantPoolValue 2021-01-05 03:22:45 +00:00
MipsDSPInstrFormats.td [TableGen] Support combining AssemblerPredicates with ORs 2020-03-13 17:13:51 +00:00
MipsDSPInstrInfo.td
MipsDelaySlotFiller.cpp [NFC] Remove unused GetUnderlyingObject paramenter 2020-07-31 02:10:03 -07:00
MipsEVAInstrFormats.td
MipsEVAInstrInfo.td
MipsExpandPseudo.cpp [NFC][MC] TargetRegisterInfo::getSubReg is a MCRegister. 2020-12-02 15:46:38 -08:00
MipsFastISel.cpp Mips: Don't store MachineFunction in MipsFunctionInfo 2020-06-30 16:08:51 -04:00
MipsFrameLowering.cpp
MipsFrameLowering.h
MipsISelDAGToDAG.cpp Mips: Don't store MachineFunction in MipsFunctionInfo 2020-06-30 16:08:51 -04:00
MipsISelDAGToDAG.h
MipsISelLowering.cpp [SelectionDAG][X86][PowerPC][Mips] Replace the default implementation of LowerOperationWrapper with the X86 and PowerPC version. 2020-11-20 10:06:53 -08:00
MipsISelLowering.h [SelectionDAG][X86][PowerPC][Mips] Replace the default implementation of LowerOperationWrapper with the X86 and PowerPC version. 2020-11-20 10:06:53 -08:00
MipsInstrFPU.td [mips] Implement add.ps, mul.ps and sub.ps 2020-10-30 10:59:15 +03:00
MipsInstrFormats.td [mips][NFC] Remove unused instruction formats 2020-01-28 13:30:59 +01:00
MipsInstrInfo.cpp [llvm] Ensure newlines at the end of files (NFC) 2021-01-10 09:24:57 -08:00
MipsInstrInfo.h [CSInfo][MIPS] Describe parameter value loaded by ADDiu 2020-06-04 12:39:56 +02:00
MipsInstrInfo.td [mips] Rename FeatureMadd4 to FeatureNoMadd4. NFC 2020-07-15 14:39:38 +03:00
MipsInstructionSelector.cpp Mips: Don't store MachineFunction in MipsFunctionInfo 2020-06-30 16:08:51 -04:00
MipsLegalizerInfo.cpp GlobalISel: Add generic instructions for memory intrinsics 2020-08-26 20:08:45 -04:00
MipsLegalizerInfo.h GlobalISel: Pass LegalizerHelper to custom legalize callbacks 2020-06-18 17:17:38 -04:00
MipsMCInstLower.cpp
MipsMCInstLower.h
MipsMSAInstrFormats.td
MipsMSAInstrInfo.td [Mips] Add intrinsics for 4-byte and 8-byte MSA loads/stores. 2020-02-11 11:47:30 +01:00
MipsMTInstrFormats.td
MipsMTInstrInfo.td
MipsMachineFunction.cpp [Alignment][NFC] Migrate MachineFrameInfo::CreateStackObject to Align 2020-07-01 07:28:11 +00:00
MipsMachineFunction.h Mips: Don't store MachineFunction in MipsFunctionInfo 2020-06-30 16:08:51 -04:00
MipsModuleISelDAGToDAG.cpp
MipsOptimizePICCall.cpp DomTree: Remove getChildren() accessor 2020-07-06 21:58:11 +02:00
MipsOptionRecord.h
MipsOs16.cpp
MipsPfmCounters.td
MipsPreLegalizerCombiner.cpp [Alignment][NFC] MachineMemOperand::getAlign/getBaseAlign 2020-03-27 15:49:13 +00:00
MipsRegisterBankInfo.cpp GlobalISel: Do not set observer of MachineIRBuilder in LegalizerHelper 2021-01-13 10:44:31 -05:00
MipsRegisterBankInfo.h [llvm] Remove redundant string initialization (NFC) 2021-01-12 21:43:46 -08:00
MipsRegisterBanks.td
MipsRegisterInfo.cpp [Alignment][NFC] Add DebugStr and operator* 2020-04-06 12:09:45 +00:00
MipsRegisterInfo.h [TargetRegisterInfo] Default trackLivenessAfterRegAlloc() to true 2020-01-19 14:20:37 -08:00
MipsRegisterInfo.td [TableGen] Drop deprecated leading # operation (NOP) and replace ## with # 2020-04-25 16:26:45 -07:00
MipsSEFrameLowering.cpp [SVE] Return StackOffset for TargetFrameLowering::getFrameIndexReference. 2020-11-05 11:02:18 +00:00
MipsSEFrameLowering.h [SVE] Return StackOffset for TargetFrameLowering::getFrameIndexReference. 2020-11-05 11:02:18 +00:00
MipsSEISelDAGToDAG.cpp Mips: Don't store MachineFunction in MipsFunctionInfo 2020-06-30 16:08:51 -04:00
MipsSEISelDAGToDAG.h
MipsSEISelLowering.cpp [SelectionDAG] Use Align/MaybeAlign in calls to getLoad/getStore/getExtLoad/getTruncStore. 2020-09-14 13:54:50 -07:00
MipsSEISelLowering.h
MipsSEInstrInfo.cpp [Mips] Make MipsBranchExpansion aware of BBIT family of branch 2020-03-31 09:20:51 +02:00
MipsSEInstrInfo.h [Mips] Make MipsBranchExpansion aware of BBIT family of branch 2020-03-31 09:20:51 +02:00
MipsSERegisterInfo.cpp
MipsSERegisterInfo.h [Mips] Remove unused forward declarations. NFC. 2020-04-23 15:02:18 +01:00
MipsSchedule.td [mips] Implement add.ps, mul.ps and sub.ps 2020-10-30 10:59:15 +03:00
MipsScheduleGeneric.td [mips] Implement add.ps, mul.ps and sub.ps 2020-10-30 10:59:15 +03:00
MipsScheduleP5600.td [mips] Implement add.ps, mul.ps and sub.ps 2020-10-30 10:59:15 +03:00
MipsSubtarget.cpp [X86][MC][Target] Initial backend support a tune CPU to support -mtune 2020-08-14 15:31:50 -07:00
MipsSubtarget.h [X86][MC][Target] Initial backend support a tune CPU to support -mtune 2020-08-14 15:31:50 -07:00
MipsTargetMachine.cpp [GlobalISel] Enable usage of BranchProbabilityInfo in IRTranslator. 2020-09-09 14:31:12 -07:00
MipsTargetMachine.h Support addrspacecast initializers with isNoopAddrSpaceCast 2020-07-31 10:42:43 -04:00
MipsTargetObjectFile.cpp [Target] Use Align in TargetLoweringObjectFile::getSectionForConstant. 2020-05-21 15:23:29 -07:00
MipsTargetObjectFile.h [Target] Use Align in TargetLoweringObjectFile::getSectionForConstant. 2020-05-21 15:23:29 -07:00
MipsTargetStreamer.h MipsTargetStreamer.h - remove unnecessary MipsABIFlagsSection forward declaration. NFC. 2020-04-24 16:21:37 +01:00
Relocation.txt