[PATCH] D122913: [InstCombine] Simplify PHI node whose type and type of its cond differ
Hirochika Matsumoto via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 1 08:53:08 PDT 2022
hkmatsumoto added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp:1292
Value *Cond;
- SmallDenseMap<ConstantInt *, BasicBlock *, 8> SuccForValue;
+ SmallDenseMap<APInt, BasicBlock *, 8> SuccForValue;
SmallDenseMap<BasicBlock *, unsigned, 8> SuccCount;
----------------
Since we now have to store integers of heterogeneous types (e.g. i8 1 vs i32 1), we have to align integer types to the biggest one when accessing to SmallDenseMap. APInt has an API for aligning integers types (sextOrSelf) but not for ConstantInt AFAIK, that's why the type had to be changed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122913/new/
https://reviews.llvm.org/D122913
More information about the llvm-commits
mailing list