llvm-project/llvm/utils/TableGen
Hans Wennborg 13bdae8541 Revert r372285 "GlobalISel: Don't materialize immarg arguments to intrinsics"
This broke the Chromium build, causing it to fail with e.g.

  fatal error: error in backend: Cannot select: t362: v4i32 = X86ISD::VSHLI t392, Constant:i8<15>

See llvm-commits thread of r372285 for details.

This also reverts r372286, r372287, r372288, r372289, r372290, r372291,
r372292, r372293, r372296, and r372297, which seemed to depend on the
main commit.

> Encode them directly as an imm argument to G_INTRINSIC*.
>
> Since now intrinsics can now define what parameters are required to be
> immediates, avoid using registers for them. Intrinsics could
> potentially want a constant that isn't a legal register type. Also,
> since G_CONSTANT is subject to CSE and legalization, transforms could
> potentially obscure the value (and create extra work for the
> selector). The register bank of a G_CONSTANT is also meaningful, so
> this could throw off future folding and legalization logic for AMDGPU.
>
> This will be much more convenient to work with than needing to call
> getConstantVRegVal and checking if it may have failed for every
> constant intrinsic parameter. AMDGPU has quite a lot of intrinsics wth
> immarg operands, many of which need inspection during lowering. Having
> to find the value in a register is going to add a lot of boilerplate
> and waste compile time.
>
> SelectionDAG has always provided TargetConstant for constants which
> should not be legalized or materialized in a register. The distinction
> between Constant and TargetConstant was somewhat fuzzy, and there was
> no automatic way to force usage of TargetConstant for certain
> intrinsic parameters. They were both ultimately ConstantSDNode, and it
> was inconsistently used. It was quite easy to mis-select an
> instruction requiring an immediate. For SelectionDAG, start emitting
> TargetConstant for these arguments, and using timm to match them.
>
> Most of the work here is to cleanup target handling of constants. Some
> targets process intrinsics through intermediate custom nodes, which
> need to preserve TargetConstant usage to match the intrinsic
> expectation. Pattern inputs now need to distinguish whether a constant
> is merely compatible with an operand or whether it is mandatory.
>
> The GlobalISelEmitter needs to treat timm as a special case of a leaf
> node, simlar to MachineBasicBlock operands. This should also enable
> handling of patterns for some G_* instructions with immediates, like
> G_FENCE or G_EXTRACT.
>
> This does include a workaround for a crash in GlobalISelEmitter when
> ARM tries to uses "imm" in an output with a "timm" pattern source.

llvm-svn: 372314
2019-09-19 12:33:07 +00:00
..
AsmMatcherEmitter.cpp [TableGen] Correct comments for end of namespace. NFC 2019-08-25 10:47:30 +00:00
AsmWriterEmitter.cpp [llvm-objdump] Implement -Mreg-names-raw/-std options. 2019-02-26 12:15:14 +00:00
AsmWriterInst.cpp [tablegen] Add locations to many PrintFatalError() calls 2019-02-12 17:36:57 +00:00
AsmWriterInst.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Attributes.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [MCSched] Bind PFM Counters to the CPUs instead of the SchedModel. 2018-10-25 07:44:01 +00:00
CTagsEmitter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CallingConvEmitter.cpp AArch64: support arm64_32, an ILP32 slice for watchOS. 2019-09-12 10:22:23 +00:00
CodeEmitterGen.cpp Fix compile-time regression caused by rL371928 2019-09-18 18:14:42 +00:00
CodeGenDAGPatterns.cpp [SVE][MVT] Fixed-length vector MVT ranges 2019-09-17 10:19:23 +00:00
CodeGenDAGPatterns.h TableGen: Add MinAlignment predicate 2019-07-31 00:14:43 +00:00
CodeGenHwModes.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeGenHwModes.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeGenInstruction.cpp Allow target to handle STRICT floating-point nodes 2019-06-05 22:33:10 +00:00
CodeGenInstruction.h Allow target to handle STRICT floating-point nodes 2019-06-05 22:33:10 +00:00
CodeGenIntrinsics.h Teach GlobalISelEmitter to treat used iPTRAny operands as pointer operands 2019-08-20 22:04:10 +00:00
CodeGenMapTable.cpp [TableGen] CodeGenMapTable - Don't dereference a dyn_cast result. NFCI. 2019-09-17 17:32:15 +00:00
CodeGenRegisters.cpp GlobalISel: Support physical register inputs in patterns 2019-09-06 20:32:37 +00:00
CodeGenRegisters.h GlobalISel: Support physical register inputs in patterns 2019-09-06 20:32:37 +00:00
CodeGenSchedule.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
CodeGenSchedule.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeGenTarget.cpp [ValueTypes] Add v16f16 and v32f16 to EVT::getEVTString and Tablegen's getEnumName 2019-08-30 17:34:29 +00:00
CodeGenTarget.h Recommit "[GlobalISel] Import patterns containing INSERT_SUBREG" 2019-08-27 17:47:06 +00:00
DAGISelEmitter.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
DAGISelMatcher.cpp [TableGen] Replace a dyn_cast with isa to avoid an unused variable warning introduced in r355785. NFC 2019-03-11 16:51:37 +00:00
DAGISelMatcher.h TableGen: Support physical register inputs > 255 2019-07-22 15:02:34 +00:00
DAGISelMatcherEmitter.cpp TableGen: Support physical register inputs > 255 2019-07-22 15:02:34 +00:00
DAGISelMatcherGen.cpp [TableGen] Correct comments for end of namespace. NFC 2019-08-25 10:47:30 +00:00
DAGISelMatcherOpt.cpp [SelectionDAG] Add a OPC_CheckChild2CondCode to SelectionDAGISel to remove a MoveChild and MoveParent pair. 2019-02-25 03:11:44 +00:00
DFAPacketizerEmitter.cpp [DFAPacketizer] Reapply: Track resources for packetized instructions 2019-09-09 13:17:55 +00:00
DisassemblerEmitter.cpp [TableGen] Correct comments for end of namespace. NFC 2019-08-25 10:47:30 +00:00
ExegesisEmitter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FastISelEmitter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FixedLenDecoderEmitter.cpp [TableGen] Correct comments for end of namespace. NFC 2019-08-25 10:47:30 +00:00
GlobalISelEmitter.cpp Revert r372285 "GlobalISel: Don't materialize immarg arguments to intrinsics" 2019-09-19 12:33:07 +00:00
InfoByHwMode.cpp Add support for pointer types in patterns 2019-02-20 19:43:47 +00:00
InfoByHwMode.h Add support for pointer types in patterns 2019-02-20 19:43:47 +00:00
InstrDocsEmitter.cpp [TableGen] Correct comments for end of namespace. NFC 2019-08-25 10:47:30 +00:00
InstrInfoEmitter.cpp [TableGen] Correct comments for end of namespace. NFC 2019-08-25 10:47:30 +00:00
IntrinsicEmitter.cpp [IntrinsicEmitter] Support scalable vectors in intrinsics 2019-08-27 12:57:09 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
OptParserEmitter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PredicateExpander.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PredicateExpander.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PseudoLoweringEmitter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RISCVCompressInstEmitter.cpp [RISCV] Replace map with set in getReqFeatures 2019-06-10 17:15:45 +00:00
RegisterBankEmitter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RegisterInfoEmitter.cpp Retire llvm::less/equal in favor of C++14 std::less<>/equal_to<>. 2019-08-22 17:31:59 +00:00
SDNodeProperties.cpp [tablegen] Add locations to many PrintFatalError() calls 2019-02-12 17:36:57 +00:00
SDNodeProperties.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SearchableTableEmitter.cpp Use a bit of relaxed constexpr to make FeatureBitset costant intializable 2019-08-24 15:02:44 +00:00
SequenceToOffsetTable.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SubtargetEmitter.cpp [TableGen] Correct comments for end of namespace. NFC 2019-08-25 10:47:30 +00:00
SubtargetFeatureInfo.cpp Use a bit of relaxed constexpr to make FeatureBitset costant intializable 2019-08-24 15:02:44 +00:00
SubtargetFeatureInfo.h Use bitset for assembler predicates 2019-03-11 17:04:35 +00:00
TableGen.cpp [tblgen] Add a timer covering the time spent reading the Instruction defs 2019-02-11 23:02:02 +00:00
TableGenBackends.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Types.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Types.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WebAssemblyDisassemblerEmitter.cpp [TableGen] Correct comments for end of namespace. NFC 2019-08-25 10:47:30 +00:00
WebAssemblyDisassemblerEmitter.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
X86DisassemblerShared.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
X86DisassemblerTables.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
X86DisassemblerTables.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
X86EVEX2VEXTablesEmitter.cpp [X86] Remove check on isAsmParserOnly from EVEX2VEX tablegenerator. NFCI 2019-04-09 07:40:19 +00:00
X86FoldTablesEmitter.cpp [X86] Make the X86FoldTablesEmitter functional again. Fix the spacing in the output to make it easier to diff. 2019-06-01 06:20:55 +00:00
X86ModRMFilters.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
X86ModRMFilters.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
X86RecognizableInstr.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
X86RecognizableInstr.h [X86] Split the VEX_WPrefix in X86Inst tablegen class into 3 separate fields with clear meanings. 2019-04-09 07:40:06 +00:00
tdtags Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00