[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri May 5 14:34:48 PDT 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
DAGCombiner.cpp updated: 1.156 -> 1.157
---
Log message:
Fold (fpext (load x)) -> (extload x)
---
Diffs of the changes: (+14 -0)
DAGCombiner.cpp | 14 ++++++++++++++
1 files changed, 14 insertions(+)
Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.156 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.157
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.156 Fri May 5 01:32:04 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri May 5 16:34:35 2006
@@ -2413,6 +2413,20 @@
// fold (fp_extend c1fp) -> c1fp
if (N0CFP)
return DAG.getNode(ISD::FP_EXTEND, VT, N0);
+
+ // fold (fpext (load x)) -> (fpext (fpround (extload x)))
+ if (N0.getOpcode() == ISD::LOAD && N0.hasOneUse() &&
+ (!AfterLegalize||TLI.isOperationLegal(ISD::EXTLOAD, N0.getValueType()))) {
+ SDOperand ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, N0.getOperand(0),
+ N0.getOperand(1), N0.getOperand(2),
+ N0.getValueType());
+ CombineTo(N, ExtLoad);
+ CombineTo(N0.Val, DAG.getNode(ISD::FP_ROUND, N0.getValueType(), ExtLoad),
+ ExtLoad.getValue(1));
+ return SDOperand(N, 0); // Return N so it doesn't get rechecked!
+ }
+
+
return SDOperand();
}
More information about the llvm-commits
mailing list