[PATCH] D93065: [InstCombine] Disable optimizations of select instructions that causes propagation of poison values

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 12 09:16:49 PST 2020


spatel added a comment.

You will also need to update several regression tests (`make check` or `ninja check`) to show new canonical form.
I'm still not sure which path (this or insert freezes) is easier/better - if we have perf data, maybe it will tell us how to go?



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2634
+      CondVal->getType()->isVectorTy() == SelType->isVectorTy() &&
+      checkValWidth(TrueVal) && checkValWidth(FalseVal)) {
     // select C, 1, 0 -> zext C to int
----------------
This seems more complicated than necessary. Can't we just transfer the check from the block above to here: 
  if (SelType->isIntOrIntVectorTy() && !SelType->isIntOrIntVectorTy(1) && ...)

We can do that as an NFC preliminary patch regardless of whether we decide to proceed with this or not.


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

https://reviews.llvm.org/D93065



More information about the llvm-commits mailing list