Commit 439cda45 authored by dterei's avatar dterei
Browse files

Add noalias and nocapture attributes to pointer stg registers

At the moment this gives a very slight performance boost of around 1 - 2%.
Future changes to the generated code though so that pointers are kept as
pointers more often instead of being cast to integer types straight away
should hopefully improve the benefit this brings.
parent ae03da75
...@@ -89,11 +89,15 @@ llvmFunSig :: CLabel -> LlvmLinkageType -> LlvmFunctionDecl ...@@ -89,11 +89,15 @@ llvmFunSig :: CLabel -> LlvmLinkageType -> LlvmFunctionDecl
llvmFunSig lbl link = llvmFunSig' (strCLabel_llvm lbl) link llvmFunSig lbl link = llvmFunSig' (strCLabel_llvm lbl) link
llvmFunSig' :: LMString -> LlvmLinkageType -> LlvmFunctionDecl llvmFunSig' :: LMString -> LlvmLinkageType -> LlvmFunctionDecl
llvmFunSig' lbl link = LlvmFunctionDecl lbl link llvmGhcCC LMVoid FixedArgs llvmFunSig' lbl link
(tysToParams $ map getVarType llvmFunArgs) llvmFunAlign = let toParams x | isPointer x = (x, [NoAlias, NoCapture])
| otherwise = (x, [])
in LlvmFunctionDecl lbl link llvmGhcCC LMVoid FixedArgs
(map (toParams . getVarType) llvmFunArgs) llvmFunAlign
-- | Create a Haskell function in LLVM. -- | Create a Haskell function in LLVM.
mkLlvmFunc :: CLabel -> LlvmLinkageType -> LMSection -> LlvmBlocks -> LlvmFunction mkLlvmFunc :: CLabel -> LlvmLinkageType -> LMSection -> LlvmBlocks
-> LlvmFunction
mkLlvmFunc lbl link sec blks mkLlvmFunc lbl link sec blks
= let funDec = llvmFunSig lbl link = let funDec = llvmFunSig lbl link
funArgs = map (fsLit . getPlainName) llvmFunArgs funArgs = map (fsLit . getPlainName) llvmFunArgs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment