[IR] Replace *all* uses of a constant expression by corresponding instruction
authorhsmahesha <mahesha.comp@gmail.com>
Tue, 2 Nov 2021 04:31:36 +0000 (10:01 +0530)
committerhsmahesha <mahesha.comp@gmail.com>
Tue, 2 Nov 2021 04:31:46 +0000 (10:01 +0530)
commite9ea99249623f19563ec0c4c8d6a70fb5c4b670f
treeb6d17128a5496f008b8c39661297061e788e1eff
parentd137854412533d9c01c2ef9795ae6514a66c2d8b
[IR] Replace *all* uses of a constant expression by corresponding instruction

When a constant expression CE is being converted into a corresponding instruction I,
CE is supposed to be replaced by I. However, it is possible that CE is being used multiple
times within a parent instruction PI. Make sure that *all* the uses of CE within PI are
replaced by I.

Reviewed By: rampitec, arsenm

Differential Revision: https://reviews.llvm.org/D112717
llvm/lib/IR/ReplaceConstant.cpp
llvm/test/CodeGen/AMDGPU/lower-kernel-lds-constexpr.ll