[all-commits] [llvm/llvm-project] 75d33a: [InstCombine] FoldShiftByConstant - consistently u...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Oct 6 06:49:43 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 75d33a3a97c6f6e65ef5139a4a12508716842601
      https://github.com/llvm/llvm-project/commit/75d33a3a97c6f6e65ef5139a4a12508716842601
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp

  Log Message:
  -----------
  [InstCombine] FoldShiftByConstant - consistently use ConstantExpr in logicalshift(trunc(shift(x,c1)),c2) fold. NFCI.

This still only gets used for scalar types but now always uses ConstantExpr in preparation for vector support - it was using APInt methods in some places.


  Commit: 17b9a91ec274a527e734321701d2791368f146c9
      https://github.com/llvm/llvm-project/commit/17b9a91ec274a527e734321701d2791368f146c9
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

  Log Message:
  -----------
  [InstCombine] canRewriteGEPAsOffset - don't dereference a dyn_cast<>. NFCI.

We know V is a IntToPtrInst or PtrToIntInst type so we know its a CastInst - so use cast<> directly.

Prevents clang static analyzer warning that we could deference a null pointer.


Compare: https://github.com/llvm/llvm-project/compare/8a3cbb1535a9...17b9a91ec274


More information about the All-commits mailing list