Skip to content

Commit e5661fe

Browse files
committed
pull out fadd pattern
1 parent ebbd8d5 commit e5661fe

File tree

4 files changed

+320
-3
lines changed

4 files changed

+320
-3
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3346,6 +3346,11 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
33463346
// update the chain results when the pattern is complete.
33473347
SmallVector<SDNode*, 3> ChainNodesMatched;
33483348

3349+
if (N->getOpcode() == ISD::FADD) {
3350+
llvm::dbgs() << "N->dump()\n";
3351+
N->dump();
3352+
}
3353+
33493354
LLVM_DEBUG(dbgs() << "ISEL: Starting pattern match\n");
33503355

33513356
// Determine where to start the interpreter. Normally we start at opcode #0,
@@ -3358,8 +3363,10 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
33583363
// Already computed the OpcodeOffset table, just index into it.
33593364
if (N.getOpcode() < OpcodeOffset.size())
33603365
MatcherIndex = OpcodeOffset[N.getOpcode()];
3366+
if (N->getOpcode() == ISD::FADD) {
3367+
MatcherIndex = 0;
3368+
}
33613369
LLVM_DEBUG(dbgs() << " Initial Opcode index to " << MatcherIndex << "\n");
3362-
33633370
} else if (MatcherTable[0] == OPC_SwitchOpcode) {
33643371
// Otherwise, the table isn't computed, but the state machine does start
33653372
// with an OPC_SwitchOpcode instruction. Populate the table now, since this
@@ -4266,6 +4273,10 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
42664273
if (!MatchedMemRefs.empty() && Res->memoperands_empty())
42674274
dbgs() << " Dropping mem operands\n";
42684275
dbgs() << " " << (IsMorphNodeTo ? "Morphed" : "Created") << " node: ";
4276+
if (Res->getMachineOpcode() == 9545) {
4277+
llvm::dbgs() << "morphed V_PK_ADD_F32\n";
4278+
}
4279+
42694280
Res->dump(CurDAG);
42704281
});
42714282

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,13 @@ void AMDGPUDAGToDAGISel::Select(SDNode *N) {
793793
}
794794
}
795795

796-
SelectCode(N);
796+
if (N->getOpcode() == ISD::FADD) {
797+
llvm::dbgs() << "N->dump()\n";
798+
N->dump();
799+
MySelectCode(N);
800+
} else {
801+
SelectCode(N);
802+
}
797803
}
798804

799805
bool AMDGPUDAGToDAGISel::isUniformBr(const SDNode *N) const {

0 commit comments

Comments
 (0)