[PATCH] D15616: [EarlyCSE] Simplify target intrinsic support

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 10:39:56 PST 2015


reames created this revision.
reames added reviewers: hfinkel, aadg, ssijaric, pete.
reames added a subscriber: llvm-commits.

This change unwinds some complexity from the target intrinsic support.  Specifically, it removes the idea of an 'ExpectedType'.  While we do need to check the type of the returned value (or insert a bitcast), the amount of code involved in the original implementation was a bit excessive.  Note that this version may end up doing slightly more work for target intrinsics (due to the lack of an early bail), but tuning for this rare case at the cost of extra complexity seems questionable.

This change also sets us up for a possible followup enhancement to EarlyCSE.  Today, we only consider exact SSA equality in the aliasing decisions made by EarlyCSE.  We could potentially extend this by stripping bitcasts off the pointer operands and bitcasting the results if needed.  Note that this will be necessary once we get typeless/opaque pointers plumbed through everywhere anyways.  

Let me ask a basic question.  *Why* do we need these target intrinsics at all?  Additionally, if we need them, why can't they be expressed as struct stores since that appears to what they represent?  Finally, why did we decide to put these in EarlyCSE instead of GVN?  (For context, the original review thread is here: http://reviews.llvm.org/D7121)

http://reviews.llvm.org/D15616

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.h
  lib/Transforms/Scalar/EarlyCSE.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15616.43153.patch
Type: text/x-patch
Size: 8056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151217/1274fd1f/attachment.bin>


More information about the llvm-commits mailing list