Improve naming of llvm Instructions created.

We now try harder to keep the names of instructions related to the
initial names of variables they're derived from and so forth.  This
is useful for making both LLVM IR as well as generated C++ code
easier to correlate back to the original ispc source code.

Issue #244.
This commit is contained in:
Matt Pharr
2012-04-19 16:36:46 -07:00
parent 71bdc67a45
commit 32815e628d
4 changed files with 279 additions and 184 deletions

View File

@@ -4402,7 +4402,8 @@ SmearCleanupPass::runOnBasicBlock(llvm::BasicBlock &bb) {
Value *args[1] = { toMatch };
ArrayRef<llvm::Value *> argArray(&args[0], &args[1]);
Instruction *smearCall =
CallInst::Create(smearFunc, argArray, "smear", (Instruction *)NULL);
CallInst::Create(smearFunc, argArray, LLVMGetName(toMatch, "_smear"),
(Instruction *)NULL);
ReplaceInstWithInst(iter, smearCall);