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 | 99939d39c9555ebecbcd24c1b607eae52804ea37 (patch) | |
tree | 0fc8015e961030810f7747dd4fee157254dc577e | |
parent | e76ad6de40b5e4c0399257b0438914c8c85ceaa1 (diff) |
Alpha doesn't have a native f32 extload instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19880 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index e435bd609d..56ed08e680 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/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; |