[PATCH] D128911: Emit table lookup from TargetLowering::expandCTTZ()

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 01:00:05 PDT 2022


djtodoro added a comment.

I am wondering, what happens if we use `GlobalIsel` as instruction selector?



================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7845
+                  DAG.getConstant(0x077CB531U, dl, VT)),
+      DAG.getConstant(27, dl, VT));
+
----------------
craig.topper wrote:
> dmgreen wrote:
> > gsocshubham wrote:
> > > Can anyone suggest how do I get reference to table here?
> > > 
> > > If I get a reference here then I can index into the table using above `Lookup`.
> > Eli had some comments in https://reviews.llvm.org/D113291#3540702. DAGCombiner:: convertSelectOfFPConstantsToLoadOffset has some code that emits a table.
> You can't use the original table. It might never have existed in IR or will have been removed once all references to it are removed. You'll need to create a new table in the constant pool.
Agree, a new table is required here.




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

https://reviews.llvm.org/D128911



More information about the llvm-commits mailing list