[PATCH] D134071: [SPIRV] fix build with clang and use PoisonValue instead of UndefValue

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 17 03:37:36 PDT 2022


nlopes accepted this revision.
nlopes added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp:229
   Constant *ConstVec = ConstantVector::getSplat(VecElemCount, ConstInt);
-  Value *NewVec = new ShuffleVectorInst(Inst, UndefVal, ConstVec, "", CI);
+  Value *NewVec = new ShuffleVectorInst(Inst, PVal, ConstVec, "", CI);
   CI->setOperand(1, NewVec);
----------------
This code seems to be implementing a splat of CI->getOperand(1) to a vector of type ArgoTy.
You can use IRBuilder's CreateVectorSplat() to simplify this code (https://llvm.org/doxygen/classllvm_1_1IRBuilderBase.html#a40ed7274ff11f079e5b5eae34c818c51).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134071



More information about the llvm-commits mailing list