[all-commits] [llvm/llvm-project] e735f2: [SCEVExpander] Prefer pointer expansion for overfl...
Philip Reames via All-commits
all-commits at lists.llvm.org
Wed Sep 1 13:11:38 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e735f2bf379285294c41748eec3e95e3e8bd1acd
https://github.com/llvm/llvm-project/commit/e735f2bf379285294c41748eec3e95e3e8bd1acd
Author: Philip Reames <listmail at philipreames.com>
Date: 2021-09-01 (Wed, 01 Sep 2021)
Changed paths:
M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
M llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll
M llvm/test/Transforms/LoopVersioning/wrapping-pointer-versioning.ll
Log Message:
-----------
[SCEVExpander] Prefer pointer expansion for overflow checks
We'd special cased this logic to use pointer types for non-integral pointers, but there's no reason we can't do that for all pointer types. Doing it this was has a few advantages:
a) The code itself becomes more straight forward, and easier to test.
b) We avoid introducing ptrtoint into programs which didn't have them in the source.
c) The resulting codegen is easier to analyze and simplify (mostly due to lack of ptrtoint).
Note that there are some test diffs, but a) running them through instcombine helps a ton, and b) there's enough missing obvious transforms on both before and after IR that it's clear this isn't performance sensitive.
This is mostly motivated by cleaning up mentions of non-integrals to have a clearer idea of what we actually need to support.
Differential Revision: https://reviews.llvm.org/D104662
More information about the All-commits
mailing list