[llvm] [ValueTracking] Filter out non-interesting conditions (PR #118493)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 7 00:41:11 PST 2024


================
@@ -18,18 +18,34 @@
 #define LLVM_ANALYSIS_DOMCONDITIONCACHE_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
+#include <cstdint>
 
 namespace llvm {
 
 class Value;
 class BranchInst;
 
+enum class DomConditionFlag : uint8_t {
+  None = 0,
+  KnownBits = 1 << 0,
+  KnownFPClass = 1 << 1,
+  PowerOfTwo = 1 << 2,
+  ICmp = 1 << 3,
+};
+
+LLVM_DECLARE_ENUM_AS_BITMASK(
+    DomConditionFlag,
+    /*LargestValue=*/static_cast<uint8_t>(DomConditionFlag::ICmp));
+
 class DomConditionCache {
 private:
   /// A map of values about which a branch might be providing information.
-  using AffectedValuesMap = DenseMap<Value *, SmallVector<BranchInst *, 1>>;
+  using AffectedValuesMap =
----------------
dtcxzyw wrote:

Compile-time impact looks worse: http://llvm-compile-time-tracker.com/compare.php?from=6328e0ff42d29db0923615afd8430b4518e8ecbe&to=4b0feb47aec9e3a854610e8a223511e7f830f0b1&stat=instructions:u

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


More information about the llvm-commits mailing list