[PATCH] D71952: [X86][InstCombine] Add constant folding and simplification support for pdep and pext

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 28 01:29:44 PST 2019


RKSimon added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2501
+          BitToSet <<= 1;
+          Mask ^= BitToTest; // Clear isolated bit.
+        }
----------------
clang format comment?


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2522
+
+        while (Mask) {
+          // Isolate lowest set bit.
----------------
Can you confirm this is correct? It doesn't seem to match:

https://www.felixcloutier.com/x86/pdep
https://www.chessprogramming.org/BMI2#PDEP

But it might just be that my brain is still in a Christmas blur......


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2529
+          BitToTest <<= 1;
+          Mask ^= BitToSet; // Clear isolated bit.
+        }
----------------
clang format comment?


================
Comment at: llvm/test/Transforms/InstCombine/X86/x86-bmi-tbm.ll:283
+  ret i32 %1
+}
+
----------------
Worth also testing with a non-constant arg0 for the zero/allbits mask cases?


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

https://reviews.llvm.org/D71952





More information about the llvm-commits mailing list