Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
llvm/include/llvm/IR/IRBuilder.h | ||
---|---|---|
1369 | Why can't this keep using Folder.CreateFNeg? CreateNot uses Folder.CreateNot. |
llvm/include/llvm/IR/IRBuilder.h | ||
---|---|---|
1379 | It feels weird that this creates unaryoperator::fneg but CreateFNeg uses the binaryoperator. Shouldn't these be consistent until we switch over? |
llvm/include/llvm/IR/IRBuilder.h | ||
---|---|---|
1369 | I considered this also and went with something more like CreateBinOp (see CreateUnOp too). The UnOps are odd ducks since they’re not really unary operators, but rather they’re implemented with existing BinOps. IMO, we should be moving away from the weirdness of the UnOps... I don’t feel very strongly about this though. If you think the current UnOp direction is better, that’s fine with me. | |
1379 | So I did consider that. My thinking was that we wouldn’t be regressing calling the UnaryOperator here, since it’s brand new code, so it’s better to move towards the goal. The reason we haven’t updated the old BinaryOperator code yet is that we’re afraid of regressions. I do see your point though... Also, let me be clear that this function will have at least one use in a patch to come. I’ve just broken out this digestible chunk for now. |
llvm/include/llvm/IR/IRBuilder.h | ||
---|---|---|
1369 | Oh oh, I just remembered why I went down the BinOps path. If I’m not mistaken, the Folder.CreateFNeg method throws away FMF when there’s no folder. I wanted to avoid that. I’ll confirm in the morning... |
llvm/include/llvm/IR/IRBuilder.h | ||
---|---|---|
1369 |
I confused myself. That is a problem, but it's not this problem. In general, when the NoFolder is used, the new CreateF*FMF(...) instruction picks up the default FMFs from the IRBuilder, not the instruction it's supposed to copy from. So, yeah, I could change this code back to make it look more like CreateNot, if that's the preference. | |
llvm/unittests/IR/PatternMatch.cpp | ||
641 | Just realized I misplaced these tests, so I'll have to update them. |
Moving the test ended up being a can of worms. I'm going to abandon this Diff to split it into two...
Why can't this keep using Folder.CreateFNeg? CreateNot uses Folder.CreateNot.