[Attributor][FIX] Do not attach range metadata to the wrong Instruction
authorJohannes Doerfert <johannes@jdoerfert.de>
Sat, 10 Oct 2020 15:06:03 +0000 (10:06 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 28 Oct 2020 03:07:55 +0000 (22:07 -0500)
commitbfe05b1aff1b8e5dd625f905879d7425c8460989
tree24579f8344da09a44b710a72cd5e724487e60534
parent724fcce1092da409fe4ea63fb27d23637d472680
[Attributor][FIX] Do not attach range metadata to the wrong Instruction

If we are looking at a call site argument it might be a load or call
which is in a different context than the call site argument. We cannot
simply use the call site argument range for the call or load.

Bug reported and reduced by Whitney Tsang <whitneyt@ca.ibm.com>.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/range.ll