[PATCH] D128302: [AArch64][CostModel] Detects that ExtractElement at index is not free in AArch64 when result is used as integer.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 12:13:39 PDT 2022


nikic resigned from this revision.
nikic added a comment.

(Not really familiar with cost model APIs.)



================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1868
+        Instruction *UserI = dyn_cast<Instruction>(U.getUser());
+        // FIXME: Shall all users be of type Instruction?
+        if (!UserI)
----------------
Yes, all users of an instruction are instructions, it's safe to use `cast` here.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1879
+          // integer.
+          if (SI->getValueOperand() == SI->getOperand(U.getOperandNo()))
+            continue;
----------------
This should probably be just `U.getOperandNo() == 0`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128302



More information about the llvm-commits mailing list