diff options
author | Scott Michel <scottm@aero.org> | 2007-08-08 23:23:31 +0000 |
---|---|---|
committer | Scott Michel <scottm@aero.org> | 2007-08-08 23:23:31 +0000 |
commit | 9d09c5ccdac32927c4b6f93ad8c9f4d71f61c17b (patch) | |
tree | 4e2665d4f159db16f659f148c5ddbcabb7bbee2b /llvm/lib | |
parent | cbe4f77c9e787c3d669e48005d03d6bf835dfa8e (diff) | |
download | bcm5719-llvm-9d09c5ccdac32927c4b6f93ad8c9f4d71f61c17b.tar.gz bcm5719-llvm-9d09c5ccdac32927c4b6f93ad8c9f4d71f61c17b.zip |
If a target really needs to custom lower constants, it should be allowed
to do so.
llvm-svn: 40955
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 274535633ce..5c8c9e3e33d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -965,13 +965,21 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { } break; - case ISD::Constant: + case ISD::Constant: { + ConstantSDNode *CN = cast<ConstantSDNode>(Node); + unsigned opAction = + TLI.getOperationAction(ISD::Constant, CN->getValueType(0)); + // We know we don't need to expand constants here, constants only have one // value and we check that it is fine above. - // FIXME: Maybe we should handle things like targets that don't support full - // 32-bit immediates? + if (opAction == TargetLowering::Custom) { + Tmp1 = TLI.LowerOperation(Result, DAG); + if (Tmp1.Val) + Result = Tmp1; + } break; + } case ISD::ConstantFP: { // Spill FP immediates to the constant pool if the target cannot directly // codegen them. Targets often have some immediate values that can be |