[llvm] [Xtensa] Implement lowering Mul/Div/Shift operations. (PR #99981)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 05:27:35 PDT 2024
================
@@ -662,15 +690,33 @@ SDValue XtensaTargetLowering::getAddrPCRel(SDValue Op,
return DAG.getNode(XtensaISD::PCREL_WRAPPER, DL, Ty, Op);
}
-SDValue XtensaTargetLowering::LowerConstantPool(ConstantPoolSDNode *CP,
+SDValue XtensaTargetLowering::LowerConstantPool(SDValue Op,
SelectionDAG &DAG) const {
- EVT PtrVT = getPointerTy(DAG.getDataLayout());
+ EVT PtrVT = Op.getValueType();
+ ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
+ auto C = const_cast<Constant*>(CP->getConstVal());
+ auto T = CP->getType();
SDValue Result;
- if (!CP->isMachineConstantPoolEntry()) {
- Result = DAG.getTargetConstantPool(CP->getConstVal(), PtrVT, CP->getAlign(),
- CP->getOffset());
+
+ // Do not use constant pool for aggregate or vector constant types,
+ // in such cases create global variable, for example to store tabel
+ // when we lower CTTZ operation.
+ if (T->isAggregateType()) {
+ MachineFunction &MF = DAG.getMachineFunction();
+ auto AFI = MF.getInfo<XtensaFunctionInfo>();
+ auto M = const_cast<Module *>(MF.getFunction().getParent());
+ auto GV = new GlobalVariable(
----------------
arsenm wrote:
Yes
https://github.com/llvm/llvm-project/pull/99981
More information about the llvm-commits
mailing list