From 5b348718df4062efccf1559928c51df9ecce946e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 21 Apr 2003 21:33:44 +0000 Subject: [PATCH] Add support for a simple constantexpr: cast of one ptr type to another llvm-svn: 5829 --- llvm/lib/Target/X86/InstSelectSimple.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/lib/Target/X86/InstSelectSimple.cpp b/llvm/lib/Target/X86/InstSelectSimple.cpp index 91d3013ecd0f..6adccb15e8a9 100644 --- a/llvm/lib/Target/X86/InstSelectSimple.cpp +++ b/llvm/lib/Target/X86/InstSelectSimple.cpp @@ -307,6 +307,11 @@ void ISel::copyConstantToRegister(MachineBasicBlock *MBB, emitGEPOperation(MBB, IP, CE->getOperand(0), CE->op_begin()+1, CE->op_end(), R); return; + } else if (CE->getOpcode() == Instruction::Cast && + isa(CE->getType()) && + isa(CE->getOperand(0)->getType())) { + copyConstantToRegister(MBB, IP, cast(CE->getOperand(0)), R); + return; } std::cerr << "Offending expr: " << C << "\n";