diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-01-28 22:58:25 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-01-28 22:58:25 +0000 |
| commit | bc7497d5f5f59bad79afc6bd06a1b8bb387103ec (patch) | |
| tree | 43c2afc5ea77f850b9c2403f7821a87c7f17f8f5 /llvm/lib/CodeGen | |
| parent | bf8c1ad31374a2e4c05cab178f3c6c5c134d9910 (diff) | |
| download | bcm5719-llvm-bc7497d5f5f59bad79afc6bd06a1b8bb387103ec.tar.gz bcm5719-llvm-bc7497d5f5f59bad79afc6bd06a1b8bb387103ec.zip | |
Alpha doesn't have a native f32 extload instruction.
llvm-svn: 19880
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index e435bd609de..56ed08e680f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -256,7 +256,11 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { bool isDouble = VT == MVT::f64; ConstantFP *LLVMC = ConstantFP::get(isDouble ? Type::DoubleTy : Type::FloatTy, CFP->getValue()); - if (isDouble && CFP->isExactlyValue((float)CFP->getValue())) { + if (isDouble && CFP->isExactlyValue((float)CFP->getValue()) && + // Only do this if the target has a native EXTLOAD instruction from + // f32. + TLI.getOperationAction(ISD::EXTLOAD, + MVT::f32) == TargetLowering::Legal) { LLVMC = cast<ConstantFP>(ConstantExpr::getCast(LLVMC, Type::FloatTy)); VT = MVT::f32; Extend = true; |

