[llvm-commits] [llvm] r90108 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h lib/CodeGen/SelectionDAG/LegalizeTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/X86/X86ISelLowering.cpp

Mon Ping Wang wangmp at apple.com
Mon Nov 30 13:26:07 PST 2009


Hi Duncan,

The solution for divide by unrolling is X86 specific.  Widening the divisor by 1 would always safe but could lead to an extra scalar divide being generated for this case.

  -- Mon Ping


On Nov 30, 2009, at 1:07 PM, Duncan Sands wrote:

> Hi Mon Ping,
> 
>> If the machine supported a vector divide, it would be more efficient to copy thlast value to the 4th element and then do the divide.  For X86, there is no vector divide so it seems cleaner to me to do it this way.
> 
> is this problem really x86 specific?
> 
> Ciao,
> 
> Duncan.


On Nov 30, 2009, at 4:28 AM, Duncan Sands wrote:

> Hi,
> 
>> +; Verify when widening a divide/remainder operation, we only generate a
>> +; divide/rem per element since divide/remainder can trap.
> 
> you could also ensure that the widened divisor always has 1 in the extra
> elements.  This is analogous to integer promotion where the extra bits are
> "undef" in general, but need to be constrained to certain values (usually
> zero or one) in some cases.
> 
> Ciao,
> 
> Duncan.





More information about the llvm-commits mailing list