[PATCH] D114375: [SLP]Fix emission of int division with some undef vector subelements.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 13:36:50 PST 2021


ABataev added inline comments.


================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/arith-div-undef.ll:6
 ; CHECK-LABEL: @sdiv_v8i32_undefs(
-; CHECK-NEXT:    ret <8 x i32> poison
 ;
----------------
lebedev.ri wrote:
> ABataev wrote:
> > lebedev.ri wrote:
> > > This is *NOT* a miscompile: https://alive2.llvm.org/ce/z/iMu-eF
> > Yes, also checked it via alive but not sure if alive is correct here.
> https://llvm.org/docs/LangRef.html#sdiv-instruction
> "Division by zero is undefined behavior. For vectors,
> if any element of the divisor is zero,
> the operation has undefined behavior. "
> 
> https://alive2.llvm.org/ce/z/mZvBXL
Yep, thought about this. But thought that a buildvector has different behavior. Probably here the whole program becomes UB after division by undef.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114375



More information about the llvm-commits mailing list