diff options
author | Preston Gurd <preston.gurd@intel.com> | 2012-10-04 21:33:40 +0000 |
---|---|---|
committer | Preston Gurd <preston.gurd@intel.com> | 2012-10-04 21:33:40 +0000 |
commit | 8d662b59f075da67e663ed142ecdd58e381eee98 (patch) | |
tree | 0ff325bb9e5f547682f9b46d0baee62347058406 /include | |
parent | 837c28a84076e1cd63bbf29057b791ebe6b03de0 (diff) | |
download | external_llvm-8d662b59f075da67e663ed142ecdd58e381eee98.zip external_llvm-8d662b59f075da67e663ed142ecdd58e381eee98.tar.gz external_llvm-8d662b59f075da67e663ed142ecdd58e381eee98.tar.bz2 |
This patch corrects commit 165126 by using an integer bit width instead of
a pointer to a type, in order to remove the uses of getGlobalContext().
Patch by Tyler Nowicki.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 20 | ||||
-rw-r--r-- | include/llvm/Transforms/Utils/BypassSlowDivision.h | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 57d987b..9663931 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -157,12 +157,12 @@ public: /// isSlowDivBypassed - Returns true if target has indicated at least one /// type should be bypassed. - bool isSlowDivBypassed() const { return !BypassSlowDivTypes.empty(); } + bool isSlowDivBypassed() const { return !BypassSlowDivWidths.empty(); } /// getBypassSlowDivTypes - Returns map of slow types for division or /// remainder with corresponding fast types - const DenseMap<Type *, Type *> &getBypassSlowDivTypes() const { - return BypassSlowDivTypes; + const DenseMap<unsigned int, unsigned int> &getBypassSlowDivWidths() const { + return BypassSlowDivWidths; } /// isPow2DivCheap() - Return true if pow2 div is cheaper than a chain of @@ -1083,9 +1083,9 @@ protected: /// of instructions not containing an integer divide. void setIntDivIsCheap(bool isCheap = true) { IntDivIsCheap = isCheap; } - /// addBypassSlowDivType - Tells the code generator which types to bypass. - void addBypassSlowDivType(Type *slow_type, Type *fast_type) { - BypassSlowDivTypes[slow_type] = fast_type; + /// addBypassSlowDiv - Tells the code generator which bitwidths to bypass. + void addBypassSlowDiv(unsigned int SlowBitWidth, unsigned int FastBitWidth) { + BypassSlowDivWidths[SlowBitWidth] = FastBitWidth; } /// setPow2DivIsCheap - Tells the code generator that it shouldn't generate @@ -1810,11 +1810,11 @@ private: /// set to true unconditionally. bool IntDivIsCheap; - /// BypassSlowDivTypes - Tells the code generator to bypass slow divide or - /// remainder instructions. For example, SlowDivBypass[i32,u8] tells the code - /// generator to bypass 32-bit signed integer div/rem with an 8-bit unsigned + /// BypassSlowDivMap - Tells the code generator to bypass slow divide or + /// remainder instructions. For example, BypassSlowDivWidths[32,8] tells the + /// code generator to bypass 32-bit integer div/rem with an 8-bit unsigned /// integer div/rem when the operands are positive and less than 256. - DenseMap <Type *, Type *> BypassSlowDivTypes; + DenseMap <unsigned int, unsigned int> BypassSlowDivWidths; /// Pow2DivIsCheap - Tells the code generator that it shouldn't generate /// srl/add/sra for a signed divide by power of two, and let the target handle diff --git a/include/llvm/Transforms/Utils/BypassSlowDivision.h b/include/llvm/Transforms/Utils/BypassSlowDivision.h index dceda48..ac8af12 100644 --- a/include/llvm/Transforms/Utils/BypassSlowDivision.h +++ b/include/llvm/Transforms/Utils/BypassSlowDivision.h @@ -26,7 +26,7 @@ namespace llvm { /// profitably bypassed and carried out with a shorter, faster divide. bool bypassSlowDivision(Function &F, Function::iterator &I, - const DenseMap<Type*, Type*> &BypassTypeMap); + const DenseMap<unsigned int, unsigned int> &BypassWidth); } // End llvm namespace |