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

Kenneth Uildriks kennethuil at gmail.com
Tue Oct 20 18:27:30 PDT 2009


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gvn.patch
Type: text/x-patch
Size: 2266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091020/5668c4b5/attachment.bin>


More information about the llvm-commits mailing list