llvm-project/llvm/utils/TableGen
Alex Richardson b84be9f2f1 Add all constant physical registers to callee preserved masks
This allows MachineCopyPropagation to eliminate copies of constant registers
such as zero registers. They were previously not being eliminated as the
check for MO.clobbersPhysReg(AvailSrc) would return true for constant
registers such as MIPS $zero.

To avoid having to manually add the zero registers to all CalleeSavedRegs
instantiations in tablegen, I instead added a new isConstant bit to the
Register and set this for MIPS, RISC-V, and AArch64 zero registers.
RegisterInfoEmitter.cpp looks at this flag and adds all constant registers
to the preserved register mask.

This may also benefit other passes but so far I have only seen differences
in MachineCopyPropagation. In the future it might make sense to generate
`isConstantPhysReg()` from this information.

Original source: 8588d8b814

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D131958
2022-09-21 12:50:12 +00:00
..
GlobalISel [GISel] TreeMatcher: always skip leaves if they don't care 2022-09-20 20:55:02 +00:00
AsmMatcherEmitter.cpp [llvm] Use llvm::find_if (NFC) 2022-08-28 10:41:48 -07:00
AsmWriterEmitter.cpp [llvm] Use std::size instead of llvm::array_lengthof 2022-09-08 09:01:53 -06:00
AsmWriterInst.cpp
AsmWriterInst.h
Attributes.cpp [llvm] Qualify auto in range-based for loops (NFC) 2022-09-03 11:17:49 -07:00
CMakeLists.txt [cmake] Fix tablegen exports 2022-08-16 14:17:23 +02:00
CTagsEmitter.cpp
CallingConvEmitter.cpp
CodeEmitterGen.cpp [TableGen] Optimize APInt |= with setBit. NFC 2022-09-18 23:25:58 -07:00
CodeGenDAGPatterns.cpp
CodeGenDAGPatterns.h Revert "Use std::is_same_v instead of std::is_same (NFC)" 2022-08-20 23:00:39 -07:00
CodeGenHwModes.cpp
CodeGenHwModes.h
CodeGenInstruction.cpp [AMDGPU][GISel] Enable Selection of ADD3 for G_PTR_ADD 2022-08-24 14:44:19 +00:00
CodeGenInstruction.h [AMDGPU][GISel] Enable Selection of ADD3 for G_PTR_ADD 2022-08-24 14:44:19 +00:00
CodeGenIntrinsics.h [Intrinsics] Add initial support for NonNull attribute 2022-08-16 21:28:23 +00:00
CodeGenMapTable.cpp
CodeGenRegisters.cpp RegAllocGreedy: Avoid overflowing priority bitfields 2022-09-15 10:38:40 -04:00
CodeGenRegisters.h RegAllocGreedy: Avoid overflowing priority bitfields 2022-09-15 10:38:40 -04:00
CodeGenSchedule.cpp [llvm-tblgen] CodeGenSchedModels::hasReadOfWrite gets wrong predication result 2022-09-19 14:22:43 +08:00
CodeGenSchedule.h
CodeGenTarget.cpp [ValueTypes] Define MVTs for v256i2/v128i4. 2022-09-13 09:02:23 -07:00
CodeGenTarget.h
CompressInstEmitter.cpp [RISCV][TableGen] Mark MachineInstr with FrameIndex as not compressible 2022-08-24 13:23:38 +08:00
DAGISelEmitter.cpp
DAGISelMatcher.cpp
DAGISelMatcher.h
DAGISelMatcherEmitter.cpp
DAGISelMatcherGen.cpp
DAGISelMatcherOpt.cpp
DFAEmitter.cpp [tblgen] Use std::variant to simplify code. NFCI. 2022-08-27 10:50:28 +02:00
DFAEmitter.h
DFAPacketizerEmitter.cpp
DXILEmitter.cpp Fix MSVC "not all control paths return a value" warning. NFC 2022-07-26 10:44:00 +01:00
DecoderEmitter.cpp [llvm] Fix comment typos (NFC) 2022-08-07 00:16:14 -07:00
DirectiveEmitter.cpp
DisassemblerEmitter.cpp
ExegesisEmitter.cpp
FastISelEmitter.cpp [FastISel] Propagate PCSections metadata to MachineInstr 2022-09-07 11:36:01 +02:00
GICombinerEmitter.cpp [GIsel] Add missing space between type and name in GICombinerHelperArg 2022-08-02 13:35:25 -04:00
GlobalISelEmitter.cpp [llvm] Qualify auto in range-based for loops (NFC) 2022-09-03 11:17:49 -07:00
InfoByHwMode.cpp
InfoByHwMode.h
InstrDocsEmitter.cpp
InstrInfoEmitter.cpp
IntrinsicEmitter.cpp [Intrinsics] Add initial support for NonNull attribute 2022-08-16 21:28:23 +00:00
OptEmitter.cpp
OptEmitter.h
OptParserEmitter.cpp
OptRSTEmitter.cpp
PredicateExpander.cpp
PredicateExpander.h
PseudoLoweringEmitter.cpp
RegisterBankEmitter.cpp
RegisterInfoEmitter.cpp Add all constant physical registers to callee preserved masks 2022-09-21 12:50:12 +00:00
SDNodeProperties.cpp
SDNodeProperties.h
SearchableTableEmitter.cpp [llvm] Qualify auto in range-based for loops (NFC) 2022-09-03 11:17:49 -07:00
SequenceToOffsetTable.h
SubtargetEmitter.cpp
SubtargetFeatureInfo.cpp
SubtargetFeatureInfo.h
TableGen.cpp
TableGenBackends.h
Types.cpp
Types.h
VarLenCodeEmitterGen.cpp
VarLenCodeEmitterGen.h
WebAssemblyDisassemblerEmitter.cpp
WebAssemblyDisassemblerEmitter.h
X86DisassemblerShared.h
X86DisassemblerTables.cpp [llvm] Remove includes of `llvm/Support/STLArrayExtras.h` 2022-09-09 17:44:00 -06:00
X86DisassemblerTables.h
X86EVEX2VEXTablesEmitter.cpp
X86FoldTablesEmitter.cpp
X86MnemonicTables.cpp
X86ModRMFilters.cpp
X86ModRMFilters.h
X86RecognizableInstr.cpp
X86RecognizableInstr.h
tdtags