[PATCH] D16205: ValueTracking: Put DataLayout reference into the Query structure, NFC.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 16:00:56 PST 2016


MatzeB added a comment.

In http://reviews.llvm.org/D16205#327411, @joker.eph wrote:

> IIUC, you just save a pointer argument to `computeKnownBits` right? Is it the only reason for the speedup? Pretty surprising to me.


Yes it's "just" the pointer argument, but the code here is called often and recursively so this can add up to smaller stack size and reduced reloading/spilling.


================
Comment at: lib/Analysis/ValueTracking.cpp:461
@@ -467,1 +460,3 @@
+static bool isValidAssumeForContext(Value *V, const Instruction *CxtI,
+                                    const DominatorTree *DT) {
   Instruction *Inv = cast<Instruction>(V);
----------------
joker.eph wrote:
> The changes in this function seems unrelated to the DataLayout, it is a cleanup that you could commit separately I feel.
> 
This is necessary because llvm::isValidAssumeForContext() constructed an ad-hoc Query to transmit these 2 values, however we do not have a DataLayout at that point and actually don't need it here anyway.


Repository:
  rL LLVM

http://reviews.llvm.org/D16205





More information about the llvm-commits mailing list