[llvm] [InstCombine] Look through freeze to find insert instruction (PR #86948)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 06:21:56 PDT 2024


================
@@ -173,6 +173,12 @@ Value *llvm::findScalarElement(Value *V, unsigned EltNo) {
   if (Constant *C = dyn_cast<Constant>(V))
     return C->getAggregateElement(EltNo);
 
+  if (auto *F = dyn_cast<FreezeInst>(V)) {
+    if (isGuaranteedNotToBeUndefOrPoison(F)) {
----------------
arsenm wrote:

Won't this always return true? You're passing in the freeze itself. This should be checking F->getOperand(0)?

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


More information about the llvm-commits mailing list