[PATCH] D59363: [SelectionDAG] Add icmp UNDEF handling to SelectionDAG::FoldSetCC

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 08:09:45 PDT 2019


spatel added inline comments.


================
Comment at: test/CodeGen/X86/urem-seteq-vec-nonsplat.ll:686
 ; CHECK-SSE:       # %bb.0:
-; CHECK-SSE-NEXT:    pxor %xmm0, %xmm0
-; CHECK-SSE-NEXT:    pcmpeqd %xmm0, %xmm0
-; CHECK-SSE-NEXT:    psrld $31, %xmm0
+; CHECK-SSE-NEXT:    movaps {{.*#+}} xmm0 = [1,1,1,1]
 ; CHECK-SSE-NEXT:    retq
----------------
RKSimon wrote:
> lebedev.ri wrote:
> > Hmm, but `-instsimplify` says it's `0` https://godbolt.org/z/1dpyQG
> > Either answer is correct?
> Interesting (please can you raise a bug?) - the patch isn't actually changing the result in DAG, its just managing to constant fold.
Probably not necessary? The urem invokes UB:
https://llvm.org/docs/LangRef.html#urem-instruction

So it's not that either answer is correct...*any* answer is correct. :)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59363/new/

https://reviews.llvm.org/D59363





More information about the llvm-commits mailing list