[Attributor] Use the proper context instruction in genericValueTraversal
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 2 Apr 2020 03:05:24 +0000 (22:05 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 2 Apr 2020 03:20:47 +0000 (22:20 -0500)
commitbcd8009369f86be8649307692f5ba57aad5ca29b
treee1c6ccf5e2262c2bb2c08449bdf1ab3cc638a937
parentac96c8fd8535b50ab5ac158f521b0be8800df6fd
[Attributor] Use the proper context instruction in genericValueTraversal

There was a TODO in genericValueTraversal to provide the context
instruction and due to the lack of it users that wanted one just used
something available. Unfortunately, using a fixed instruction is wrong
in the presence of PHIs so we need to update the context instruction
properly.

Reviewed By: uenoku

Differential Revision: https://reviews.llvm.org/D76870
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/test/Transforms/Attributor/range.ll