Skip to content

Commit 4745d31

Browse files
jgu222igcbot
authored andcommitted
Relax assertion
Previously mergeUseFrom() requires both arguments to be used and their LVInfo have been constructed when mergeUseFrom() is invoked. This isn't true for inline asm call, in which the second argument is dead in term of llvm value usage (but call isn't dead). Relax it to let this case compile without assertion.
1 parent fed6aea commit 4745d31

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

IGC/Compiler/CISACodeGen/LiveVars.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,14 @@ bool LiveVars::hasInterference(llvm::Value* V0, llvm::Value* V1)
714714
// updated to reflect such a merging.
715715
void LiveVars::mergeUseFrom(Value* V, Value* fromV)
716716
{
717-
IGC_ASSERT_MESSAGE(VirtRegInfo.count(V), "MergeUseFrom should be used after LVInfo has been contructed!");
718-
IGC_ASSERT_MESSAGE(VirtRegInfo.count(fromV), "MergeUseFrom should be used after LVInfo has been contructed!");
717+
// Normally, both VitrRegInfo.count(V) and VirtRegInfo.count(fromV) are
718+
// non-zero, meaning their LVInfo have been constructed (they are not
719+
// dead). However, we see inline asm case in which fromV is dead in term
720+
// of llvm value usage and therefore no LVInfo (as inline asm call has
721+
// side-effect, the inline asm is not dead). For this reason, we relax
722+
// assertion to require at least one has LVInfo.
723+
IGC_ASSERT_MESSAGE(VirtRegInfo.count(V) || VirtRegInfo.count(fromV),
724+
"MergeUseFrom should be used after LVInfo have been constructed!");
719725

720726
LVInfo& LVI = getLVInfo(V);
721727
LVInfo& fromLVI = getLVInfo(fromV);

0 commit comments

Comments
 (0)