[PATCH] D21246: [InstCombine] Add rule to fold away trunc of partial load

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 14:36:03 PDT 2016


anna removed rL LLVM as the repository for this revision.
anna updated this revision to Diff 61450.
anna marked 5 inline comments as done.
anna added a comment.

Added function signature changed to `Value *Ptr` instead of `LoadInst *Load`. Also name changed from `FindMemoryContents` to overloaded version of `FindAvailableLoadedValue`.

My main concern with the signature having the Pointer operand `Value *Ptr` instead of `LoadInst *Load` was making sure the atomicity checks would be correct (`LI->isAtomic < Load->isAtomic`) and the corresponding one in the `store inst SI` case.

Discussed offline with Sanjoy and we decided to leave the sanity checking to the callers of this function (both atomicity concerns and any other checks needed depending on the nature of transformation done once the value is available). 
Calling this function to see if a store value is available: `FindAvailableLoadedValue(SI->getPointerOperand(), SI->getType,...)` would possibly require careful consideration of atomicity rules.


http://reviews.llvm.org/D21246

Files:
  include/llvm/Analysis/Loads.h
  lib/Analysis/Loads.cpp
  lib/Transforms/InstCombine/InstCombineCasts.cpp
  test/Transforms/InstCombine/trunc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21246.61450.patch
Type: text/x-patch
Size: 10759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160621/f77c19f7/attachment.bin>


More information about the llvm-commits mailing list