diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2011-05-06 20:34:06 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2011-05-06 20:34:06 +0000 |
| commit | 2518f8376d7dcaa28e17c96a34bdd9e0f389cd11 (patch) | |
| tree | bba6f0dae76d2252bbf59915514a310724fa5c47 /llvm/include | |
| parent | 44932b6805c31075deb5173f89a70a5474459aaa (diff) | |
| download | bcm5719-llvm-2518f8376d7dcaa28e17c96a34bdd9e0f389cd11.tar.gz bcm5719-llvm-2518f8376d7dcaa28e17c96a34bdd9e0f389cd11.zip | |
Make the logic for determining function alignment more explicit. No functionality change.
llvm-svn: 131012
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Target/TargetLowering.h | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h index 15db9c52bf4..218431201b0 100644 --- a/llvm/include/llvm/Target/TargetLowering.h +++ b/llvm/include/llvm/Target/TargetLowering.h @@ -761,6 +761,18 @@ public: return MinStackArgumentAlignment; } + /// getMinFunctionAlignment - return the minimum function alignment. + /// + unsigned getMinFunctionAlignment() const { + return MinFunctionAlignment; + } + + /// getPrefFunctionAlignment - return the preferred function alignment. + /// + unsigned getPrefFunctionAlignment() const { + return PrefFunctionAlignment; + } + /// getPrefLoopAlignment - return the preferred loop alignment. /// unsigned getPrefLoopAlignment() const { @@ -824,9 +836,6 @@ public: /// PIC relocation models. virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const; - /// getFunctionAlignment - Return the Log2 alignment of this function. - virtual unsigned getFunctionAlignment(const Function *) const = 0; - /// getStackCookieLocation - Return true if the target stores stack /// protector cookies at a fixed offset in some non-standard address /// space, and populates the address space and offset as @@ -1167,6 +1176,18 @@ protected: JumpBufAlignment = Align; } + /// setMinFunctionAlignment - Set the target's minimum function alignment. + void setMinFunctionAlignment(unsigned Align) { + MinFunctionAlignment = Align; + } + + /// setPrefFunctionAlignment - Set the target's preferred function alignment. + /// This should be set if there is a small performance benefit to + /// higher-than-minimum alignment + void setPrefFunctionAlignment(unsigned Align) { + PrefFunctionAlignment = Align; + } + /// setPrefLoopAlignment - Set the target's preferred loop alignment. Default /// alignment is zero, it means the target does not care about loop alignment. void setPrefLoopAlignment(unsigned Align) { @@ -1701,6 +1722,17 @@ private: /// unsigned MinStackArgumentAlignment; + /// MinFunctionAlignment - The minimum function alignment (used when + /// optimizing for size, and to prevent explicitly provided alignment + /// from leading to incorrect code). + /// + unsigned MinFunctionAlignment; + + /// PrefFunctionAlignment - The perferred function alignment (used when + /// alignment unspecified and optimizing for speed). + /// + unsigned PrefFunctionAlignment; + /// PrefLoopAlignment - The perferred loop alignment. /// unsigned PrefLoopAlignment; |

