Add support for select constant expressions to the CBE, fixing SIOD
llvm-svn: 12589
diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp
index 54b8bd3..807f8ab 100644
--- a/llvm/lib/Target/CBackend/Writer.cpp
+++ b/llvm/lib/Target/CBackend/Writer.cpp
@@ -388,6 +388,15 @@
gep_type_end(CPV));
Out << "))";
return;
+ case Instruction::Select:
+ Out << "(";
+ printConstant(CE->getOperand(0));
+ Out << "?";
+ printConstant(CE->getOperand(1));
+ Out << ":";
+ printConstant(CE->getOperand(2));
+ Out << ")";
+ return;
case Instruction::Add:
case Instruction::Sub:
case Instruction::Mul: