It was causing a crash because we were trying to get the definition of a target register. Fixed the issue by adding a check and added a test case for that. llvm-svn: 346251