mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Re-instate the EVT parameter to getScalarShiftAmountTy() for OOT user
A documentation for this function would be nice by the way. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241807
This commit is contained in:
parent
b5caea461d
commit
d5d8989892
@ -170,7 +170,10 @@ public:
|
||||
MVT getPointerTy(const DataLayout &DL, uint32_t AS = 0) const {
|
||||
return MVT::getIntegerVT(DL.getPointerSizeInBits(AS));
|
||||
}
|
||||
virtual MVT getScalarShiftAmountTy(const DataLayout &) const;
|
||||
|
||||
/// EVT is not used in-tree, but is used by out-of-tree target.
|
||||
/// A documentation for this function would be nice...
|
||||
virtual MVT getScalarShiftAmountTy(const DataLayout &, EVT) const;
|
||||
|
||||
EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL) const;
|
||||
|
||||
|
@ -444,7 +444,8 @@ namespace {
|
||||
if (LHSTy.isVector())
|
||||
return LHSTy;
|
||||
auto &DL = DAG.getDataLayout();
|
||||
return LegalTypes ? TLI.getScalarShiftAmountTy(DL) : TLI.getPointerTy(DL);
|
||||
return LegalTypes ? TLI.getScalarShiftAmountTy(DL, LHSTy)
|
||||
: TLI.getPointerTy(DL);
|
||||
}
|
||||
|
||||
/// This method returns true if we are running before type legalization or
|
||||
|
@ -878,7 +878,8 @@ void TargetLoweringBase::initActions() {
|
||||
setOperationAction(ISD::DEBUGTRAP, MVT::Other, Expand);
|
||||
}
|
||||
|
||||
MVT TargetLoweringBase::getScalarShiftAmountTy(const DataLayout &DL) const {
|
||||
MVT TargetLoweringBase::getScalarShiftAmountTy(const DataLayout &DL,
|
||||
EVT) const {
|
||||
return MVT::getIntegerVT(8 * DL.getPointerSize(0));
|
||||
}
|
||||
|
||||
@ -887,7 +888,7 @@ EVT TargetLoweringBase::getShiftAmountTy(EVT LHSTy,
|
||||
assert(LHSTy.isInteger() && "Shift amount is not an integer type!");
|
||||
if (LHSTy.isVector())
|
||||
return LHSTy;
|
||||
return getScalarShiftAmountTy(DL);
|
||||
return getScalarShiftAmountTy(DL, LHSTy);
|
||||
}
|
||||
|
||||
/// canOpTrap - Returns true if the operation can trap for the value type.
|
||||
|
@ -775,7 +775,8 @@ void AArch64TargetLowering::computeKnownBitsForTargetNode(
|
||||
}
|
||||
}
|
||||
|
||||
MVT AArch64TargetLowering::getScalarShiftAmountTy(const DataLayout &DL) const {
|
||||
MVT AArch64TargetLowering::getScalarShiftAmountTy(const DataLayout &DL,
|
||||
EVT) const {
|
||||
return MVT::i64;
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ public:
|
||||
APInt &KnownOne, const SelectionDAG &DAG,
|
||||
unsigned Depth = 0) const override;
|
||||
|
||||
MVT getScalarShiftAmountTy(const DataLayout &DL) const override;
|
||||
MVT getScalarShiftAmountTy(const DataLayout &DL, EVT) const override;
|
||||
|
||||
/// allowsMisalignedMemoryAccesses - Returns true if the target allows
|
||||
/// unaligned memory accesses of the specified type.
|
||||
|
@ -704,7 +704,7 @@ EVT SITargetLowering::getSetCCResultType(const DataLayout &DL, LLVMContext &Ctx,
|
||||
return EVT::getVectorVT(Ctx, MVT::i1, VT.getVectorNumElements());
|
||||
}
|
||||
|
||||
MVT SITargetLowering::getScalarShiftAmountTy(const DataLayout &) const {
|
||||
MVT SITargetLowering::getScalarShiftAmountTy(const DataLayout &, EVT) const {
|
||||
return MVT::i32;
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ public:
|
||||
bool enableAggressiveFMAFusion(EVT VT) const override;
|
||||
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context,
|
||||
EVT VT) const override;
|
||||
MVT getScalarShiftAmountTy(const DataLayout &) const override;
|
||||
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override;
|
||||
bool isFMAFasterThanFMulAndFAdd(EVT VT) const override;
|
||||
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
|
||||
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
|
||||
|
@ -72,7 +72,7 @@ namespace llvm {
|
||||
explicit MSP430TargetLowering(const TargetMachine &TM,
|
||||
const MSP430Subtarget &STI);
|
||||
|
||||
MVT getScalarShiftAmountTy(const DataLayout &) const override {
|
||||
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
|
||||
return MVT::i8;
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ namespace llvm {
|
||||
FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
|
||||
const TargetLibraryInfo *libInfo) const override;
|
||||
|
||||
MVT getScalarShiftAmountTy(const DataLayout &) const override {
|
||||
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
|
||||
return MVT::i32;
|
||||
}
|
||||
|
||||
|
@ -839,7 +839,8 @@ static SDValue performMULCombine(SDNode *N, SelectionDAG &DAG,
|
||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N->getOperand(1)))
|
||||
if (!VT.isVector())
|
||||
return genConstMult(N->getOperand(0), C->getZExtValue(), SDLoc(N), VT,
|
||||
TL->getScalarShiftAmountTy(DAG.getDataLayout()), DAG);
|
||||
TL->getScalarShiftAmountTy(DAG.getDataLayout(), VT),
|
||||
DAG);
|
||||
|
||||
return SDValue(N, 0);
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ public:
|
||||
const NVPTXTargetMachine *nvTM;
|
||||
|
||||
// PTX always uses 32-bit shift amounts
|
||||
MVT getScalarShiftAmountTy(const DataLayout &) const override {
|
||||
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
|
||||
return MVT::i32;
|
||||
}
|
||||
|
||||
|
@ -423,7 +423,7 @@ namespace llvm {
|
||||
/// DAG node.
|
||||
const char *getTargetNodeName(unsigned Opcode) const override;
|
||||
|
||||
MVT getScalarShiftAmountTy(const DataLayout &) const override {
|
||||
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
|
||||
return MVT::i32;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ namespace llvm {
|
||||
StringRef Constraint, MVT VT) const override;
|
||||
|
||||
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
|
||||
MVT getScalarShiftAmountTy(const DataLayout &) const override {
|
||||
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
|
||||
return MVT::i32;
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ public:
|
||||
const SystemZSubtarget &STI);
|
||||
|
||||
// Override TargetLowering.
|
||||
MVT getScalarShiftAmountTy(const DataLayout &) const override {
|
||||
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
|
||||
return MVT::i32;
|
||||
}
|
||||
MVT getVectorIdxTy(const DataLayout &DL) const override {
|
||||
|
@ -4852,7 +4852,7 @@ static SDValue getVShift(bool isLeft, EVT VT, SDValue SrcOp,
|
||||
MVT ShVT = MVT::v2i64;
|
||||
unsigned Opc = isLeft ? X86ISD::VSHLDQ : X86ISD::VSRLDQ;
|
||||
SrcOp = DAG.getBitcast(ShVT, SrcOp);
|
||||
MVT ScalarShiftTy = TLI.getScalarShiftAmountTy(DAG.getDataLayout());
|
||||
MVT ScalarShiftTy = TLI.getScalarShiftAmountTy(DAG.getDataLayout(), VT);
|
||||
assert(NumBits % 8 == 0 && "Only support byte sized shifts");
|
||||
SDValue ShiftVal = DAG.getConstant(NumBits/8, dl, ScalarShiftTy);
|
||||
return DAG.getBitcast(VT, DAG.getNode(Opc, dl, ShVT, SrcOp, ShiftVal));
|
||||
@ -7409,7 +7409,7 @@ static SDValue lowerVectorShuffleAsElementInsertion(
|
||||
X86ISD::VSHLDQ, DL, MVT::v2i64, V2,
|
||||
DAG.getConstant(V2Index * EltVT.getSizeInBits() / 8, DL,
|
||||
DAG.getTargetLoweringInfo().getScalarShiftAmountTy(
|
||||
DAG.getDataLayout())));
|
||||
DAG.getDataLayout(), VT)));
|
||||
V2 = DAG.getBitcast(VT, V2);
|
||||
}
|
||||
}
|
||||
|
@ -598,7 +598,7 @@ namespace llvm {
|
||||
unsigned getJumpTableEncoding() const override;
|
||||
bool useSoftFloat() const override;
|
||||
|
||||
MVT getScalarShiftAmountTy(const DataLayout &) const override {
|
||||
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
|
||||
return MVT::i8;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ namespace llvm {
|
||||
|
||||
|
||||
unsigned getJumpTableEncoding() const override;
|
||||
MVT getScalarShiftAmountTy(const DataLayout &DL) const override {
|
||||
MVT getScalarShiftAmountTy(const DataLayout &DL, EVT) const override {
|
||||
return MVT::i32;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user