[PATCH] D36679: [InstCombine] Added support for: trunc(ashr(mul(sext(...), sext(...))) -> ashr(mul(...))

Amjad Aboud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 00:50:58 PDT 2017


aaboud marked an inline comment as done.
aaboud added a comment.

In https://reviews.llvm.org/D36679#842794, @spatel wrote:

> Can we have the ashr fix as a separate patch before the mul patch? If yes, make tests for just that diff and split this up?


I uploaded a separate patch that handles ashr including vector type handling (https://reviews.llvm.org/D36784).



================
Comment at: lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:468
     if (match(I->getOperand(1), m_APInt(SA))) {
-      uint64_t ShiftAmt = SA->getLimitedValue(BitWidth-1);
+      uint32_t ShiftAmt = SA->getLimitedValue(BitWidth-1);
 
----------------
spatel wrote:
> Why change this in this patch? Seem like that might be better as just 'unsigned', but either way, I think it's an independent diff.
I change it to uint32_t to be consistent with line 507 (the case for AShr).
Sure, we can commit this separately.
Do we need a review for this?
Do you want to take care of it? or I should just commit it now?


https://reviews.llvm.org/D36679





More information about the llvm-commits mailing list