[PATCH] D10571: Allow InstCombiner to eliminate truncates even if it will require inserting additional instructions

Philip Reames listmail at philipreames.com
Fri Jul 31 16:50:50 PDT 2015


reames added a comment.

Looking through the patch, this looks entirely reasonable to me.  However, I'm not comfortable enough with this code to sign off.  Can we get someone familiar with InstCombine and our canonicalization rules around truncation to take a quick look?


================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:488
@@ +487,3 @@
+  // instructions required.
+  const int CostThreshold = 1;
+  return CanTruncate && Cost < CostThreshold;
----------------
You might consider passing the CostThreshold in to CanEvaluateTruncated and return early if the running cost estimate ever gets too high above CostThreshold.  We want to allow analysis of cases close to the threshold, but not burn a lot of compile time.  Having said that, I'm just being pedantic.  I don't think this is an actual issue.  


Repository:
  rL LLVM

http://reviews.llvm.org/D10571







More information about the llvm-commits mailing list