[PATCH] D143016: [InstCombine] Promote expression tree with @llvm.vscale when zero-extending result.

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 14:12:24 PST 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:260
+            Intrinsic::getDeclaration(I->getModule(), Intrinsic::vscale, {Ty});
+        Res = CallInst::Create(Fn->getFunctionType(), Fn);
+        break;
----------------
Since `Res` is conditionally set here (i.e we can have `Call` w.o it being `vscale` think this may segfault b.c `Res` is set `nullptr` above and unconditionally derefenced below.


================
Comment at: llvm/test/Transforms/InstCombine/AArch64/vscale.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -passes='instcombine' -S < %s | FileCheck %s
----------------
Can the tests the split into a separate patch so we can see the diff?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143016



More information about the llvm-commits mailing list