Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.698 -> 1.699 --- Log message: For PR1280: http://llvm.org/PR1280 : When converting an add/xor/and triplet into a trunc/sext, only do so if the intermediate integer type is a bitwidth that the targets can handle. --- Diffs of the changes: (+13 -3) InstructionCombining.cpp | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.698 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.699 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.698 Tue Mar 27 11:44:48 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Mar 27 20:36:16 2007 @@ -1940,11 +1940,21 @@ CFF80Val = APIntOps::ashr(CFF80Val, Size); } while (Size >= 1); - if (Size) { - const Type *MiddleType = IntegerType::get(Size); + // FIXME: This shouldn't be necessary. When the backends can handle types + // with funny bit widths then this whole cascade of if statements should + // be removed. It is just here to get the size of the "middle" type back + // up to something that the back ends can handle. + const Type *MiddleType = 0; + switch (Size) { + default: break; + case 32: MiddleType = Type::Int32Ty; break; + case 16: MiddleType = Type::Int16Ty; break; + case 8: MiddleType = Type::Int8Ty; break; + } + if (MiddleType) { Instruction *NewTrunc = new TruncInst(XorLHS, MiddleType, "sext"); InsertNewInstBefore(NewTrunc, I); - return new SExtInst(NewTrunc, I.getType()); + return new SExtInst(NewTrunc, I.getType(), I.getName()); } } } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits