llvm.org GIT mirror llvm / 4d211ca
[NFCI] Ensure TargetOpcode::* are compatible with guessInstructionProperties=0 rL162640 introduced CodeGenTarget::guessInstructionProperties. If a target sets guessInstructionProperties=0 in its FooInstrInfo, tablegen will error if it has to guess properties from patterns. Unfortunately, guessInstructionProperties=0 can't be used with current upstream LLVM as instructions in the TargetOpcode namespace are always included and sometimes have inferred properties for mayLoad, mayStore, and hasSideEffects. This patch provides the simplest possible fix to this problem, setting default values for these fields in the TargetOpcode scope. There is no intended functional change, as the explicitly set properties should match what was previously inferred. A number of the instructions had hasSideEffects=1 inferred unintentionally. This patch makes it explicit, while future patches (such as D37097) correct the property. Differential Revision: https://reviews.llvm.org/D37065 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317674 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Bradbury 2 years ago
2 changed file(s) with 15 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
883883 // Standard Pseudo Instructions.
884884 // This list must match TargetOpcodes.h and CodeGenTarget.cpp.
885885 // Only these instructions are allowed in the TargetOpcode namespace.
886 let isCodeGenOnly = 1, isPseudo = 1, hasNoSchedulingInfo = 1,
887 Namespace = "TargetOpcode" in {
886 // Ensure mayLoad and mayStore have a default value, so as not to break
887 // targets that set guessInstructionProperties=0. Any local definition of
888 // mayLoad/mayStore takes precedence over these default values.
889 let mayLoad = 0, mayStore = 0, isCodeGenOnly = 1, isPseudo = 1,
890 hasNoSchedulingInfo = 1, Namespace = "TargetOpcode" in {
888891 def PHI : Instruction {
889892 let OutOperandList = (outs unknown:$dst);
890893 let InOperandList = (ins variable_ops);
891894 let AsmString = "PHINODE";
895 let hasSideEffects = 1;
892896 }
893897 def INLINEASM : Instruction {
894898 let OutOperandList = (outs);
901905 let InOperandList = (ins i32imm:$id);
902906 let AsmString = "";
903907 let hasCtrlDep = 1;
908 let hasSideEffects = 1;
904909 let isNotDuplicable = 0;
905910 }
906911 def EH_LABEL : Instruction {
908913 let InOperandList = (ins i32imm:$id);
909914 let AsmString = "";
910915 let hasCtrlDep = 1;
916 let hasSideEffects = 1;
911917 let isNotDuplicable = 1;
912918 }
913919 def GC_LABEL : Instruction {
915921 let InOperandList = (ins i32imm:$id);
916922 let AsmString = "";
917923 let hasCtrlDep = 1;
924 let hasSideEffects = 1;
918925 let isNotDuplicable = 1;
919926 }
920927 def ANNOTATION_LABEL : Instruction {
922929 let InOperandList = (ins i32imm:$id);
923930 let AsmString = "";
924931 let hasCtrlDep = 1;
932 let hasSideEffects = 1;
925933 let isNotDuplicable = 1;
926934 }
927935 def KILL : Instruction {
989997 let OutOperandList = (outs);
990998 let InOperandList = (ins variable_ops);
991999 let AsmString = "BUNDLE";
1000 let hasSideEffects = 1;
9921001 }
9931002 def LIFETIME_START : Instruction {
9941003 let OutOperandList = (outs);
10051014 def STACKMAP : Instruction {
10061015 let OutOperandList = (outs);
10071016 let InOperandList = (ins i64imm:$id, i32imm:$nbytes, variable_ops);
1017 let hasSideEffects = 1;
10081018 let isCall = 1;
10091019 let mayLoad = 1;
10101020 let usesCustomInserter = 1;
10131023 let OutOperandList = (outs unknown:$dst);
10141024 let InOperandList = (ins i64imm:$id, i32imm:$nbytes, unknown:$callee,
10151025 i32imm:$nargs, i32imm:$cc, variable_ops);
1026 let hasSideEffects = 1;
10161027 let isCall = 1;
10171028 let mayLoad = 1;
10181029 let usesCustomInserter = 1;
10471058 let OutOperandList = (outs unknown:$dst);
10481059 let InOperandList = (ins variable_ops);
10491060 let usesCustomInserter = 1;
1061 let hasSideEffects = 1;
10501062 let mayLoad = 1;
10511063 let mayStore = 1;
10521064 let isTerminator = 1;
3939 //===----------------------------------------------------------------------===//
4040
4141 def RISCVInstrInfo : InstrInfo {
42 // TODO: disable guessInstructionProperties when
43 // https://reviews.llvm.org/D37065 lands.
44 let guessInstructionProperties = 1;
42 let guessInstructionProperties = 0;
4543 }
4644
4745 def RISCVAsmParser : AsmParser {