[all-commits] [llvm/llvm-project] 41c22a: [NFC][SCEV] Assert that we don't try to create SCE...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Mon Apr 19 08:39:37 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 41c22acc22a54ceb78dc863470b8819052d31d77
      https://github.com/llvm/llvm-project/commit/41c22acc22a54ceb78dc863470b8819052d31d77
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp

  Log Message:
  -----------
  [NFC][SCEV] Assert that we don't try to create SCEVPtrToIntExpr of a non-integral pointer

ptr<->int casts are only valid for integral pointes,
defensively assert that we don't try to break that here.


  Commit: 0ea5fdbdef97b7bdd41755241ea524622cc8932e
      https://github.com/llvm/llvm-project/commit/0ea5fdbdef97b7bdd41755241ea524622cc8932e
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll

  Log Message:
  -----------
  [NFC][SCEVExpander][LoopDistribute] Regenerate scev-inserted-runtime-check.ll check lines


  Commit: 016c5771b2cbf198b9bfe469634e5f301cc06083
      https://github.com/llvm/llvm-project/commit/016c5771b2cbf198b9bfe469634e5f301cc06083
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll

  Log Message:
  -----------
  [NFC][SCEVExpander][LoopDistribute] Add test for SCEVPtrToIntExpr in SCEVExpander::generateOverflowCheck()

We shouldn't end up with ptrtoint-of-getelementptr there.


  Commit: 73f60e398890941521d55868705c0b539ed80f94
      https://github.com/llvm/llvm-project/commit/73f60e398890941521d55868705c0b539ed80f94
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll
    M llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll

  Log Message:
  -----------
  [SCEVExpander] generateOverflowCheck(): explicitly PtrToInt the Start

Currently, InsertNoopCastOfTo() would implicitly insert that cast,
but now that we have SCEVPtrToIntExpr, i'm hoping we could stop
InsertNoopCastOfTo() from doing that. But first all users must be fixed.


  Commit: b8a3705896d254682a4ba36dd79a436ec4a917d4
      https://github.com/llvm/llvm-project/commit/b8a3705896d254682a4ba36dd79a436ec4a917d4
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp

  Log Message:
  -----------
  [NFCI][SCEVExpander] Extract GetOptimalInsertionPointForCastOf() helper


  Commit: 442c408e0e4a4d794752e710a362a5449d585432
      https://github.com/llvm/llvm-project/commit/442c408e0e4a4d794752e710a362a5449d585432
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp

  Log Message:
  -----------
  [SCEVExpander] GetOptimalInsertionPointForCastOf(): gracefully handle Constant's

I guess this case hasn't come up thus far, and i'm not sure if it can
really happen for the existing usages, thus no test in *this* commit.

But, the following commit adds test coverage,
there we'd expirience a crash without this fix.


  Commit: ecc9d7e913eec96816499d0a328c6134281f8aad
      https://github.com/llvm/llvm-project/commit/ecc9d7e913eec96816499d0a328c6134281f8aad
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll
    M llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll

  Log Message:
  -----------
  [SCEVExpander] Expand explicit PtrToInt casts just like we would implicit ones

I.e., use GetOptimalInsertionPointForCastOf() helper to get the insertion
point, and try to reuse casts first.


  Commit: d746fefb6ffde82bc6ea4e2ccf6c637ee521423e
      https://github.com/llvm/llvm-project/commit/d746fefb6ffde82bc6ea4e2ccf6c637ee521423e
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll

  Log Message:
  -----------
  [SCEVExpander] ReuseOrCreateCast(): use IRBuilder to actually create the cast

In particular, this allows to create constant expressions
instead of IR Instruction's if the argumen is a constant.


Compare: https://github.com/llvm/llvm-project/compare/ddcdeae35868...d746fefb6ffd


More information about the All-commits mailing list