[PATCH] D32654: Fix AliasSetTracker

Piotr Padlewski via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 13:17:54 PDT 2017


Yep, as Sanjoy commented on revision

On Apr 28, 2017 21:14, "Daniel Berlin" <dberlin at dberlin.org> wrote:

> I presume this is because it uses value handles to try to keep up to date?
> :(
>
>
> On Fri, Apr 28, 2017 at 12:11 PM, Piotr Padlewski via Phabricator via
> llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
>> Prazek created this revision.
>>
>> AliasSetTracker was crashing when the UnknownInstruction
>> was reduced to Value (llvm.invariant.group.barrier(null) to null)
>>
>>
>> https://reviews.llvm.org/D32654
>>
>> Files:
>>   include/llvm/Analysis/AliasSetTracker.h
>>   test/Transforms/LICM/2017-28-04-invariant.group.ll
>>
>>
>> Index: test/Transforms/LICM/2017-28-04-invariant.group.ll
>> ===================================================================
>> --- /dev/null
>> +++ test/Transforms/LICM/2017-28-04-invariant.group.ll
>> @@ -0,0 +1,41 @@
>> +; RUN: opt -licm < %s
>> +
>> +; This test check if nothing explodes if invariant.group.barrier of null
>> is
>> +; reduced to null.
>> +; Function Attrs: nounwind uwtable
>> +define fastcc void @_ZN12_GLOBAL__N_117GlobalISel
>> Emitter3runERN4llvm11raw_ostreamE() unnamed_addr align 2 {
>> +entry:
>> +  switch i8 undef, label %if.end8.i.i [
>> +    i8 0, label %if.then.i.i3
>> +    i8 1, label %if.then4.i.i
>> +  ]
>> +
>> +if.then.i.i3:                                     ; preds = %entry
>> +  br label %for.body
>> +
>> +if.then4.i.i:                                     ; preds = %entry
>> +  unreachable
>> +
>> +if.end8.i.i:                                      ; preds = %entry
>> +  unreachable
>> +
>> +for.body:                                         ; preds =
>> %for.cond66.i.i.for.end151.i.i_crit_edge, %if.then.i.i3
>> +  br label %for.body69.i.i
>> +
>> +for.body69.i.i:                                   ; preds =
>> %for.body69.i.i, %for.body
>> +  %0 = call i8* @llvm.invariant.group.barrier(i8* null) #2, !noalias !1
>> +  br i1 undef, label %for.cond66.i.i.for.end151.i.i_crit_edge, label
>> %for.body69.i.i
>> +
>> +for.cond66.i.i.for.end151.i.i_crit_edge:          ; preds =
>> %for.body69.i.i
>> +  br label %for.body
>> +}
>> +
>> +; Function Attrs: inaccessiblememonly nounwind
>> +declare i8* @llvm.invariant.group.barrier(i8*) #1
>> +
>> +attributes #1 = { inaccessiblememonly nounwind }
>> +attributes #2 = { nounwind }
>> +
>> +!1 = !{!2}
>> +!2 = distinct !{!2, !3, !"_ZN4llvm5Error11takePayloadEv: %agg.result"}
>> +!3 = distinct !{!3, !"_ZN4llvm5Error11takePayloadEv"}
>> Index: include/llvm/Analysis/AliasSetTracker.h
>> ===================================================================
>> --- include/llvm/Analysis/AliasSetTracker.h
>> +++ include/llvm/Analysis/AliasSetTracker.h
>> @@ -174,7 +174,7 @@
>>
>>    Instruction *getUnknownInst(unsigned i) const {
>>      assert(i < UnknownInsts.size());
>> -    return cast_or_null<Instruction>(UnknownInsts[i]);
>> +    return dyn_cast_or_null<Instruction>(UnknownInsts[i]);
>>    }
>>
>>  public:
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170428/d46f6847/attachment-0001.html>


More information about the llvm-commits mailing list