[PATCH] D43027: [ThinLTO] Skip BlockAddresses while replacing uses in function import

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 12:17:34 PST 2018


pcc added a comment.

In https://reviews.llvm.org/D43027#1000808, @tejohnson wrote:

> I'd like @pcc to comment. I noticed there are a number of other places in this file where we will still be calling replaceAllUsesWith on a Function. How do we know which should use which method?


We need to use `replaceUsesExceptBlockAddr` if the function that we are replacing is a function definition. As far as I can tell, in all other cases we are replacing function declarations.



================
Comment at: llvm/test/ThinLTO/X86/blockaddr-import.ll:2
+; RUN: opt -thinlto-bc %s -o %t1.bc
+; RUN: llvm-lto2 run %t1.bc -r=%t1.bc,o,x -r=%t1.bc,l,plx -r=%t1.bc,m,plx -r=%t1.bc,d,plx -o %t2
+
----------------
Can this be written as an IR-level test of the pass? See for example `llvm/test/Transforms/LowerTypeTests/import-icall.ll`.


https://reviews.llvm.org/D43027





More information about the llvm-commits mailing list