[PATCH] D17898: Implement expansion of {s,u}{min,max}

Jan Vesely via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 6 14:21:17 PST 2016


jvesely added a comment.

In http://reviews.llvm.org/D17898#368335, @arsenm wrote:

> What is emitting the illegal min/max?
>
> Isn't this already handled in DAGTypeLegalizer::PromoteIntegerResult? I added handling here a while ago


I don't think this ever went through promotion pass since the types are i64 to begin with. Finding and fixing the place is probably better than undoing it in type legalization, but I had trouble finding the place
with dumps enabled, the last thing that I see before assertion failure is:

  *** IR Dump After Module Verifier ***
  ; Function Attrs: norecurse nounwind uwtable
  define void @test(i64* nocapture %out, i64 %a, i64 %b) #0 {
  entry:
    %cmp = icmp sgt i64 %a, %b
    %cond = select i1 %cmp, i64 %a, i64 %b
    store i64 %cond, i64* %out, align 8, !tbaa !7
    ret void
  }
  ExpandIntegerResult #0: t16: i64 = smax t12, t13
  
  Do not know how to expand the result of this operator!

the next pass is: AMDGPU DAG->DAG Pattern Instruction Selection
I'm not sure if llvm dump is of much use as afaik these ops don't show up there (which I assume means that they are not used).
the added test cases trigger the problem for EG.


Repository:
  rL LLVM

http://reviews.llvm.org/D17898





More information about the llvm-commits mailing list