From: David Terei Date: Mon, 28 Jun 2010 11:51:20 +0000 (+0000) Subject: Add noalias and nocapture attributes to pointer stg registers X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=439cda45847149cb740e7e7a288c90c5e7743cf8;p=ghc-hetmet.git 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. --- diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 83469c8..ba74a7f 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -89,11 +89,15 @@ llvmFunSig :: CLabel -> LlvmLinkageType -> LlvmFunctionDecl llvmFunSig lbl link = llvmFunSig' (strCLabel_llvm lbl) link llvmFunSig' :: LMString -> LlvmLinkageType -> LlvmFunctionDecl -llvmFunSig' lbl link = LlvmFunctionDecl lbl link llvmGhcCC LMVoid FixedArgs - (tysToParams $ map getVarType llvmFunArgs) llvmFunAlign +llvmFunSig' lbl link + = 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. -mkLlvmFunc :: CLabel -> LlvmLinkageType -> LMSection -> LlvmBlocks -> LlvmFunction +mkLlvmFunc :: CLabel -> LlvmLinkageType -> LMSection -> LlvmBlocks + -> LlvmFunction mkLlvmFunc lbl link sec blks = let funDec = llvmFunSig lbl link funArgs = map (fsLit . getPlainName) llvmFunArgs