[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)
commit998cae653b8f92913a17fa94118033d81f2cc1f5
tree65c9d38469a0ea5404b1a9fd41b159b2e878b976
parentfaca93e40718094a3739778b748ed332fe5a239e
[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.

llvm-svn: 254950
llvm/lib/Transforms/Scalar/EarlyCSE.cpp