[llvm] Nvptx port LowerBITCAST to SelectionDAG (PR #120903)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 24 10:41:04 PST 2025
================
@@ -910,6 +911,83 @@ SDValue DAGTypeLegalizer::CreateStackStoreLoad(SDValue Op,
return DAG.getLoad(DestVT, dl, Store, StackPtr, MachinePointerInfo(), Align);
}
+SDValue DAGTypeLegalizer::LowerBitcastInRegister(SDNode *N) const {
+ // Lower a bitcast into in-register shift operations
+ assert(N->getOpcode() == ISD::BITCAST && "Unexpected opcode!");
+
+ EVT FromVT = N->getOperand(0)->getValueType(0);
+ EVT ToVT = N->getValueType(0);
+
+ SDLoc DL(N);
+
+ bool IsBigEndian = DAG.getDataLayout().isBigEndian();
+
+ if (FromVT.isVector() && ToVT.isScalarInteger()) {
+
----------------
RKSimon wrote:
A quick test suggests it needs some extra legality checks to prevent infinite loops
https://github.com/llvm/llvm-project/pull/120903
More information about the llvm-commits
mailing list