[llvm-dev] Custom backend, unsure about error

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 23 05:58:41 PDT 2018


A virtual register must be defined (by some instruction) on each path 
from the entry to the point of use. This must be true for each use 
(non-undef) of any virtual register. In your case, the first instruction 
(COPY) uses %0, which has not been defined.

-Krzysztof

On 7/22/2018 10:08 AM, Evan Hughes via llvm-dev wrote:
> Currently writing a custom backend to add to the main LLVM tree and am
> having trouble understanding what this error is trying to tell me.
> 
> # Machine code for function main: NoPHIs, TracksLiveness
> Frame Objects:
>    fi#0: size=1, align=1, at location [SP+2]
> 
> 0B      %bb.0: derived from LLVM BB %entry
> 16B             %1:baselinereg = COPY %0; BaselineReg:%1 WREG:%0
> 32B             %0:wreg = Baseline_MOVF_W killed %1, implicit-def dead
> %status; WREG:%0 BaselineReg:%1
> 48B             %3:baselinereg = COPY %2; BaselineReg:%3 WREG:%2
> 64B             %2:wreg = Baseline_MOVF_W killed %3, implicit-def dead
> %status; WREG:%2 BaselineReg:%3
> 80B             Baseline_MOVLW killed %2, killed %0, implicit-def dead
> %status; mem:ST1[%a] WREG:%2,%0
> 
> # End machine code for function main.
> 
> Use of %0 does not have a corresponding definition on every path:
> 16r %1:baselinereg = COPY %0; BaselineReg:%1 WREG:%0
> LLVM ERROR: Use not jointly dominated by defs.
> 
> Any help would be appreciated.
> 
> Cheers, Evan
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation


More information about the llvm-dev mailing list