32
32
#include " llvm/IR/IRBuilder.h"
33
33
#include " llvm/IR/ReplaceConstant.h"
34
34
#include " llvm/Support/FileSystem.h"
35
+ #include " llvm/Support/FormatVariadic.h"
35
36
#include " llvm/TargetParser/Triple.h"
36
37
#include " llvm/Transforms/Utils/BasicBlockUtils.h"
37
38
#include " llvm/Transforms/Utils/ModuleUtils.h"
@@ -525,7 +526,8 @@ static llvm::omp::ProcBindKind getProcBindKind(omp::ClauseProcBindKind kind) {
525
526
// / been mapped to LLVM IR values.
526
527
static LogicalResult
527
528
convertIgnoredWrapper (omp::LoopWrapperInterface opInst,
528
- LLVM::ModuleTranslation &moduleTranslation) {
529
+ LLVM::ModuleTranslation &moduleTranslation,
530
+ const char *warningFmt) {
529
531
// Map block arguments directly to the LLVM value associated to the
530
532
// corresponding operand. This is semantically equivalent to this wrapper not
531
533
// being present.
@@ -542,11 +544,11 @@ convertIgnoredWrapper(omp::LoopWrapperInterface opInst,
542
544
forwardArgs (blockArgIface.getPrivateBlockArgs (), op.getPrivateVars ());
543
545
forwardArgs (blockArgIface.getReductionBlockArgs (),
544
546
op.getReductionVars ());
545
- op.emitWarning () << " simd information on composite construct discarded " ;
547
+ op.emitWarning () << llvm::formatv (warningFmt, " simd" ) ;
546
548
return success ();
547
549
})
548
550
.Default ([&](Operation *op) {
549
- return op->emitError () << " cannot ignore nested wrapper" ;
551
+ return op->emitError () << " cannot ignore wrapper" ;
550
552
});
551
553
}
552
554
@@ -567,7 +569,9 @@ convertIgnoredWrappers(omp::LoopNestOp loopOp,
567
569
for (auto it =
568
570
std::next (std::find (wrappers.rbegin (), wrappers.rend (), parentOp));
569
571
it != wrappers.rend (); ++it) {
570
- if (failed (convertIgnoredWrapper (*it, moduleTranslation)))
572
+ if (failed (convertIgnoredWrapper (
573
+ *it, moduleTranslation,
574
+ " {0} information on composite construct discarded" )))
571
575
return failure ();
572
576
}
573
577
@@ -2518,7 +2522,8 @@ convertOmpSimd(Operation &opInst, llvm::IRBuilderBase &builder,
2518
2522
2519
2523
// This is needed to make sure that uses of entry block arguments for clauses
2520
2524
// that are not going to be translated are mapped to the outside values.
2521
- if (failed (convertIgnoredWrapper (simdOp, moduleTranslation)))
2525
+ if (failed (convertIgnoredWrapper (simdOp, moduleTranslation,
2526
+ " {0} clauses ignored" )))
2522
2527
return failure ();
2523
2528
2524
2529
auto loopNestConversionResult = convertLoopNestHelper (
0 commit comments