[llvm] [InstCombine] Convert load from LUT into a select (PR #98339)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 12:00:33 PDT 2024


================
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -passes=instcombine -S -data-layout="p:32:32:32-p1:16:16:16-p2:128:128:128:32-n8:16:32:64" < %s | FileCheck %s
+; RUN: opt -passes="instcombine<max-iterations=2>" -S -data-layout="p:32:32:32-p1:16:16:16-p2:128:128:128:32-n8:16:32:64" < %s | FileCheck %s
----------------
nikic wrote:

Hm, I think this may be because ConstantFoldConstant first does recursive folding, and probably infers an inbounds that needed to fold the icmp. Maybe should explicitly call ConstantFoldConstant on the arms? We're not guaranteed that global initializers are fully folded inside InstCombine.

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


More information about the llvm-commits mailing list