[PATCH] D86530: [InstCombine] PHI-of-extractvalues -> extractvalue-of-PHI, aka invokes are bad

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 08:53:02 PDT 2020


lebedev.ri added a comment.

In D86530#2238580 <https://reviews.llvm.org/D86530#2238580>, @lebedev.ri wrote:

> In D86530#2238463 <https://reviews.llvm.org/D86530#2238463>, @spatel wrote:
>
>> In D86530#2238460 <https://reviews.llvm.org/D86530#2238460>, @lebedev.ri wrote:
>>
>>> So before i look into `foldAggregateConstructionIntoAggregateReuse()` further,
>>> what are your thoughts about teaching InstSimplify to do most basic CSE for PHI nodes?
>>> (purely by comparing that the incoming values match)
>>
>> Instruction::isIdenticalTo()?
>
> Hm, i guess, although that one is broken QoI-wise for PHI's - it assumes identical incoming block order, which isn't something that should be depended upon.
>
>> I see one use of that via visitStoreInst, so there's possible precedent. Start a llvm-dev thread to get other opinions?

Actually, apparently we don't even do PHI CSE in EarlyCSE,
so i consider my question to be dumb,
and directly proceeded with the fix, rG6102310d814ad73eab60a88b21dd70874f7a056f <https://reviews.llvm.org/rG6102310d814ad73eab60a88b21dd70874f7a056f>.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86530/new/

https://reviews.llvm.org/D86530



More information about the llvm-commits mailing list