[IR] Simplify createReplacementInstr
authorJay Foad <jay.foad@amd.com>
Fri, 11 Jun 2021 15:36:30 +0000 (16:36 +0100)
committerJay Foad <jay.foad@amd.com>
Wed, 23 Jun 2021 09:47:43 +0000 (10:47 +0100)
commit157473a58f02b8f2ad12ecbaaa1af32d0342257b
treebc53dd9731fb3145f33b3b8c375de647dd46b311
parentf1844f15c1ad54b78f2d84087df4b51fe5f703f6
[IR] Simplify createReplacementInstr

NFCI, although the test change shows that ConstantExpr::getAsInstruction
is better than the old implementation of createReplacementInstr because
it propagates things like the sdiv "exact" flag.

Differential Revision: https://reviews.llvm.org/D104124
clang/test/CodeGenCUDA/managed-var.cu
llvm/lib/IR/ReplaceConstant.cpp