[PATCH] Rename PerBBDivCache to DivCache in BypassSlowDivision.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 05:16:36 PST 2015


Hi Justin,

You seem to be right, but the code does not seem to be setup correctly for a function-level cache. Specifically, it seems to be missing a dominance check before reusing the result of the previous division expansion. Thus, if we have:

%Dividend = ...
%Divisor = ...

if (%whatever) {
  %Ret = %Dividend / %Divisor;
} else {
  %Ret2 = %Dividend / %Divisor;
}

what prevents this code from "reusing" the expansion for %Ret upon encountering %Ret2?

 -Hal

----- Original Message -----
> From: "Justin Lebar via llvm-commits" <llvm-commits at lists.llvm.org>
> To: "llvm-commits" <llvm-commits at lists.llvm.org>
> Cc: "preston gurd" <preston.gurd at intel.com>
> Sent: Tuesday, December 8, 2015 12:12:22 PM
> Subject: [PATCH] Rename PerBBDivCache to DivCache in BypassSlowDivision.
> 
> This hashtable is used for the whole function, not just the BB.
> 
> No functional changes.
> ---
>  lib/Transforms/Utils/BypassSlowDivision.cpp | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-commits mailing list