[PATCH] D14603: [X86ISelLowering] Add additional support for multiplication-to-shift conversion.
Chen Li via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 30 21:08:34 PST 2015
chenli added inline comments.
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:24313
@@ +24312,3 @@
+
+ else if (isPowerOf2_64(MulAmt + 1))
+ // (mul x, 2^N - 1) => (sub (shl x, N), x)
----------------
RKSimon wrote:
> There doesn't appear to be anything to prevent overflow here - e.g. for a 32-bit multiply by 0xFFFFFFFF. Do we need an initial patch that replaces the uint64_t MulAmt with APInt MulAmt?
I think you are correct. I can create a separate patch to replace uint64_t with APInt in this function.
http://reviews.llvm.org/D14603
More information about the llvm-commits
mailing list