[PATCH] D63812: [InstCombine] Shift amount reassociation (PR42391)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 11:55:10 PDT 2019


nikic added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineShifts.cpp:30
+reassociateShiftAmtsOfTwoSameDirectionShifts(BinaryOperator *OuterShift,
+                                             const SimplifyQuery SQ) {
+  // Look for:  (x shiftopcode ShAmt0) shiftopcode ShAmt1
----------------
Should probably be `const SimplifyQuery &SQ`?


================
Comment at: lib/Transforms/InstCombine/InstCombineShifts.cpp:51
+  // All good, we can do this fold.
+  return BinaryOperator::Create(ShiftOpcode, X, NewShAmt);
+}
----------------
Would it be possible to preserve nowrap/exact flags that exist on both shifts?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63812/new/

https://reviews.llvm.org/D63812





More information about the llvm-commits mailing list