[PATCH] D39973: Fix CaptureTracking for llvm.invariant.group.barrier

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 11:11:57 PST 2017


yaxunl added inline comments.


================
Comment at: test/CodeGen/AMDGPU/promote-alloca-invariant-markers.ll:2
+; RUN:  llc -amdgpu-scalarize-global-loads=false  -march=amdgcn -mtriple=amdgcn---amdgiz -mattr=+promote-alloca -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
+target datalayout = "A5"
 
----------------
arsenm wrote:
> yaxunl wrote:
> > arsenm wrote:
> > > Why is it necessary to add this? The datalayout is implied by the explicit triple
> > Removing this will cause error:
> > 
> > llc: <stdin>:13:31: error: address space must match datalayout
> >   %tmp = alloca i32, align 4, addrspace(5)
> > 
> This sounds like a bug. This should be coming from the datalayout
The error msg comes from LLParser::ParseAlloc.

llc load and parse IR before setting target triple and datalayout for the module.

When llc parses IR, it has to use the datalayout defined by the IR itself. If the IR does not define datalayout, the default layout created from empty string is used.

Currently LLParser does not allow overriding the datalayout of the IR by a given datalayout.

If we want to change this, we need to add an API to LLParser to allow datalayout to be set before parsing IR, and change llc to set datalayout before parsing IR. I think this is better left for another patch.


https://reviews.llvm.org/D39973





More information about the llvm-commits mailing list