[LLVMdev] support for division by constant in APInt
jay.foad at gmail.com
Thu Apr 23 06:26:28 PDT 2009
In lib/CodeGen/SelectionDAG/TargetLowering.cpp there are some
functions magic() and magicu() that support optimising division by a
constant. I'd like to use these functions in an LLVM FunctionPass that
I'm working on. The attached patch moves these functions out of
TargetLowering.cpp and into the APInt class, so that I can reuse them
in my pass. What do you think?
It looks to me like these functions were copied straight out of
"Hacker's Delight", Henry S. Warren, Jr., so I added a comment
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9620 bytes
Desc: not available
More information about the llvm-dev