[PATCH] D133309: [GlobalISel] Combine G_INSERT/EXTRACT_VECTOR_ELT with out of bounds indices to undef.
Thorsten via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 5 08:34:19 PDT 2022
tschuett added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2337
+ assert(MI.getOpcode() == TargetOpcode::G_INSERT_VECTOR_ELT ||
+ MI.getOpcode() == TargetOpcode::G_EXTRACT_VECTOR_ELT);
+ LLT VecTy = MRI.getType(MI.getOperand(1).getReg());
----------------
Nit. The text is missing.
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2342
+ auto Idx = getIConstantVRegVal(MI.getOperand(IdxIdx).getReg(), MRI);
+ if (!Idx.has_value())
+ return false;
----------------
If `Idx` is an optional, then you don't need the `has_value`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133309/new/
https://reviews.llvm.org/D133309
More information about the llvm-commits
mailing list