[GVN] Don't explicitly materialize undefs from dead blocks
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Mar 2021 22:28:38 +0000 (23:28 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Mar 2021 22:46:24 +0000 (23:46 +0100)
commit3fedaf2a522b5ca8db209a3864bf55978c407b29
treea0ceefe3d1a30dd1d09aada3b41942c7dc862b91
parent5f319fc444ca6c4b6b3905a026534d6d90acd37e
[GVN] Don't explicitly materialize undefs from dead blocks

When materializing an available load value, do not explicitly
materialize the undef values from dead blocks. Doing so will
will force creation of a phi with an undef operand, even if there
is a dominating definition. The phi will be folded away on
subsequent GVN iterations, but by then we may have already
poisoned MDA cache slots.

Simply don't register these values in the first place, and let
SSAUpdater do its thing.
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Transforms/GVN/load-dead-block.ll