mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 03:23:01 +02:00
1b9512e762
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 llvm-svn: 317674
54 lines
1.8 KiB
TableGen
54 lines
1.8 KiB
TableGen
//===-- RISCV.td - Describe the RISCV Target Machine -------*- tablegen -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
include "llvm/Target/Target.td"
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// RISC-V subtarget features and instruction predicates.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def Feature64Bit : SubtargetFeature<"64bit", "HasRV64", "true",
|
|
"Implements RV64">;
|
|
|
|
def RV64 : HwMode<"+64bit">;
|
|
def RV32 : HwMode<"-64bit">;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Registers, calling conventions, instruction descriptions.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
include "RISCVRegisterInfo.td"
|
|
include "RISCVCallingConv.td"
|
|
include "RISCVInstrInfo.td"
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// RISC-V processors supported.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def : ProcessorModel<"generic-rv32", NoSchedModel, []>;
|
|
|
|
def : ProcessorModel<"generic-rv64", NoSchedModel, [Feature64Bit]>;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Define the RISC-V target.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def RISCVInstrInfo : InstrInfo {
|
|
let guessInstructionProperties = 0;
|
|
}
|
|
|
|
def RISCVAsmParser : AsmParser {
|
|
let ShouldEmitMatchRegisterAltName = 1;
|
|
}
|
|
|
|
def RISCV : Target {
|
|
let InstructionSet = RISCVInstrInfo;
|
|
let AssemblyParsers = [RISCVAsmParser];
|
|
}
|