[llvm-commits] [PATCH] Fix for GVN::processLoad when no TargetData available

Chris Lattner clattner at apple.com
Tue Oct 20 21:11:31 PDT 2009


On Oct 20, 2009, at 6:27 PM, Kenneth Uildriks wrote:

> In the existing code, if the load and the value to replace it with are
> of different types *and* target data is available, it tries to use the
> target data to coerce the replacement value to the type of the load.
> Otherwise, it skips all effort to handle the type mismatch and just
> feeds the wrongly-typed replacement value to replaceAllUsesWith, which
> triggers an assertion.
>
> The patch replaces it with an outer if checking for type mismatch, and
> an inner if-else that checks whether target data is available and, if
> not, returns false rather than trying to replace the load.

Thanks, applied in r84739

-Chris



More information about the llvm-commits mailing list