[PATCH] D76483: [DivRemPairs] Freeze operands if they can be undef values

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 20 05:23:34 PDT 2020


spatel added a comment.

I agree that this is a good candidate for introducing more freeze.
Just to check my understanding of current behavior: the freeze insts will survive to SelectionDAGBuilder, and there they get removed?



================
Comment at: llvm/lib/Transforms/Scalar/DivRemPairs.cpp:307
 
+      // If X can be undef, X should be freezed first.
+      // For example, let's assume that Y = 1 & X = undef:
----------------
freezed -> frozen


================
Comment at: llvm/lib/Transforms/Scalar/DivRemPairs.cpp:315
+      //   %rem = sub %x, %mul  // %rem = undef - undef = undef
+      // If X is not freezed, %rem becomes undef after transformation.
+      // TODO: We need a undef-specific checking function in ValueTracking
----------------
freezed -> frozen


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76483





More information about the llvm-commits mailing list