[llvm-commits] [llvm] r47277 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/mul-remat.ll

Chris Lattner clattner at apple.com
Mon Feb 18 10:31:58 PST 2008


On Feb 18, 2008, at 9:55 AM, Dan Gohman wrote:
> Don't mark scalar integer multiplication as Expand on x86, since x86
> has plain one-result scalar integer multiplication instructions.
> This avoids expanding such instructions into MUL_LOHI sequences that
> must be special-cased at isel time, and avoids the problem with that
> code that provented memory operands from being folded.
>
> This fixes PR1874, addressesing the most common case. The uncommon
> cases of optimizing multiply-high operations will require work
> in DAGCombiner.

Very nice!

> +  // 8, 16, and 32-bit plain multiply are legal. And 64-bit multiply
> +  // is also legal on x86-64.
> +  if (!Subtarget->is64Bit())
> +    setOperationAction(ISD::MUL           , MVT::i64   , Expand);

Are you sure you need this?  if !is64Bit(), i64 won't be legal, so the  
multiply will be expanded unconditionally.

-Chris



More information about the llvm-commits mailing list