[all-commits] [llvm/llvm-project] 5732f5: [Attributor] UB Attribute now handles all instruct...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Tue Dec 24 18:46:23 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5732f56bbd28be6cab976e1df0d87ac5ffae7fcd
      https://github.com/llvm/llvm-project/commit/5732f56bbd28be6cab976e1df0d87ac5ffae7fcd
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2019-12-24 (Tue, 24 Dec 2019)

  Changed paths:
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/test/Transforms/Attributor/undefined_behavior.ll

  Log Message:
  -----------
  [Attributor] UB Attribute now handles all instructions that access memory through a pointer

Summary:
Follow-up on: https://reviews.llvm.org/D71435
We basically use `checkForAllInstructions` to loop through all the instructions in a function that access memory through a pointer: load, store, atomicrmw, atomiccmpxchg
Note that we can now use the `getPointerOperand()` that gets us the pointer operand for an instruction that belongs to the aforementioned set.

Question: This function returns `nullptr` if the instruction is `volatile`. Why?
Guess:  Because if it is volatile, we don't want to do any transformation to it.

Another subtle point is that I had to add AtomicRMW, AtomicCmpXchg to `initializeInformationCache()`. Following `checkAllInstructions()` path, that
seemed the most reasonable place to add it and correct the fact that these instructions were ignored (they were not in `OpcodeInstMap` etc.). Is that ok?

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert, sstefan1

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71787




More information about the All-commits mailing list