[llvm] [VPlan] Don't rely on region check in isUniformAfterVectorization. (PR #137883)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 13:30:27 PDT 2025


================
@@ -39,18 +39,37 @@ const SCEV *getSCEVExprForVPValue(VPValue *V, ScalarEvolution &SE);
 
 /// Returns true if \p VPV is uniform after vectorization.
 inline bool isUniformAfterVectorization(const VPValue *VPV) {
+  auto IsKnownUniformOpcode = [](auto *R) -> bool {
+    return Instruction::isBinaryOp(R->getOpcode()) ||
+           Instruction::isCast(R->getOpcode()) ||
+           R->getOpcode() == Instruction::GetElementPtr ||
+           R->getOpcode() == Instruction::ICmp ||
+           R->getOpcode() == Instruction::FCmp;
+  };
+
   // A value defined outside the vector region must be uniform after
   // vectorization inside a vector region.
----------------
fhahn wrote:

done thanks

https://github.com/llvm/llvm-project/pull/137883


More information about the llvm-commits mailing list