[PATCH] D29897: [BypassSlowDivision] Use ValueTracking to simplify run-time checks

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 13:04:21 PST 2017


jlebar added a comment.

> As for tests, it was discussed in https://reviews.llvm.org/D28196 that it's better to have them that detailed.

I read the discussion in that thread differently.

I see it saying: *if* we are writing llc tests, then maybe we should leave them detailed.

However, we don't have to write llc tests.  We can write an opt test, and write regular checks over LLVM IR.



================
Comment at: lib/Transforms/Utils/BypassSlowDivision.cpp:194
 
+/// Check if an integer value fits into a smaller type.
+ValueRange FastDivInsertionTask::getValueRange(Value *Op,
----------------
n.bozhenov wrote:
> jlebar wrote:
> > Maybe, "check if an integer type fits into our bypass type"?
> Not sure what you mean. Here we're testing not a type (how many bits it has?) but a value (may there be any non-zero upper bits?).
Yes, I had a typo, I meant "Check if an integer value fits into our bypass type."

What I wanted was the change s/a smaller type/our bypass type/, because this function does not check whether V fits into an arbitrary smaller type, but rather checks specifically if it fits into the bypass type.


https://reviews.llvm.org/D29897





More information about the llvm-commits mailing list