diff options
author | Sanjay Patel <spatel@rotateright.com> | 2020-06-18 15:44:02 -0400 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2020-06-18 15:47:06 -0400 |
commit | 46a285ad9e34dc6ccfd2530835687cac4cd67e3e (patch) | |
tree | b48988547470653379ed8ea187a72518fae49077 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 50939c0a67619b77d085bfafb2cedda413d57b7a (diff) | |
download | llvm-46a285ad9e34dc6ccfd2530835687cac4cd67e3e.zip llvm-46a285ad9e34dc6ccfd2530835687cac4cd67e3e.tar.gz llvm-46a285ad9e34dc6ccfd2530835687cac4cd67e3e.tar.bz2 |
[IRBuilder] add/use wrapper to create a generic compare based on predicate type; NFC
The predicate can always be used to distinguish between icmp and fcmp,
so we don't need to keep repeating this check in the callers.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 16603bf..2c66441 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -870,14 +870,7 @@ Value *llvm::createMinMaxOp(IRBuilderBase &Builder, FastMathFlags FMF; FMF.setFast(); Builder.setFastMathFlags(FMF); - - Value *Cmp; - if (RK == RecurrenceDescriptor::MRK_FloatMin || - RK == RecurrenceDescriptor::MRK_FloatMax) - Cmp = Builder.CreateFCmp(P, Left, Right, "rdx.minmax.cmp"); - else - Cmp = Builder.CreateICmp(P, Left, Right, "rdx.minmax.cmp"); - + Value *Cmp = Builder.CreateCmp(P, Left, Right, "rdx.minmax.cmp"); Value *Select = Builder.CreateSelect(Cmp, Left, Right, "rdx.minmax.select"); return Select; } |