[PATCH] D14603: [X86ISelLowering] Add additional support for multiplication-to-shift conversion.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 28 06:41:33 PST 2015
RKSimon 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)
----------------
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?
http://reviews.llvm.org/D14603
More information about the llvm-commits
mailing list