[PATCH] D36679: [InstCombine] Added support for: trunc(ashr(mul(sext(...), sext(...))) -> ashr(mul(...))
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 15 16:00:18 PDT 2017
spatel added a comment.
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?
================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:378
+ // similar to sign bit of the truncate type.
+ if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {
+ uint32_t OrigBitWidth = OrigTy->getScalarSizeInBits();
----------------
Over in D36763, we're going to (or maybe already have) made the other shift cases splat-vector-friendly. Can you do the same here and add a vector test?
================
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);
----------------
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.
https://reviews.llvm.org/D36679
More information about the llvm-commits
mailing list