[llvm-commits] [llvm] r127834 - in /llvm/trunk: include/llvm/Transforms/Utils/Local.h lib/Transforms/InstCombine/InstructionCombining.cpp lib/Transforms/Utils/Local.cpp test/Transforms/InstCombine/debuginfo.ll

Devang Patel dpatel at apple.com
Fri Mar 18 16:51:54 PDT 2011


On Mar 17, 2011, at 5:40 PM, Eli Friedman wrote:

> Assuming I'm reading the change correctly, take an example like the following:
> void foo(int* x) { *x = 10; }
> int bar(int i) {
>  int a;
>  a = i;
>  foo(&a);
>  return a; // If you "print a" at this point, you'll get the value of
> i, not 10.
> }

Before this patch, instcombine will completely thrash a's debug value. Now, you get correct value until call foo(&a). The patch did not took care of reload of values pinned by alloca as illustrated by your example. Fixed in r127924.
-
Devang



More information about the llvm-commits mailing list