[PATCH] [IC] Turn non-null MD on pointer loads to range MD on integer loads.

Charles Davis cdavis5x at gmail.com
Tue Feb 24 12:25:18 PST 2015


Use `ConstantExpr`s instead of assuming `ptrtoint null` is 0.

Also:

- The integer range is now (as @chandlerc suggested) `!{add (ptrtoint null, 1), ptrtoint null}`--under normal circumstances, that should be `!{1, 0}` instead of `!{1, -1}`.
- Add a big scary FIXME warning others not to add CHECK-LABEL lines after the `!nonnull` -> `!range` test.
- Add an `MDBuilder::createRange` overload to build range MD tuples from `Constant`s. (Hope that's OK; I needed it for this patch, because it's difficult to get `APInt`s out of `ConstantExpr`s.)
- Fix some syntax errors I let out the last time. (That'll teach me to make last minute changes right before updating without building... ;)


http://reviews.llvm.org/D7621

Files:
  include/llvm/IR/MDBuilder.h
  lib/IR/MDBuilder.cpp
  lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  test/Transforms/InstCombine/loadstore-metadata.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7621.20616.patch
Type: text/x-patch
Size: 5263 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150224/d3178fab/attachment.bin>


More information about the llvm-commits mailing list