Bypass Slow Divides
authorPreston Gurd <preston.gurd@intel.com>
Mon, 4 Mar 2013 18:13:57 +0000 (18:13 +0000)
committerPreston Gurd <preston.gurd@intel.com>
Mon, 4 Mar 2013 18:13:57 +0000 (18:13 +0000)
commit9a2cfffdb6340c54ff553c1b81364d0f17fa8f45
tree999ad911d34f3f83d1140500e731228c5f07df84
parentff4faabd2d98776372f45f7592482c9239cc40f2
Bypass Slow Divides

* Only apply divide bypass optimization when not optimizing for size.
* Fixed bug caused by constant for 0 value of type Int32,
  used dividend type to generate the constant instead.
* For atom x86-64 apply the divide bypass to use 16-bit divides instead of
  64-bit divides when operand values are small enough.
* Added lit tests for 64-bit divide bypass.

Patch by Tyler Nowicki!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176442 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Transforms/Scalar/CodeGenPrepare.cpp
lib/Transforms/Utils/BypassSlowDivision.cpp
test/CodeGen/X86/atom-bypass-slow-division-64.ll [new file with mode: 0644]
test/CodeGen/X86/atom-bypass-slow-division.ll