[EarlyCSE] Simplify and invert ParseMemoryInst [NFCI]
authorPhilip Reames <listmail@philipreames.com>
Mon, 7 Dec 2015 21:27:15 +0000 (21:27 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 7 Dec 2015 21:27:15 +0000 (21:27 +0000)
commit3f8a9448c501898a912830554762408460b9a61d
treea41a81c09aba132f461ac4fbe92c1882fcd56590
parentaa464aada41ae2b8ef9f3ef4147c6ef09d2879e2
[EarlyCSE] Simplify and invert ParseMemoryInst [NFCI]

Restructure ParseMemoryInst - which was introduced to abstract over target specific load and stores instructions - to just query the underlying instructions. In theory, this could be slightly slower than caching the results, but in practice, it's very unlikely to be measurable.

The simple query scheme makes it far easier to understand, and much easier to extend with new queries. Given I'm about to need to add new query types, doing the cleanup first seemed worthwhile.

Do we still believe the target specific intrinsic handling is worthwhile in EarlyCSE? It adds quite a bit of complexity and makes the code harder to read. Being able to delete the abstraction entirely would be wonderful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254950 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/EarlyCSE.cpp